diff --git a/xos/attic/onosapp_model.py b/xos/attic/onosapp_model.py
deleted file mode 100644
index 3516f8f..0000000
--- a/xos/attic/onosapp_model.py
+++ /dev/null
@@ -1,22 +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.
-
-
-def __init__(self, *args, **kwargs):
-    onos_services = ONOSService.objects.all()
-    if onos_services:
-        self._meta.get_field("owner").default = onos_services[0].id
-    super(ONOSApp, self).__init__(*args, **kwargs)
-
diff --git a/xos/header.py b/xos/header.py
deleted file mode 100755
index d86dc29..0000000
--- a/xos/header.py
+++ /dev/null
@@ -1,29 +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.
-
-
-from django.db import models
-from core.models import Service, XOSBase, Slice, Instance, ServiceInstance, Node, Image, User, Flavor
-from core.models.xosbase import StrippedCharField
-import os
-from django.db import models, transaction
-from django.forms.models import model_to_dict
-from django.db.models import *
-from operator import itemgetter, attrgetter, methodcaller
-import traceback
-from xos.exceptions import *
-from core.models import SlicePrivilege, SitePrivilege
-from sets import Set
-
diff --git a/xos/onos-onboard.yaml b/xos/onos-onboard.yaml
index c6dd3ea..e4cbe20 100644
--- a/xos/onos-onboard.yaml
+++ b/xos/onos-onboard.yaml
@@ -29,8 +29,6 @@
           base_url: file:///opt/xos_services/onos-service/xos/
           # The following will concatenate with base_url automatically, if
           # base_url is non-null.
-          xproto: ./
-          tosca_resource: tosca/resources/onosservice.py, tosca/resources/onosapp.py
           private_key: file:///opt/xos/key_import/onos_rsa
           public_key: file:///opt/xos/key_import/onos_rsa.pub
 
diff --git a/xos/synchronizer/models/models.py b/xos/synchronizer/models/models.py
new file mode 100644
index 0000000..4e7c71a
--- /dev/null
+++ b/xos/synchronizer/models/models.py
@@ -0,0 +1,31 @@
+
+# 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.
+
+from xos.exceptions import *
+from models_decl import *
+
+class ONOSApp(ONOSApp_decl):
+    class Meta:
+        proxy = True
+
+    def __init__(self, *args, **kwargs):
+        onos_services = ONOSService.objects.all()
+        if onos_services:
+            self._meta.get_field("owner").default = onos_services[0].id
+        super(ONOSApp, self).__init__(*args, **kwargs)
+
+class ONOSService(ONOSService_decl):
+    class Meta:
+        proxy = True
diff --git a/xos/onos.xproto b/xos/synchronizer/models/onos.xproto
similarity index 97%
rename from xos/onos.xproto
rename to xos/synchronizer/models/onos.xproto
index 5c79b44..bc8a590 100644
--- a/xos/onos.xproto
+++ b/xos/synchronizer/models/onos.xproto
@@ -1,6 +1,7 @@
 option kind="onos";
 option app_label = "onos";
 option name="onos";
