diff --git a/python/adapters/brcm_openomci_onu/brcm_openomci_onu.py b/python/adapters/brcm_openomci_onu/brcm_openomci_onu.py
index 51f3f5a..ff70e50 100644
--- a/python/adapters/brcm_openomci_onu/brcm_openomci_onu.py
+++ b/python/adapters/brcm_openomci_onu/brcm_openomci_onu.py
@@ -21,6 +21,8 @@
 """
 
 from twisted.internet import reactor, task
+from twisted.internet.defer import inlineCallbacks
+
 from zope.interface import implementer
 
 from pyvoltha.adapters.interface import IAdapterInterface
@@ -210,12 +212,13 @@
     def send_proxied_message(self, proxy_address, msg):
         log.debug('send-proxied-message', proxy_address=proxy_address, msg=msg)
 
+    @inlineCallbacks
     def receive_proxied_message(self, proxy_address, msg):
         log.debug('receive-proxied-message', proxy_address=proxy_address,
                  device_id=proxy_address.device_id, msg=hexify(msg))
         # Device_id from the proxy_address is the olt device id. We need to
         # get the onu device id using the port number in the proxy_address
-        device = self.adapter_agent. \
+        device = self.core_proxy. \
             get_child_device_with_proxy_address(proxy_address)
         if device:
             handler = self.devices_handlers[device.id]
@@ -225,13 +228,14 @@
         log.info('packet-out', logical_device_id=logical_device_id,
                  egress_port_no=egress_port_no, msg_len=len(msg))
 
+    @inlineCallbacks
     def receive_inter_adapter_message(self, msg):
         log.debug('receive_inter_adapter_message', msg=msg)
         proxy_address = msg['proxy_address']
         assert proxy_address is not None
         # Device_id from the proxy_address is the olt device id. We need to
         # get the onu device id using the port number in the proxy_address
-        device = self.adapter_agent. \
+        device = self.core_proxy. \
             get_child_device_with_proxy_address(proxy_address)
         if device:
             handler = self.devices_handlers[device.id]
diff --git a/python/adapters/brcm_openomci_onu/brcm_openomci_onu_handler.py b/python/adapters/brcm_openomci_onu/brcm_openomci_onu_handler.py
index ce74795..cd7fc62 100644
--- a/python/adapters/brcm_openomci_onu/brcm_openomci_onu_handler.py
+++ b/python/adapters/brcm_openomci_onu/brcm_openomci_onu_handler.py
@@ -210,7 +210,6 @@
         self.proxy_address = device.proxy_address
         self.parent_id = device.parent_id
         self._pon_port_number = device.parent_port_no
-
         if self.enabled is not True:
             self.log.info('activating-new-onu')
             # populate what we know.  rest comes later after mib sync
@@ -259,6 +258,7 @@
             self.log.info('onu-already-activated')
 
     # Called once when the adapter needs to re-create device.  usually on vcore restart
+    @inlineCallbacks
     def reconcile(self, device):
         self.log.debug('function-entry', device=device)
 
@@ -266,10 +266,6 @@
         assert device.parent_id
         assert device.proxy_address.device_id
 
-        # register for proxied messages right away
-        self.proxy_address = device.proxy_address
-        self.adapter_agent.register_for_proxied_messages(device.proxy_address)
-
         if self.enabled is not True:
             self.log.info('reconciling-broadcom-onu-device')
 
@@ -278,7 +274,7 @@
             # need to restart state machines on vcore restart.  there is no indication to do it for us.
             self._onu_omci_device.start()
             device.reason = "restarting-openomci"
-            self.adapter_agent.update_device(device)
+            yield self.core_proxy.update_device(device)
 
             # TODO: this is probably a bit heavy handed
             # Force a reboot for now.  We need indications to reflow to reassign tconts and gems given vcore went away
@@ -311,19 +307,6 @@
         if self._pon is not None:
             self._pon.enabled = True
 
-    # TODO: move to UniPort
-    def update_logical_port(self, logical_device_id, port_id, state):
-        try:
-            self.log.info('updating-logical-port', logical_port_id=port_id,
-                          logical_device_id=logical_device_id, state=state)
-            logical_port = self.adapter_agent.get_logical_port(logical_device_id,
-                                                               port_id)
-            logical_port.ofp_port.state = state
-            self.adapter_agent.update_logical_port(logical_device_id,
-                                                   logical_port)
-        except Exception as e:
-            self.log.exception("exception-updating-port", e=e)
-
     def delete(self, device):
         self.log.info('delete-onu', device=device)
         if self.parent_adapter:
@@ -424,22 +407,24 @@
                 tp = ast.literal_eval(tp)
                 self.log.debug("tp-instance", tp=tp)
                 self._do_tech_profile_configuration(uni_id, tp)
-
+                
+                @inlineCallbacks
                 def success(_results):
                     self.log.info("tech-profile-config-done-successfully")
-                    device = self.adapter_agent.get_device(self.device_id)
+                    device = yield self.core_proxy.get_device(self.device_id)
                     device.reason = 'tech-profile-config-download-success'
-                    self.adapter_agent.update_device(device)
+                    yield self.core_proxy.update_device(device)
                     if tp_path in self._tp_service_specific_task[uni_id]:
                         del self._tp_service_specific_task[uni_id][tp_path]
                     self._tech_profile_download_done[uni_id][tp_path] = True
 
+                @inlineCallbacks
                 def failure(_reason):
                     self.log.warn('tech-profile-config-failure-retrying',
                                    _reason=_reason)
-                    device = self.adapter_agent.get_device(self.device_id)
+                    device = yield self.core_proxy.get_device(self.device_id)
                     device.reason = 'tech-profile-config-download-failure-retrying'
-                    self.adapter_agent.update_device(device)
+                    yield self.core_proxy.update_device(device)
                     if tp_path in self._tp_service_specific_task[uni_id]:
                         del self._tp_service_specific_task[uni_id][tp_path]
                     self._deferred = reactor.callLater(_STARTUP_RETRY_WAIT, self.load_and_configure_tech_profile,
@@ -720,15 +705,16 @@
             onu_device.reason = "stopping-openomci"
             onu_device.connect_status = ConnectStatus.UNREACHABLE
             onu_device.oper_status = OperStatus.DISCOVERED
-            self.adapter_agent.update_device(onu_device)
+            yield self.core_proxy.update_device(onu_device)
         else:
             self.log.debug('not-changing-openomci-statemachine')
 
     # Not currently called by olt or anything else
+    @inlineCallbacks
     def remove_interface(self, data):
         self.log.debug('function-entry', data=data)
 
-        onu_device = self.adapter_agent.get_device(self.device_id)
+        onu_device = yield self.core_proxy.get_device(self.device_id)
 
         self.log.debug('stopping-openomci-statemachine')
         reactor.callLater(0, self._onu_omci_device.stop)
@@ -741,22 +727,24 @@
 
         self.disable_ports(onu_device)
         onu_device.reason = "stopping-openomci"
-        self.adapter_agent.update_device(onu_device)
+        yield self.core_proxy.update_device(onu_device)
 
         # TODO: im sure there is more to do here
 
     # Not currently called.  Would be called presumably from the olt handler
+    @inlineCallbacks
     def remove_gemport(self, data):
         self.log.debug('remove-gemport', data=data)
-        device = self.adapter_agent.get_device(self.device_id)
+        device = yield self.core_proxy.get_device(self.device_id)
         if device.connect_status != ConnectStatus.REACHABLE:
             self.log.error('device-unreachable')
             return
 
     # Not currently called.  Would be called presumably from the olt handler
+    @inlineCallbacks
     def remove_tcont(self, tcont_data, traffic_descriptor_data):
         self.log.debug('remove-tcont', tcont_data=tcont_data, traffic_descriptor_data=traffic_descriptor_data)
-        device = self.adapter_agent.get_device(self.device_id)
+        device = yield self.core_proxy.get_device(self.device_id)
         if device.connect_status != ConnectStatus.REACHABLE:
             self.log.error('device-unreachable')
             return
@@ -769,6 +757,7 @@
 
         # TODO: create objects and populate for later omci calls
 
+    @inlineCallbacks
     def disable(self, device):
         self.log.debug('function-entry', device=device)
         try:
@@ -788,7 +777,7 @@
                 self.disable_ports(device)
                 device.oper_status = OperStatus.UNKNOWN
                 device.reason = "omci-admin-lock"
-                self.adapter_agent.update_device(device)
+                yield self.core_proxy.update_device(device)
 
             # lock all the unis
             task = BrcmUniLockTask(self.omci_agent, self.device_id, lock=True)
@@ -797,6 +786,7 @@
         except Exception as e:
             log.exception('exception-in-onu-disable', exception=e)
 
+    @inlineCallbacks
     def reenable(self, device):
         self.log.debug('function-entry', device=device)
         try:
@@ -805,26 +795,28 @@
             self.log.debug('restarting-openomci-statemachine')
             self._subscribe_to_events()
             device.reason = "restarting-openomci"
-            self.adapter_agent.update_device(device)
+            yield self.core_proxy.update_device(device)
             reactor.callLater(1, self._onu_omci_device.start)
             self._heartbeat.enabled = True
         except Exception as e:
             log.exception('exception-in-onu-reenable', exception=e)
 
+    @inlineCallbacks
     def reboot(self):
         self.log.info('reboot-device')
-        device = self.adapter_agent.get_device(self.device_id)
+        device = yield self.core_proxy.get_device(self.device_id)
         if device.connect_status != ConnectStatus.REACHABLE:
             self.log.error("device-unreachable")
             return
 
+        @inlineCallbacks
         def success(_results):
             self.log.info('reboot-success', _results=_results)
             self.disable_ports(device)
             device.connect_status = ConnectStatus.UNREACHABLE
             device.oper_status = OperStatus.DISCOVERED
             device.reason = "rebooting"
-            self.adapter_agent.update_device(device)
+            yield self.core_proxy.update_device(device)
 
         def failure(_reason):
             self.log.info('reboot-failure', _reason=_reason)
@@ -832,38 +824,40 @@
         self._deferred = self._onu_omci_device.reboot()
         self._deferred.addCallbacks(success, failure)
 
+    @inlineCallbacks
     def disable_ports(self, onu_device):
         self.log.info('disable-ports', device_id=self.device_id,
                       onu_device=onu_device)
 
         # Disable all ports on that device
-        self.adapter_agent.disable_all_ports(self.device_id)
+        yield self.core_proxy.disable_all_ports(self.device_id)
 
-        parent_device = self.adapter_agent.get_device(onu_device.parent_id)
+        parent_device = yield self.core_proxy.get_device(onu_device.parent_id)
         assert parent_device
         logical_device_id = parent_device.parent_id
         assert logical_device_id
-        ports = self.adapter_agent.get_ports(onu_device.id, Port.ETHERNET_UNI)
-        for port in ports:
-            port_id = 'uni-{}'.format(port.port_no)
-            # TODO: move to UniPort
-            self.update_logical_port(logical_device_id, port_id, OFPPS_LINK_DOWN)
+        ports = yield self.core_proxy.get_ports(onu_device.id, Port.ETHERNET_UNI)
+        #TODO this should all be handled by the core
+        #for port in ports:
+        #    port_id = 'uni-{}'.format(port.port_no)
+        #    self.update_logical_port(logical_device_id, port_id, OFPPS_LINK_DOWN)
 
+    @inlineCallbacks
     def enable_ports(self, onu_device):
         self.log.info('enable-ports', device_id=self.device_id, onu_device=onu_device)
 
         # Disable all ports on that device
-        self.adapter_agent.enable_all_ports(self.device_id)
+        self.core_proxy.enable_all_ports(self.device_id)
 
-        parent_device = self.adapter_agent.get_device(onu_device.parent_id)
+        parent_device = yield self.core_proxy.get_device(onu_device.parent_id)
         assert parent_device
         logical_device_id = parent_device.parent_id
         assert logical_device_id
-        ports = self.adapter_agent.get_ports(onu_device.id, Port.ETHERNET_UNI)
-        for port in ports:
-            port_id = 'uni-{}'.format(port.port_no)
-            # TODO: move to UniPort
-            self.update_logical_port(logical_device_id, port_id, OFPPS_LIVE)
+        ports = yield self.core_proxy.get_ports(onu_device.id, Port.ETHERNET_UNI)
+        #TODO this should be handled by the core
+        #for port in ports:
+        #    port_id = 'uni-{}'.format(port.port_no)
+        #    self.update_logical_port(logical_device_id, port_id, OFPPS_LIVE)
 
     # Called just before openomci state machine is started.  These listen for events from selected state machines,
     # most importantly, mib in sync.  Which ultimately leads to downloading the mib
diff --git a/python/adapters/brcm_openomci_onu/heartbeat.py b/python/adapters/brcm_openomci_onu/heartbeat.py
index 209876f..13f1d62 100644
--- a/python/adapters/brcm_openomci_onu/heartbeat.py
+++ b/python/adapters/brcm_openomci_onu/heartbeat.py
@@ -73,7 +73,7 @@
 
     @property
     def check_value(self):
-        # device = self._handler.adapter_agent.get_device(self._device_id)
+        # device = self._handler.core_proxy.get_device(self._device_id)
         # return device.serial_number
         return 'ADTN'
 
@@ -142,7 +142,7 @@
         """
         Check the number of heartbeat failures against the limit and emit an alarm if needed
         """
-        device = self._handler.adapter_agent.get_device(self._device_id)
+        device = self._handler.core_proxy.get_device(self._device_id)
 
         try:
             from pyvoltha.adapters.extensions.alarms.heartbeat_alarm import HeartbeatAlarm
@@ -153,7 +153,7 @@
                     device.connect_status = ConnectStatus.UNREACHABLE
                     device.oper_status = OperStatus.FAILED
                     device.reason = self.heartbeat_last_reason
-                    self._handler.adapter_agent.update_device(device)
+                    self._handler.core_proxy.update_device(device)
                     HeartbeatAlarm(self._handler.alarms, 'onu', self._heartbeat_miss).raise_alarm()
                     self._alarm_active = True
                     self.on_heartbeat_alarm(True)
@@ -163,7 +163,7 @@
                     device.connect_status = ConnectStatus.REACHABLE
                     device.oper_status = OperStatus.ACTIVE
                     device.reason = ''
-                    self._handler.adapter_agent.update_device(device)
+                    self._handler.core_proxy.update_device(device)
                     HeartbeatAlarm(self._handler.alarms, 'onu').clear_alarm()
 
                     self._alarm_active = False
