diff --git a/Dockerfile.synchronizer b/Dockerfile.synchronizer
index 25a36a5..0cf80bc 100644
--- a/Dockerfile.synchronizer
+++ b/Dockerfile.synchronizer
@@ -16,7 +16,7 @@
 
 # xosproject/att-workflow-driver-synchronizer
 
-FROM xosproject/xos-synchronizer-base:2.1.32
+FROM xosproject/xos-synchronizer-base:2.1.38
 
 COPY xos/synchronizer /opt/xos/synchronizers/att-workflow-driver
 COPY VERSION /opt/xos/synchronizers/att-workflow-driver/
diff --git a/VERSION b/VERSION
index 9181b73..c0dc775 100644
--- a/VERSION
+++ b/VERSION
@@ -1,2 +1,2 @@
-1.0.17
+1.0.18
 
diff --git a/xos/synchronizer/att-workflow-driver-synchronizer.py b/xos/synchronizer/att-workflow-driver-synchronizer.py
old mode 100755
new mode 100644
index f9ea235..9b420e7
--- a/xos/synchronizer/att-workflow-driver-synchronizer.py
+++ b/xos/synchronizer/att-workflow-driver-synchronizer.py
@@ -18,11 +18,11 @@
 
 # This imports and runs ../../xos-observer.py
 
-import importlib
 import os
-import sys
+from xossynchronizer import Synchronizer
 from xosconfig import Config
 
+
 base_config_file = os.path.abspath(os.path.dirname(os.path.realpath(__file__)) + '/config.yaml')
 mounted_config_file = os.path.abspath(os.path.dirname(os.path.realpath(__file__)) + '/mounted_config.yaml')
 
@@ -31,7 +31,4 @@
 else:
     Config.init(base_config_file, 'synchronizer-config-schema.yaml')
 
-observer_path = os.path.join(os.path.dirname(os.path.realpath(__file__)),"../../synchronizers/new_base")
-sys.path.append(observer_path)
-mod = importlib.import_module("xos-synchronizer")
-mod.main()
+Synchronizer().run()
\ No newline at end of file
diff --git a/xos/synchronizer/event_steps/auth_event.py b/xos/synchronizer/event_steps/auth_event.py
index b181121..5f4c480 100644
--- a/xos/synchronizer/event_steps/auth_event.py
+++ b/xos/synchronizer/event_steps/auth_event.py
@@ -17,8 +17,7 @@
 import time
 import os
 import sys
-from synchronizers.new_base.eventstep import EventStep
-from synchronizers.new_base.modelaccessor import model_accessor
+from xossynchronizer.event_steps.eventstep import EventStep
 from helpers import AttHelpers
 
 class SubscriberAuthEventStep(EventStep):
@@ -31,8 +30,8 @@
     def process_event(self, event):
         value = json.loads(event.value)
 
-        onu_sn = AttHelpers.get_onu_sn(self.log, value)
-        si = AttHelpers.get_si_by_sn(self.log, onu_sn)
+        onu_sn = AttHelpers.get_onu_sn(self.model_accessor, self.log, value)
+        si = AttHelpers.get_si_by_sn(self.model_accessor, self.log, onu_sn)
         if not si:
             self.log.exception("authentication.events: Cannot find att-workflow-driver service instance for this event", kafka_event=value)
             raise Exception("authentication.events: Cannot find att-workflow-driver service instance for this event")
diff --git a/xos/synchronizer/event_steps/dhcp_event.py b/xos/synchronizer/event_steps/dhcp_event.py
index 1b3033a..ab411f7 100644
--- a/xos/synchronizer/event_steps/dhcp_event.py
+++ b/xos/synchronizer/event_steps/dhcp_event.py
@@ -17,8 +17,7 @@
 import time
 import os
 import sys
-from synchronizers.new_base.eventstep import EventStep
-from synchronizers.new_base.modelaccessor import VOLTService, RCORDSubscriber, model_accessor
+from xossynchronizer.event_steps.eventstep import EventStep
 from helpers import AttHelpers
 
 class SubscriberDhcpEventStep(EventStep):
@@ -31,8 +30,8 @@
     def process_event(self, event):
         value = json.loads(event.value)
 
-        onu_sn = AttHelpers.get_onu_sn(self.log, value)
-        si = AttHelpers.get_si_by_sn(self.log, onu_sn)
+        onu_sn = AttHelpers.get_onu_sn(self.model_accessor, self.log, value)
+        si = AttHelpers.get_si_by_sn(self.model_accessor, self.log, onu_sn)
 
         if not si:
             self.log.exception("dhcp.events: Cannot find att-workflow-driver service instance for this event", kafka_event=value)
diff --git a/xos/synchronizer/event_steps/onu_event.py b/xos/synchronizer/event_steps/onu_event.py
index d205a59..905b6dc 100644
--- a/xos/synchronizer/event_steps/onu_event.py
+++ b/xos/synchronizer/event_steps/onu_event.py
@@ -15,8 +15,7 @@
 
 
 import json
-from synchronizers.new_base.eventstep import EventStep
-from synchronizers.new_base.modelaccessor import AttWorkflowDriverService, AttWorkflowDriverServiceInstance, model_accessor
+from xossynchronizer.event_steps.eventstep import EventStep
 
 class ONUEventStep(EventStep):
     topics = ["onu.events"]