+option legacy="True";
 
 message ONOSApp (ServiceInstance){
     option verbose_name="ONOS Application";
diff --git a/xos/synchronizer/onos_config.yaml b/xos/synchronizer/onos_config.yaml
index 63b010b..aa84d2c 100644
--- a/xos/synchronizer/onos_config.yaml
+++ b/xos/synchronizer/onos_config.yaml
@@ -14,10 +14,11 @@
 # limitations under the License.
 
 
-name: onos-synchronizer
+name: onos
 accessor:
   username: xosadmin@opencord.org
   password: "@/opt/xos/services/onos/credentials/xosadmin@opencord.org"
 dependency_graph: "/opt/xos/synchronizers/onos/model-deps"
 steps_dir: "/opt/xos/synchronizers/onos/steps"
-sys_dir: "/opt/xos/synchronizers/onos/sys"
\ No newline at end of file
+sys_dir: "/opt/xos/synchronizers/onos/sys"
+models_dir: "/opt/xos/synchronizers/onos/models"
diff --git a/xos/tosca/resources/onosapp.py b/xos/tosca/resources/onosapp.py
deleted file mode 100644
index d1c587a..0000000
--- a/xos/tosca/resources/onosapp.py
+++ /dev/null
@@ -1,74 +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.
-
-
-from xosresource import XOSResource
-from core.models import User, ServiceInstanceAttribute, Service, ServiceInstanceLink
-from services.onos.models import ONOSApp, ONOSService
-
-class XOSONOSApp(XOSResource):
-    provides = ["tosca.nodes.ONOSApp", "tosca.nodes.ONOSvBNGApp", "tosca.nodes.ONOSvOLTApp", "tosca.nodes.ONOSVTNApp", "tosca.nodes.ONOSvRouterApp"]
-    xos_model = ONOSApp
-    copyin_props = ["service_specific_id", "dependencies", "install_dependencies"]
-
-    def get_xos_args(self, throw_exception=True):
-        args = super(XOSONOSApp, self).get_xos_args()
-
-        # provider_service is mandatory and must be the ONOS Service
-        provider_name = self.get_requirement("tosca.relationships.TenantOfService", throw_exception=throw_exception)
-        if provider_name:
-            args["owner"] = self.get_xos_object(ONOSService, throw_exception=throw_exception, name=provider_name)
-
-        return args
-
-    def set_tenant_attr(self, obj, prop_name, value):
-        value = self.try_intrinsic_function(value)
-        if value:
-            attrs = ServiceInstanceAttribute.objects.filter(service_instance=obj, name=prop_name)
-            if attrs:
-                attr = attrs[0]
-                if attr.value != value:
-                    self.info("updating attribute %s" % prop_name)
-                    attr.value = value
-                    attr.save()
-            else:
-                self.info("adding attribute %s" % prop_name)
-                ta = ServiceInstanceAttribute(service_instance=obj, name=prop_name, value=value)
-                ta.save()
-
-    def postprocess(self, obj):
-        props = self.nodetemplate.get_properties()
-        for (k,d) in props.items():
-            v = d.value
-            if k.startswith("config_"):
-                self.set_tenant_attr(obj, k, v)
-            elif k.startswith("rest_") and (k!="rest_hostname") and (k!="rest_port"):
-                self.set_tenant_attr(obj, k, v)
-            elif k.startswith("component_config"):
-                self.set_tenant_attr(obj, k, v)
-            elif k == "autogenerate":
-                self.set_tenant_attr(obj, k, v)
-
-        # subscriber_service is optional and can be any service
-        subscriber_name = self.get_requirement("tosca.relationships.UsedByService", throw_exception=False)
-        if subscriber_name:
-            sub_serv = self.get_xos_object(Service, throw_exception=True, name=subscriber_name)
-            existing_links = ServiceInstanceLink.objects.filter(provider_service_instance_id = obj.id, subscriber_service_id = sub_serv.id)
-            if not existing_links:
-                link = ServiceInstanceLink(provider_service_instance = obj, subscriber_service = sub_serv)
-                link.save()
-
-    def can_delete(self, obj):
-        return super(XOSONOSApp, self).can_delete(obj)
diff --git a/xos/tosca/resources/onosservice.py b/xos/tosca/resources/onosservice.py
deleted file mode 100644
index b274d5b..0000000
--- a/xos/tosca/resources/onosservice.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.
-
-
-from service import XOSService
-from core.models import ServiceAttribute
-from services.onos.models import ONOSService
-
-class XOSONOSService(XOSService):
-    provides = "tosca.nodes.ONOSService"
-    xos_model = ONOSService
-    copyin_props = ["view_url", "icon_url", "enabled", "published", "public_key", "versionNumber", "rest_hostname", "rest_port", "no_container", "node_key"]
-
-    def set_service_attr(self, obj, prop_name, value):
-        value = self.try_intrinsic_function(value)
-        if value:
-            attrs = ServiceAttribute.objects.filter(service=obj, name=prop_name)
-            if attrs:
-                attr = attrs[0]
-                if attr.value != value:
-                    self.info("updating attribute %s" % prop_name)
-                    attr.value = value
-                    attr.save()
-            else:
-                self.info("adding attribute %s" % prop_name)
-                ta = ServiceAttribute(service=obj, name=prop_name, value=value)
-                ta.save()
-
-    def postprocess(self, obj):
-        props = self.nodetemplate.get_properties()
-        for (k,d) in props.items():
-            v = d.value
-            if k.startswith("config_"):
-                self.set_service_attr(obj, k, v)
-            elif k.startswith("rest_")  and (k!="rest_hostname") and (k!="rest_port"):
-                self.set_service_attr(obj, k, v)
-
