diff --git a/tests-1.2/basic.py b/tests-1.2/basic.py
index 3a9c3d8..2fd7fb9 100644
--- a/tests-1.2/basic.py
+++ b/tests-1.2/basic.py
@@ -8,23 +8,13 @@
 
 import sys
 import logging
-
 import unittest
-
-import oftest.controller as controller
-import oftest.dataplane as dataplane
-import oftest.base_tests as base_tests
+import ipaddr
 
 from oftest import config
-import oftest.controller as controller
-import oftest.dataplane as dataplane
+import ofp
 import oftest.base_tests as base_tests
-import of12.cstruct as ofp
-import of12.message as message
-import of12.action as action
-
 import oftest.oft12.testutils as testutils
-import ipaddr
 
 class Echo(base_tests.SimpleProtocol):
     """
@@ -38,7 +28,7 @@
     Test echo response with short string data
     """
     def runTest(self):
-        request = message.echo_request()
+        request = ofp.message.echo_request()
         request.data = 'OpenFlow Will Rule The World'
         response, _ = self.controller.transact(request)
         self.assertEqual(response.header.type, ofp.OFPT_ECHO_REPLY,
@@ -55,7 +45,7 @@
     Does NOT test the contents; just that we get a response
     """
     def runTest(self):
-        request = message.features_request()
+        request = ofp.message.features_request()
         response,_ = self.controller.transact(request)
         self.assertTrue(response,"Got no features_reply to features_request")
         self.assertEqual(response.header.type, ofp.OFPT_FEATURES_REPLY,
@@ -118,10 +108,10 @@
         of_ports = config["port_map"].keys()
         of_ports.sort()
         for dp_port in of_ports:
-            msg = message.packet_out()
+            msg = ofp.message.packet_out()
             msg.in_port = ofp.OFPP_CONTROLLER
             msg.data = str(outpkt)
-            act = action.action_output()
+            act = ofp.action.action_output()
             act.port = dp_port
             self.assertTrue(msg.actions.add(act), 'Could not add action to msg')
 
@@ -150,7 +140,7 @@
     def runTest(self):
         logging.info("Running StatsGet")
         logging.info("Inserting trial flow")
-        request = message.flow_mod()
+        request = ofp.message.flow_mod()
         request.buffer_id = 0xffffffff
         for i in range(1,5):
             request.priority = i*1000
@@ -160,13 +150,13 @@
         logging.info("Removing all flows")
         testutils.delete_all_flows(self.controller, logging)
         logging.info("Sending flow request")
-        request = message.flow_stats_request()
+        request = ofp.message.flow_stats_request()
         request.out_port = ofp.OFPP_ANY
         request.out_group = ofp.OFPG_ANY
         request.table_id = 0xff
         response, _ = self.controller.transact(request, timeout=2)
         self.assertTrue(response is not None, "Did not get response")
-        self.assertTrue(isinstance(response,message.flow_stats_reply),"Not a flow_stats_reply")
+        self.assertTrue(isinstance(response,ofp.message.flow_stats_reply),"Not a flow_stats_reply")
         self.assertEqual(len(response.stats),0)
         logging.debug(response.show())
         
@@ -181,7 +171,7 @@
     def runTest(self):
         logging.info("Running StatsGet")
         logging.info("Inserting trial flow")
-        request = message.flow_mod()
+        request = ofp.message.flow_mod()
         request.buffer_id = 0xffffffff
         rv = self.controller.message_send(request)
         self.assertTrue(rv != -1, "Failed to insert test flow")
@@ -200,7 +190,7 @@
     def runTest(self):
         logging.info("Running TableStatsGet")
         logging.info("Sending table stats request")
-        request = message.table_stats_request()
+        request = ofp.message.table_stats_request()
         response, _ = self.controller.transact(request, timeout=2)
         self.assertTrue(response is not None, "Did not get response")
         logging.debug(response.show())
@@ -214,7 +204,7 @@
 
     def runTest(self):
         logging.info("Running " + str(self))
-        request = message.flow_mod()
+        request = ofp.message.flow_mod()
         request.buffer_id = 0xffffffff
         rv = self.controller.message_send(request)
         self.assertTrue(rv != -1, "Error installing flow mod")
@@ -267,7 +257,7 @@
     """        
     def runTest(self):
         logging.info("Running " + str(self))
-        table_mod = message.table_mod()
+        table_mod = ofp.message.table_mod()
         table_mod.table_id = 0 # first table should always exist
         table_mod.config = ofp.OFPTC_TABLE_MISS_CONTROLLER
         