@@ -29,18 +28,18 @@
 
     def get_att_si(self, event):
         try:
-            att_si = AttWorkflowDriverServiceInstance.objects.get(serial_number=event["serial_number"])
+            att_si = self.model_accessor.AttWorkflowDriverServiceInstance.objects.get(serial_number=event["serial_number"])
             att_si.no_sync = False;
             att_si.uni_port_id = event["uni_port_id"]
             att_si.of_dpid = event["of_dpid"]
             self.log.debug("onu.events: Found existing AttWorkflowDriverServiceInstance", si=att_si)
         except IndexError:
             # create an AttWorkflowDriverServiceInstance, the validation will be triggered in the corresponding sync step
-            att_si = AttWorkflowDriverServiceInstance(
+            att_si = self.model_accessor.AttWorkflowDriverServiceInstance(
                 serial_number=event["serial_number"],
                 of_dpid=event["of_dpid"],
                 uni_port_id=event["uni_port_id"],
-                owner=AttWorkflowDriverService.objects.first() # we assume there is only one AttWorkflowDriverService
+                owner=self.model_accessor.AttWorkflowDriverService.objects.first() # we assume there is only one AttWorkflowDriverService
             )
             self.log.debug("onu.events: Created new AttWorkflowDriverServiceInstance", si=att_si)
         return att_si
diff --git a/xos/synchronizer/event_steps/test_auth_event.py b/xos/synchronizer/event_steps/test_auth_event.py
index 5587940..ea27358 100644
--- a/xos/synchronizer/event_steps/test_auth_event.py
+++ b/xos/synchronizer/event_steps/test_auth_event.py
@@ -18,34 +18,13 @@
 
 import os, sys
 
-# Hack to load synchronizer framework
 test_path=os.path.abspath(os.path.dirname(os.path.realpath(__file__)))
-service_dir=os.path.join(test_path, "../../../..")
-xos_dir=os.path.join(test_path, "../../..")
-if not os.path.exists(os.path.join(test_path, "new_base")):
-    xos_dir=os.path.join(test_path, "../../../../../../orchestration/xos/xos")
-    services_dir=os.path.join(xos_dir, "../../xos_services")
-# END Hack to load synchronizer framework
-
-# generate model from xproto
-def get_models_fn(service_name, xproto_name):
-    name = os.path.join(service_name, "xos", xproto_name)
-    if os.path.exists(os.path.join(services_dir, name)):
-        return name
-    else:
-        name = os.path.join(service_name, "xos", "synchronizer", "models", xproto_name)
-        if os.path.exists(os.path.join(services_dir, name)):
-            return name
-    raise Exception("Unable to find service=%s xproto=%s" % (service_name, xproto_name))
-# END generate model from xproto
 
 class TestSubscriberAuthEvent(unittest.TestCase):
 
     def setUp(self):
 
         self.sys_path_save = sys.path
-        sys.path.append(xos_dir)
-        sys.path.append(os.path.join(xos_dir, 'synchronizers', 'new_base'))
 
         # Setting up the config module
         from xosconfig import Config
@@ -56,24 +35,27 @@
         log = create_logger(Config().get('logging'))
         # END Setting up the config module
 
-        from synchronizers.new_base.mock_modelaccessor_build import build_mock_modelaccessor
-        # build_mock_modelaccessor(xos_dir, services_dir, [get_models_fn("olt-service", "volt.xproto")])
+        from xossynchronizer.mock_modelaccessor_build import mock_modelaccessor_config
+        mock_modelaccessor_config(test_path, [("att-workflow-driver", "att-workflow-driver.xproto"),
+                                              ("olt-service", "volt.xproto"),
+                                              ("../profiles/rcord", "rcord.xproto")])
 
-        build_mock_modelaccessor(xos_dir, services_dir, [
-            get_models_fn("att-workflow-driver", "att-workflow-driver.xproto"),
-            get_models_fn("olt-service", "volt.xproto"),
-            get_models_fn("../profiles/rcord", "rcord.xproto")
-        ])
-        import synchronizers.new_base.modelaccessor
-        from auth_event import SubscriberAuthEventStep, model_accessor
+        import xossynchronizer.modelaccessor
+        import mock_modelaccessor
+        reload(mock_modelaccessor) # in case nose2 loaded it in a previous test
+        reload(xossynchronizer.modelaccessor)      # in case nose2 loaded it in a previous test
+
+        from xossynchronizer.modelaccessor import model_accessor
+        from auth_event import SubscriberAuthEventStep
 
         # import all class names to globals
         for (k, v) in model_accessor.all_model_classes.items():
             globals()[k] = v
 
+        self.model_accessor = model_accessor
         self.log = log
 
-        self.event_step = SubscriberAuthEventStep(self.log)
+        self.event_step = SubscriberAuthEventStep(model_accessor=self.model_accessor, log=self.log)
 
         self.event = Mock()
 
@@ -109,3 +91,7 @@
 
             self.hippie_si.save.assert_called_with(always_update_timestamp=True, update_fields=['authentication_state', 'serial_number', 'updated'])
             self.assertEqual(self.hippie_si.authentication_state, 'APPROVED')
+
+if __name__ == '__main__':
+    sys.path.append("..") # for import of helpers.py
+    unittest.main()
\ No newline at end of file
diff --git a/xos/synchronizer/event_steps/test_dhcp_event.py b/xos/synchronizer/event_steps/test_dhcp_event.py
index a31bf3f..ccd4d10 100644
--- a/xos/synchronizer/event_steps/test_dhcp_event.py
+++ b/xos/synchronizer/event_steps/test_dhcp_event.py
@@ -18,34 +18,13 @@
 
 import os, sys
 
-# Hack to load synchronizer framework
 test_path=os.path.abspath(os.path.dirname(os.path.realpath(__file__)))
-service_dir=os.path.join(test_path, "../../../..")
-xos_dir=os.path.join(test_path, "../../..")
-if not os.path.exists(os.path.join(test_path, "new_base")):
-    xos_dir=os.path.join(test_path, "../../../../../../orchestration/xos/xos")
-    services_dir=os.path.join(xos_dir, "../../xos_services")
-# END Hack to load synchronizer framework
-
-# generate model from xproto
-def get_models_fn(service_name, xproto_name):
-    name = os.path.join(service_name, "xos", xproto_name)
-    if os.path.exists(os.path.join(services_dir, name)):
-        return name
-    else:
-        name = os.path.join(service_name, "xos", "synchronizer", "models", xproto_name)
-        if os.path.exists(os.path.join(services_dir, name)):
-            return name
-    raise Exception("Unable to find service=%s xproto=%s" % (service_name, xproto_name))
-# END generate model from xproto
 
 class TestSubscriberAuthEvent(unittest.TestCase):
 
     def setUp(self):
 
         self.sys_path_save = sys.path
-        sys.path.append(xos_dir)
-        sys.path.append(os.path.join(xos_dir, 'synchronizers', 'new_base'))
 
         # Setting up the config module
         from xosconfig import Config
@@ -56,24 +35,27 @@
         log = create_logger(Config().get('logging'))
         # END Setting up the config module
 
-        from synchronizers.new_base.mock_modelaccessor_build import build_mock_modelaccessor
-        # build_mock_modelaccessor(xos_dir, services_dir, [get_models_fn("olt-service", "volt.xproto")])
+        from xossynchronizer.mock_modelaccessor_build import mock_modelaccessor_config
+        mock_modelaccessor_config(test_path, [("att-workflow-driver", "att-workflow-driver.xproto"),
+                                              ("olt-service", "volt.xproto"),
+                                              ("../profiles/rcord", "rcord.xproto")])
 
-        build_mock_modelaccessor(xos_dir, services_dir, [
-            get_models_fn("att-workflow-driver", "att-workflow-driver.xproto"),
-            get_models_fn("olt-service", "volt.xproto"),
-            get_models_fn("../profiles/rcord", "rcord.xproto")
-        ])
-        import synchronizers.new_base.modelaccessor
-        from dhcp_event import SubscriberDhcpEventStep, model_accessor
+        import xossynchronizer.modelaccessor
+        import mock_modelaccessor
+        reload(mock_modelaccessor) # in case nose2 loaded it in a previous test
+        reload(xossynchronizer.modelaccessor)      # in case nose2 loaded it in a previous test
+
+        from xossynchronizer.modelaccessor import model_accessor
+        from dhcp_event import SubscriberDhcpEventStep
 
         # import all class names to globals
         for (k, v) in model_accessor.all_model_classes.items():
             globals()[k] = v
 
+        self.model_accessor = model_accessor
         self.log = log
 
-        self.event_step = SubscriberDhcpEventStep(self.log)
+        self.event_step = SubscriberDhcpEventStep(model_accessor=self.model_accessor, log=self.log)
 
         self.event = Mock()
 
@@ -110,6 +92,8 @@
             patch.object(AttWorkflowDriverServiceInstance.objects, "get_items") as si_mock, \
             patch.object(self.volt, "get_onu_sn_from_openflow") as get_onu_sn:
 
+            self.assertTrue(VOLTService.objects.first() is not None)
+
             volt_service_mock.return_value = [self.volt]
             get_onu_sn.return_value = "BRCM1234"
             si_mock.return_value = [self.si]
@@ -120,3 +104,7 @@
             self.assertEqual(self.si.dhcp_state, "DHCPREQUEST")
             self.assertEqual(self.si.mac_address, self.mac_address)
             self.assertEqual(self.si.ip_address, self.ip_address)
+
+if __name__ == '__main__':
+    sys.path.append("..") # for import of helpers.py
+    unittest.main()
\ No newline at end of file
diff --git a/xos/synchronizer/event_steps/test_onu_events.py b/xos/synchronizer/event_steps/test_onu_events.py
index bea8c0c..6bfb837 100644
--- a/xos/synchronizer/event_steps/test_onu_events.py
+++ b/xos/synchronizer/event_steps/test_onu_events.py
@@ -18,35 +18,13 @@
 
 import os, sys
 
-# Hack to load synchronizer framework
 test_path=os.path.abspath(os.path.dirname(os.path.realpath(__file__)))
-xos_dir=os.path.join(test_path, "../../..")
-if not os.path.exists(os.path.join(test_path, "new_base")):
-    xos_dir=os.path.join(test_path, "../../../../../../orchestration/xos/xos")
-    services_dir = os.path.join(xos_dir, "../../xos_services")
-sys.path.append(xos_dir)
-sys.path.append(os.path.join(xos_dir, 'synchronizers', 'new_base'))
-# END Hack to load synchronizer framework
-
-# generate model from xproto
-def get_models_fn(service_name, xproto_name):
-    name = os.path.join(service_name, "xos", xproto_name)
-    if os.path.exists(os.path.join(services_dir, name)):
-        return name
-    else:
-        name = os.path.join(service_name, "xos", "synchronizer", "models", xproto_name)
-        if os.path.exists(os.path.join(services_dir, name)):
-            return name
-    raise Exception("Unable to find service=%s xproto=%s" % (service_name, xproto_name))
-# END generate model from xproto
 
 class TestSyncOLTDevice(unittest.TestCase):
 
     def setUp(self):
 
         self.sys_path_save = sys.path
-        sys.path.append(xos_dir)
-        sys.path.append(os.path.join(xos_dir, 'synchronizers', 'new_base'))
 
         # Setting up the config module
         from xosconfig import Config
@@ -55,26 +33,27 @@
         Config.init(config, "synchronizer-config-schema.yaml")
         # END Setting up the config module
 
-        from synchronizers.new_base.mock_modelaccessor_build import build_mock_modelaccessor
-        # build_mock_modelaccessor(xos_dir, services_dir, [get_models_fn("olt-service", "volt.xproto")])
+        from xossynchronizer.mock_modelaccessor_build import mock_modelaccessor_config
+        mock_modelaccessor_config(test_path, [("att-workflow-driver", "att-workflow-driver.xproto"),
+                                              ("olt-service", "volt.xproto"),
+                                              ("../profiles/rcord", "rcord.xproto")])
 
-        # FIXME this is to get jenkins to pass the tests, somehow it is running tests in a different order
-        # and apparently it is not overriding the generated model accessor
-        build_mock_modelaccessor(xos_dir, services_dir, [
-            get_models_fn("att-workflow-driver", "att-workflow-driver.xproto"),
-            get_models_fn("olt-service", "volt.xproto"),
-            get_models_fn("../profiles/rcord", "rcord.xproto")
-        ])
-        import synchronizers.new_base.modelaccessor
-        from onu_event import ONUEventStep, model_accessor
+        import xossynchronizer.modelaccessor
+        import mock_modelaccessor
+        reload(mock_modelaccessor) # in case nose2 loaded it in a previous test
+        reload(xossynchronizer.modelaccessor)      # in case nose2 loaded it in a previous test
+
+        from xossynchronizer.modelaccessor import model_accessor
+        from onu_event import ONUEventStep
 
         # import all class names to globals
         for (k, v) in model_accessor.all_model_classes.items():
             globals()[k] = v
 
+        self.model_accessor = model_accessor
         self.log = Mock()
 
-        self.event_step = ONUEventStep(self.log)
+        self.event_step = ONUEventStep(model_accessor=self.model_accessor, log=self.log)
 
         self.event = Mock()
         self.event_dict = {
@@ -163,4 +142,5 @@
             self.assertEqual(att_si.onu_state, "DISABLED")
 
 if __name__ == '__main__':
+    sys.path.append("..")  # for import of helpers.py
     unittest.main()
\ No newline at end of file
diff --git a/xos/synchronizer/helpers.py b/xos/synchronizer/helpers.py
index 6b4b2b5..9a2d035 100644
--- a/xos/synchronizer/helpers.py
+++ b/xos/synchronizer/helpers.py
@@ -12,12 +12,11 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-from synchronizers.new_base.syncstep import DeferredException
-from synchronizers.new_base.modelaccessor import AttWorkflowDriverWhiteListEntry, AttWorkflowDriverServiceInstance, ONUDevice, VOLTService, model_accessor
+from xossynchronizer.steps.syncstep import DeferredException
 
 class AttHelpers():
     @staticmethod
-    def validate_onu(log, att_si):
+    def validate_onu(model_accessor, log, att_si):
         """
         This method validate an ONU against the whitelist and set the appropriate state.
         It's expected that the deferred exception is managed in the caller method,
@@ -30,7 +29,7 @@
         oss_service = att_si.owner.leaf_model
 
         # See if there is a matching entry in the whitelist.
-        matching_entries = AttWorkflowDriverWhiteListEntry.objects.filter(
+        matching_entries = model_accessor.AttWorkflowDriverWhiteListEntry.objects.filter(
             owner_id=oss_service.id,
         )
         matching_entries = [e for e in matching_entries if e.serial_number.lower() == att_si.serial_number.lower()]
@@ -41,7 +40,7 @@
 
         whitelisted = matching_entries[0]
         try:
-            pon_port = ONUDevice.objects.get(serial_number=att_si.serial_number).pon_port
+            pon_port = model_accessor.ONUDevice.objects.get(serial_number=att_si.serial_number).pon_port
         except IndexError:
             raise DeferredException("ONU device %s is not know to XOS yet" % att_si.serial_number)
 
@@ -59,8 +58,8 @@
         return [True, "ONU has been validated"]
 
     @staticmethod
-    def get_onu_sn(log, event):
-        olt_service = VOLTService.objects.first()
+    def get_onu_sn(model_accessor, log, event):
+        olt_service = model_accessor.VOLTService.objects.first()
         onu_sn = olt_service.get_onu_sn_from_openflow(event["deviceId"], event["portNumber"])
         if not onu_sn or onu_sn is None:
             log.exception("Cannot find onu serial number for this event", kafka_event=event)
@@ -69,9 +68,9 @@
         return onu_sn
 
     @staticmethod
-    def get_si_by_sn(log, serial_number):
+    def get_si_by_sn(model_accessor, log, serial_number):
         try:
-            return AttWorkflowDriverServiceInstance.objects.get(serial_number=serial_number)
+            return model_accessor.AttWorkflowDriverServiceInstance.objects.get(serial_number=serial_number)
         except IndexError:
             log.exception("Cannot find att-workflow-driver service instance for this serial number", serial_number=serial_number)
             raise Exception("Cannot find att-workflow-driver service instance for this serial number %s", serial_number)
\ No newline at end of file
diff --git a/xos/synchronizer/model_policies/model_policy_att_workflow_driver_serviceinstance.py b/xos/synchronizer/model_policies/model_policy_att_workflow_driver_serviceinstance.py
index 67e25c4..8e591cb 100644
--- a/xos/synchronizer/model_policies/model_policy_att_workflow_driver_serviceinstance.py
+++ b/xos/synchronizer/model_policies/model_policy_att_workflow_driver_serviceinstance.py
@@ -15,8 +15,7 @@
 
 
 
-from synchronizers.new_base.modelaccessor import RCORDSubscriber, RCORDIpAddress, ONUDevice, model_accessor
-from synchronizers.new_base.policy import Policy
+from xossynchronizer.model_policies.policy import Policy
 
 import os
 import sys
@@ -57,7 +56,7 @@
         si.save_changed_fields()
 
     def process_onu_state(self, si):
-        [valid, message] = AttHelpers.validate_onu(self.logger, si)
+        [valid, message] = AttHelpers.validate_onu(self.model_accessor, self.logger, si)
         if si.onu_state == "AWAITING" or si.onu_state == "ENABLED":
             si.status_message = message
             if valid:
@@ -111,7 +110,7 @@
 
 
     def update_onu(self, serial_number, admin_state):
-        onu = [onu for onu in ONUDevice.objects.all() if onu.serial_number.lower() == serial_number.lower()][0]
+        onu = [onu for onu in self.model_accessor.ONUDevice.objects.all() if onu.serial_number.lower() == serial_number.lower()][0]
         if onu.admin_state == admin_state:
             self.logger.debug("MODEL_POLICY: ONUDevice [%s] already has admin_state to %s" % (serial_number, admin_state))
         else:
@@ -121,7 +120,7 @@
 
     def get_subscriber(self, serial_number):
         try:
-            return [s for s in RCORDSubscriber.objects.all() if s.onu_device.lower() == serial_number.lower()][0]
+            return [s for s in self.model_accessor.RCORDSubscriber.objects.all() if s.onu_device.lower() == serial_number.lower()][0]
         except IndexError:
             # If the subscriber doesn't exist we don't do anything
             self.logger.debug("MODEL_POLICY: subscriber does not exists for this SI, doing nothing", onu_device=serial_number)
@@ -131,7 +130,7 @@
         # TODO check if the subscriber has an IP and update it,
         # or create a new one
         try:
-            ip = RCORDIpAddress.objects.filter(
+            ip = self.model_accessor.RCORDIpAddress.objects.filter(
                 subscriber_id=subscriber.id,
                 ip=ip
             )[0]
@@ -139,7 +138,7 @@
             ip.save_changed_fields()
         except IndexError:
             self.logger.debug("MODEL_POLICY: Creating new RCORDIpAddress for subscriber", onu_device=subscriber.onu_device, subscriber_status=subscriber.status, ip=ip)
-            ip = RCORDIpAddress(
+            ip = self.model_accessor.RCORDIpAddress(
                 subscriber_id=subscriber.id,
                 ip=ip,
                 description="DHCP Assigned IP Address"
@@ -148,7 +147,7 @@
 
     def delete_subscriber_ip(self, subscriber, ip):
         try:
-            ip = RCORDIpAddress.objects.filter(
+            ip = self.model_accessor.RCORDIpAddress.objects.filter(
                 subscriber_id=subscriber.id,
                 ip=ip
             )[0]
diff --git a/xos/synchronizer/model_policies/model_policy_att_workflow_driver_whitelistentry.py b/xos/synchronizer/model_policies/model_policy_att_workflow_driver_whitelistentry.py
index 51f2ba4..f063cc4 100644
--- a/xos/synchronizer/model_policies/model_policy_att_workflow_driver_whitelistentry.py
+++ b/xos/synchronizer/model_policies/model_policy_att_workflow_driver_whitelistentry.py
@@ -14,8 +14,7 @@
 # limitations under the License.
 
 
-from synchronizers.new_base.modelaccessor import AttWorkflowDriverServiceInstance, AttWorkflowDriverWhiteListEntry, model_accessor
-from synchronizers.new_base.policy import Policy
+from xossynchronizer.model_policies.policy import Policy
 import os
 import sys
 
@@ -31,7 +30,7 @@
         self.handle_update(whitelist)
 
     def validate_onu_state(self, si):
-        [valid, message] = AttHelpers.validate_onu(self.logger, si)
+        [valid, message] = AttHelpers.validate_onu(self.model_accessor, self.logger, si)
         si.status_message = message
         if valid:
             si.onu_state = "ENABLED"
@@ -46,7 +45,7 @@
     def handle_update(self, whitelist):
         self.logger.debug("MODEL_POLICY: handle_update for AttWorkflowDriverWhiteListEntry", whitelist=whitelist)
 
-        sis = AttWorkflowDriverServiceInstance.objects.all()
+        sis = self.model_accessor.AttWorkflowDriverServiceInstance.objects.all()
 
         for si in sis:
 
@@ -66,7 +65,7 @@
 
         assert(whitelist.owner)
 
-        sis = AttWorkflowDriverServiceInstance.objects.all()
+        sis = self.model_accessor.AttWorkflowDriverServiceInstance.objects.all()
         sis = [si for si in sis if si.serial_number.lower() == whitelist.serial_number.lower()]
 
         for si in sis:
diff --git a/xos/synchronizer/model_policies/test_model_policy_att_workflow_driver_serviceinstance.py b/xos/synchronizer/model_policies/test_model_policy_att_workflow_driver_serviceinstance.py
index 1abc7c8..19bcaba 100644
--- a/xos/synchronizer/model_policies/test_model_policy_att_workflow_driver_serviceinstance.py
+++ b/xos/synchronizer/model_policies/test_model_policy_att_workflow_driver_serviceinstance.py
@@ -20,39 +20,31 @@
 import os, sys
 
 test_path=os.path.abspath(os.path.dirname(os.path.realpath(__file__)))
-service_dir=os.path.join(test_path, "../../../..")
-xos_dir=os.path.join(test_path, "../../..")
-if not os.path.exists(os.path.join(test_path, "new_base")):
-    xos_dir=os.path.join(test_path, "../../../../../../orchestration/xos/xos")
-    services_dir=os.path.join(xos_dir, "../../xos_services")
 
-def get_models_fn(service_name, xproto_name):
-    name = os.path.join(service_name, "xos", "synchronizer", "models", xproto_name)
-    if os.path.exists(os.path.join(services_dir, name)):
-        return name
-    raise Exception("Unable to find service=%s xproto=%s" % (service_name, xproto_name))
 
 class TestModelPolicyAttWorkflowDriverServiceInstance(unittest.TestCase):
     def setUp(self):
 
         self.sys_path_save = sys.path
-        sys.path.append(xos_dir)
-        sys.path.append(os.path.join(xos_dir, 'synchronizers', 'new_base'))
 
         config = os.path.join(test_path, "../test_config.yaml")
         from xosconfig import Config
         Config.clear()
         Config.init(config, 'synchronizer-config-schema.yaml')
 
-        from synchronizers.new_base.mock_modelaccessor_build import build_mock_modelaccessor
-        build_mock_modelaccessor(xos_dir, services_dir, [
-            get_models_fn("att-workflow-driver", "att-workflow-driver.xproto"),
-            get_models_fn("olt-service", "volt.xproto"),
-            get_models_fn("../profiles/rcord", "rcord.xproto")
-        ])
+        from xossynchronizer.mock_modelaccessor_build import mock_modelaccessor_config
+        mock_modelaccessor_config(test_path, [("att-workflow-driver", "att-workflow-driver.xproto"),
+                                              ("olt-service", "volt.xproto"),
+                                              ("../profiles/rcord", "rcord.xproto")])
 
-        import synchronizers.new_base.modelaccessor
-        from model_policy_att_workflow_driver_serviceinstance import AttWorkflowDriverServiceInstancePolicy, model_accessor
+        import xossynchronizer.modelaccessor
+        import mock_modelaccessor
+        reload(mock_modelaccessor) # in case nose2 loaded it in a previous test
+        reload(xossynchronizer.modelaccessor)      # in case nose2 loaded it in a previous test
+
+        from xossynchronizer.modelaccessor import model_accessor
+        from model_policy_att_workflow_driver_serviceinstance import AttWorkflowDriverServiceInstancePolicy, AttHelpers
+        self.AttHelpers = AttHelpers
 
         from mock_modelaccessor import MockObjectList
 
@@ -65,7 +57,7 @@
         model_accessor.reset_all_object_stores()
 
 
-        self.policy = AttWorkflowDriverServiceInstancePolicy()
+        self.policy = AttWorkflowDriverServiceInstancePolicy(model_accessor=model_accessor)
         self.si = AttWorkflowDriverServiceInstance()
         self.si.owner = AttWorkflowDriverService()
         self.si.serial_number = "BRCM1234"
@@ -92,8 +84,7 @@
 
 
     def test_enable_onu(self):
-        from helpers import AttHelpers
-        with patch.object(AttHelpers, "validate_onu") as validate_onu, \
+        with patch.object(self.AttHelpers, "validate_onu") as validate_onu, \
             patch.object(self.policy, "update_onu") as update_onu, \
             patch.object(self.si, "save") as save_si:
             validate_onu.return_value = [True, "valid onu"]
@@ -106,8 +97,7 @@
             self.assertIn("valid onu", self.si.status_message)
 
     def test_disable_onu(self):
-        from helpers import AttHelpers
-        with patch.object(AttHelpers, "validate_onu") as validate_onu, \
+        with patch.object(self.AttHelpers, "validate_onu") as validate_onu, \
                 patch.object(self.policy, "update_onu") as update_onu, \
                 patch.object(self.si, "save") as save_si:
             validate_onu.return_value = [False, "invalid onu"]
diff --git a/xos/synchronizer/model_policies/test_model_policy_att_workflow_driver_whitelistentry.py b/xos/synchronizer/model_policies/test_model_policy_att_workflow_driver_whitelistentry.py
index c6e8818..4db0815 100644
--- a/xos/synchronizer/model_policies/test_model_policy_att_workflow_driver_whitelistentry.py
+++ b/xos/synchronizer/model_policies/test_model_policy_att_workflow_driver_whitelistentry.py
@@ -20,38 +20,29 @@
 import os, sys
 
 test_path=os.path.abspath(os.path.dirname(os.path.realpath(__file__)))
-service_dir=os.path.join(test_path, "../../../..")
-xos_dir=os.path.join(test_path, "../../..")
-if not os.path.exists(os.path.join(test_path, "new_base")):
-    xos_dir=os.path.join(test_path, "../../../../../../orchestration/xos/xos")
-    services_dir=os.path.join(xos_dir, "../../xos_services")
-
-def get_models_fn(service_name, xproto_name):
-    name = os.path.join(service_name, "xos", "synchronizer", "models", xproto_name)
-    if os.path.exists(os.path.join(services_dir, name)):
-        return name
-    raise Exception("Unable to find service=%s xproto=%s" % (service_name, xproto_name))
 
 class TestModelPolicyAttWorkflowDriverWhiteListEntry(unittest.TestCase):
     def setUp(self):
         self.sys_path_save = sys.path
-        sys.path.append(xos_dir)
-        sys.path.append(os.path.join(xos_dir, 'synchronizers', 'new_base'))
 
         config = os.path.join(test_path, "../test_config.yaml")
         from xosconfig import Config
         Config.clear()
         Config.init(config, 'synchronizer-config-schema.yaml')
 
-        from synchronizers.new_base.mock_modelaccessor_build import build_mock_modelaccessor
-        build_mock_modelaccessor(xos_dir, services_dir, [
-            get_models_fn("att-workflow-driver", "att-workflow-driver.xproto"),
-            get_models_fn("olt-service", "volt.xproto"),
-            get_models_fn("../profiles/rcord", "rcord.xproto")
-        ])
+        from xossynchronizer.mock_modelaccessor_build import mock_modelaccessor_config
+        mock_modelaccessor_config(test_path, [("att-workflow-driver", "att-workflow-driver.xproto"),
+                                              ("olt-service", "volt.xproto"),
+                                              ("../profiles/rcord", "rcord.xproto")])
 
-        import synchronizers.new_base.modelaccessor
-        from model_policy_att_workflow_driver_whitelistentry import AttWorkflowDriverWhiteListEntryPolicy, model_accessor
+        import xossynchronizer.modelaccessor
+        import mock_modelaccessor
+        reload(mock_modelaccessor) # in case nose2 loaded it in a previous test
+        reload(xossynchronizer.modelaccessor)      # in case nose2 loaded it in a previous test
+
+        from xossynchronizer.modelaccessor import model_accessor
+        from model_policy_att_workflow_driver_whitelistentry import AttWorkflowDriverWhiteListEntryPolicy, AttHelpers
+        self.AttHelpers = AttHelpers
 
         from mock_modelaccessor import MockObjectList
         self.MockObjectList = MockObjectList
@@ -64,7 +55,7 @@
         # tags. Ideally, this wouldn't happen, but it does. So make sure we reset the world.
         model_accessor.reset_all_object_stores()
 
-        self.policy = AttWorkflowDriverWhiteListEntryPolicy()
+        self.policy = AttWorkflowDriverWhiteListEntryPolicy(model_accessor=model_accessor)
 
         self.service = AttWorkflowDriverService()
 
@@ -74,9 +65,8 @@
         self.service = None
 
     def test_enable_onu(self):
-        from helpers import AttHelpers
         si = AttWorkflowDriverServiceInstance(serial_number="BRCM333", owner_id=self.service.id, valid="invalid")
-        with patch.object(AttHelpers, "validate_onu") as validate_onu, \
+        with patch.object(self.AttHelpers, "validate_onu") as validate_onu, \
             patch.object(si, "save") as save_si:
             validate_onu.return_value = [True, "valid onu"]
 
@@ -88,9 +78,8 @@
             self.assertEqual("valid onu", si.status_message)
 
     def test_disable_onu(self):
-        from helpers import AttHelpers
         si = AttWorkflowDriverServiceInstance(serial_number="BRCM333", owner_id=self.service.id, valid="invalid")
-        with patch.object(AttHelpers, "validate_onu") as validate_onu, \
+        with patch.object(self.AttHelpers, "validate_onu") as validate_onu, \
             patch.object(si, "save") as save_si:
             validate_onu.return_value = [False, "invalid onu"]
 
diff --git a/xos/synchronizer/test_helpers.py b/xos/synchronizer/test_helpers.py
index c30cac3..98737d1 100644
--- a/xos/synchronizer/test_helpers.py
+++ b/xos/synchronizer/test_helpers.py
@@ -18,29 +18,14 @@
 
 import os, sys
 
-# Hack to load synchronizer framework
 test_path=os.path.abspath(os.path.dirname(os.path.realpath(__file__)))
-if not os.path.exists(os.path.join(test_path, "new_base")):
-    xos_dir=os.path.join(test_path, "../../../../../orchestration/xos/xos")
-    services_dir=os.path.join(xos_dir, "../../xos_services")
-# END Hack to load synchronizer framework
 
 
-# generate model from xproto
-def get_models_fn(service_name, xproto_name):
-    name = os.path.join(service_name, "xos", "synchronizer", "models", xproto_name)
-    if os.path.exists(os.path.join(services_dir, name)):
-        return name
-    raise Exception("Unable to find service=%s xproto=%s" % (service_name, xproto_name))
-# END generate model from xproto
-
 class TestAttHelpers(unittest.TestCase):
 
     def setUp(self):
 
         self.sys_path_save = sys.path
-        sys.path.append(xos_dir)
-        sys.path.append(os.path.join(xos_dir, 'synchronizers', 'new_base'))
 
         # Setting up the config module
         from xosconfig import Config
@@ -52,21 +37,25 @@
         from multistructlog import create_logger
         self.log = create_logger(Config().get('logging'))
 
-        from synchronizers.new_base.mock_modelaccessor_build import build_mock_modelaccessor
+        from xossynchronizer.mock_modelaccessor_build import mock_modelaccessor_config
+        mock_modelaccessor_config(test_path, [("att-workflow-driver", "att-workflow-driver.xproto"),
+                                              ("olt-service", "volt.xproto"),
+                                              ("../profiles/rcord", "rcord.xproto")])
 
-        build_mock_modelaccessor(xos_dir, services_dir, [
-            get_models_fn("att-workflow-driver", "att-workflow-driver.xproto"),
-            get_models_fn("olt-service", "volt.xproto"),
-            get_models_fn("../profiles/rcord", "rcord.xproto")
-        ])
-        import synchronizers.new_base.modelaccessor
-        from helpers import AttHelpers, model_accessor
+        import xossynchronizer.modelaccessor
+        import mock_modelaccessor
+        reload(mock_modelaccessor) # in case nose2 loaded it in a previous test
+        reload(xossynchronizer.modelaccessor)      # in case nose2 loaded it in a previous test
+
+        from xossynchronizer.modelaccessor import model_accessor
+        from helpers import AttHelpers
 
         # import all class names to globals
         for (k, v) in model_accessor.all_model_classes.items():
             globals()[k] = v
 
         self.helpers = AttHelpers
+        self.model_accessor = model_accessor
 
         self._volt = VOLTService()
         self._volt.id = 1
@@ -107,7 +96,7 @@
         with patch.object(AttWorkflowDriverWhiteListEntry.objects, "get_items") as whitelist_mock:
             whitelist_mock.return_value = []
 
-            [res, message] = self.helpers.validate_onu(self.log, self.att_si)
+            [res, message] = self.helpers.validate_onu(self.model_accessor, self.log, self.att_si)
 
             self.assertFalse(res)
             self.assertEqual(message, "ONU not found in whitelist")
@@ -119,7 +108,7 @@
             whitelist_mock.return_value = [self.whitelist_entry]
             onu_mock.return_value = [self.onu]
 
-            [res, message] = self.helpers.validate_onu(self.log, self.att_si)
+            [res, message] = self.helpers.validate_onu(self.model_accessor, self.log, self.att_si)
 
             self.assertFalse(res)
             self.assertEqual(message, "ONU activated in wrong location")
@@ -131,7 +120,7 @@
             whitelist_mock.return_value = [self.whitelist_entry]
             onu_mock.return_value = [self.onu]
 
-            [res, message] = self.helpers.validate_onu(self.log, self.att_si)
+            [res, message] = self.helpers.validate_onu(self.model_accessor, self.log, self.att_si)
 
             self.assertFalse(res)
             self.assertEqual(message, "ONU activated in wrong location")
@@ -143,7 +132,7 @@
             onu_mock.return_value = []
 
             with self.assertRaises(Exception) as e:
-                self.helpers.validate_onu(self.log, self.att_si)
+                self.helpers.validate_onu(self.model_accessor, self.log, self.att_si)
 
             self.assertEqual(e.exception.message, "ONU device %s is not know to XOS yet" % self.att_si.serial_number)
 
@@ -153,7 +142,7 @@
             whitelist_mock.return_value = [self.whitelist_entry]
             onu_mock.return_value = [self.onu]
 
-            [res, message] = self.helpers.validate_onu(self.log, self.att_si)
+            [res, message] = self.helpers.validate_onu(self.model_accessor, self.log, self.att_si)
 
             self.assertTrue(res)
             self.assertEqual(message, "ONU has been validated")
@@ -165,7 +154,7 @@
             whitelist_mock.return_value = [self.whitelist_entry]
             onu_mock.return_value = [self.onu]
 
-            [res, message] = self.helpers.validate_onu(self.log, self.att_si)
+            [res, message] = self.helpers.validate_onu(self.model_accessor, self.log, self.att_si)
 
             self.assertTrue(res)
             self.assertEqual(message, "ONU has been validated")
