diff --git a/xos/synchronizer/event_steps/onu_event.py b/xos/synchronizer/event_steps/onu_event.py
new file mode 100644
index 0000000..64197d2
--- /dev/null
+++ b/xos/synchronizer/event_steps/onu_event.py
@@ -0,0 +1,59 @@
+
+# Copyright 2017-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+import json
+import time
+import os
+import sys
+from synchronizers.new_base.eventstep import EventStep
+from synchronizers.new_base.modelaccessor import AttWorkflowDriverServiceInstance, model_accessor
+
+class ONUEventStep(EventStep):
+    topics = ["onu.events"]
+    technology = "kafka"
+
+    max_onu_retry = 50
+
+    def __init__(self, *args, **kwargs):
+        super(ONUEventStep, self).__init__(*args, **kwargs)
+
+    def handle_onu_activate_event(self, event):
+
+        # NOTE do we need to wait of the ONU to be there?
+
+        self.log.info("onu.events: validating ONU %s" % event["serial_number"], event_data=event)
+
+        try:
+            att_si = AttWorkflowDriverServiceInstance.objects.get(serial_number=event["serial_number"])
+            att_si.no_sync = False;
+            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(
+                serial_number=event["serial_number"],
+                of_dpid=event["of_dpid"]
+            )
+            self.log.debug("onu.events: Created new AttWorkflowDriverServiceInstance", si=att_si)
+        att_si.save()
+
+    def process_event(self, event):
+        value = json.loads(event.value)
+        self.log.info("onu.events: received event", value=value)
+
+        if value["status"] == "activated":
+            self.log.info("onu.events: activate onu", value=value)
+            self.handle_onu_activate_event(value)
+
diff --git a/xos/synchronizer/event_steps/test_dhcp_event.py b/xos/synchronizer/event_steps/test_dhcp_event.py
index 70258a9..a13b2b3 100644
--- a/xos/synchronizer/event_steps/test_dhcp_event.py
+++ b/xos/synchronizer/event_steps/test_dhcp_event.py
@@ -85,7 +85,7 @@
         self.subscriber.onu_device = "BRCM1234"
         self.subscriber.save = Mock()
 
-        self.mac_address = "aa:bb:cc:dd:ee"
+        self.mac_address = "00:AA:00:00:00:01"
         self.ip_address = "192.168.3.5"
 
 
diff --git a/xos/synchronizer/event_steps/test_onu_events.py b/xos/synchronizer/event_steps/test_onu_events.py
new file mode 100644
index 0000000..e4e227c
--- /dev/null
+++ b/xos/synchronizer/event_steps/test_onu_events.py
@@ -0,0 +1,105 @@
+# Copyright 2017-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import unittest
+from mock import patch, call, Mock, PropertyMock
+import json
+
+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
+        config = os.path.join(test_path, "../test_config.yaml")
+        Config.clear()
+        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")])
+
+        # 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 all class names to globals
+        for (k, v) in model_accessor.all_model_classes.items():
+            globals()[k] = v
+
+        self.log = Mock()
+
+        self.event_step = ONUEventStep(self.log)
+
+        self.event = Mock()
+        self.event_dict = {
+            'status': 'activated',
+            'serial_number': 'BRCM1234',
+            'of_dpid': 'of:109299321'
+        }
+        self.event.value = json.dumps(self.event_dict)
+
+    def tearDown(self):
+        sys.path = self.sys_path_save
+
+
+    def test_create_instance(self):
+
+        with patch.object(AttWorkflowDriverServiceInstance.objects, "get_items") as att_si_mock , \
+            patch.object(AttWorkflowDriverServiceInstance, "save", autospec=True) as mock_save:
+
+            att_si_mock.side_effect = IndexError
+
+            self.event_step.process_event(self.event)
+
+            att_si = mock_save.call_args[0][0]
+
+            self.assertEqual(mock_save.call_count, 1)
+
+            self.assertEqual(att_si.serial_number, self.event_dict['serial_number'])
+            self.assertEqual(att_si.of_dpid, self.event_dict['of_dpid'])
diff --git a/xos/synchronizer/models/convenience/attworkflowdriverservice.py b/xos/synchronizer/models/convenience/attworkflowdriverservice.py
deleted file mode 100644
index c692975..0000000
--- a/xos/synchronizer/models/convenience/attworkflowdriverservice.py
+++ /dev/null
@@ -1,49 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-# validate_onu received event:
-# {
-#     'status': 'activate',
-#     'serial_number': 'BRCM1234',
-#     'of_dpid': 'of:109299321'
-# }
-
-from xosapi.orm import register_convenience_wrapper
-from xosapi.convenience.serviceinstance import ORMWrapperServiceInstance
-
-import logging as log
-
-class ORMWrapperAttWorkflowService(ORMWrapperServiceInstance):
-
-    def validate_onu(self, event):
-
-        log.info("onu.events: validating ONU %s" % event["serial_number"], event=event)
-
-        try:
-            oss_si = self.stub.AttWorkflowDriverServiceInstance.objects.get(serial_number=event["serial_number"])
-            oss_si.no_sync = False;
-            log.debug("onu.events: Found existing AttWorkflowDriverServiceInstance", si=oss_si)
-        except IndexError:
-            # create an AttWorkflowDriverServiceInstance, the validation will be triggered in the corresponding sync step
-            oss_si = self.stub.AttWorkflowDriverServiceInstance(
-                serial_number=event["serial_number"],
-                of_dpid=event["of_dpid"]
-            )
-            log.debug("onu.events: Created new AttWorkflowDriverServiceInstance", si=oss_si)
-        
-        oss_si.save(always_update_timestamp=True)
-
-register_convenience_wrapper("AttWorkflowDriverService", ORMWrapperAttWorkflowService)
