diff --git a/README.md b/README.md
index 6082109..04229cd 100644
--- a/README.md
+++ b/README.md
@@ -47,4 +47,3 @@
 
 * [vtr](https://github.com/opencord/vtr/tree/master/xos/gui)
 * [rcord](https://github.com/opencord/rcord/tree/master/xos/gui)
-*
diff --git a/xos/synchronizer/models/attic/cordsubscriberroot_bottom.py b/xos/synchronizer/models/attic/cordsubscriberroot_bottom.py
deleted file mode 100644
index cd51962..0000000
--- a/xos/synchronizer/models/attic/cordsubscriberroot_bottom.py
+++ /dev/null
@@ -1,17 +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.
-
-
-CordSubscriberRoot.setup_simple_attributes()
diff --git a/xos/synchronizer/models/attic/cordsubscriberroot_model.py b/xos/synchronizer/models/attic/cordsubscriberroot_model.py
deleted file mode 100644
index ef174c4..0000000
--- a/xos/synchronizer/models/attic/cordsubscriberroot_model.py
+++ /dev/null
@@ -1,135 +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.
-
-
-# 'simple_attributes' will be expanded into properties and setters that
-# store the attribute using self.set_attribute / self.get_attribute.
-
-simple_attributes = ( ("devices", []), )
-
-sync_attributes = ("firewall_enable",
-                   "firewall_rules",
-                   "url_filter_enable",
-                   "url_filter_rules",
-                   "cdn_enable",
-                   "uplink_speed",
-                   "downlink_speed",
-                   "enable_uverse",
-                   "status")
-
-def __init__(self, *args, **kwargs):
-    # TODO: Should probably make an RCORDService, rather than filtering by name
-    rcord_services = Service.objects.filter(name="rcord")
-    if not rcord_services:
-        # this isn't going to end well...
-        raise Exception("There is no rcord service to use as the default service for CordSubscriberRoot")
-
-    self._meta.get_field("owner").default = rcord_services[0].id
-
-    super(CordSubscriberRoot, self).__init__(*args, **kwargs)
-
-def find_device(self, mac):
-    for device in self.devices:
-        if device["mac"] == mac:
-            return device
-    return None
-
-def update_device(self, mac, **kwargs):
-    # kwargs may be "level" or "mac"
-    #    Setting one of these to None will cause None to be stored in the db
-    devices = self.devices
-    for device in devices:
-        if device["mac"] == mac:
-            for arg in kwargs.keys():
-                device[arg] = kwargs[arg]
-            self.devices = devices
-            return device
-    raise ValueError("Device with mac %s not found" % mac)
-
-def create_device(self, **kwargs):
-    if "mac" not in kwargs:
-        raise XOSMissingField("The mac field is required")
-
-    if self.find_device(kwargs['mac']):
-            raise XOSDuplicateKey("Device with mac %s already exists" % kwargs["mac"])
-
-    device = kwargs.copy()
-
-    devices = self.devices
-    devices.append(device)
-    self.devices = devices
-
-    return device
-
-def delete_device(self, mac):
-    devices = self.devices
-    for device in devices:
-        if device["mac"]==mac:
-            devices.remove(device)
-            self.devices = devices
-            return
-
-    raise ValueError("Device with mac %s not found" % mac)
-
-#--------------------------------------------------------------------------
-# Deprecated -- devices used to be called users
-
-def find_user(self, uid):
-    return self.find_device(uid)
-
-def update_user(self, uid, **kwargs):
-    return self.update_device(uid, **kwargs)
-
-def create_user(self, **kwargs):
-    return self.create_device(**kwargs)
-
-def delete_user(self, uid):
-    return self.delete_user(uid)
-
-# ------------------------------------------------------------------------
-
-@property
-def services(self):
-    return {"cdn": self.cdn_enable,
-            "url_filter": self.url_filter_enable,
-            "firewall": self.firewall_enable}
-
-@services.setter
-def services(self, value):
-    pass
-
-def invalidate_related_objects(self):
-    # Dirty all vSGs related to this subscriber, so the vSG synchronizer
-    # will run.
-
-    # TODO: This should be reimplemented when multiple-objects-per-synchronizer is implemented.
-
-    for link in self.subscribed_links.all():
-        outer_service_instance = link.provider_service_instance
-        for link in outer_service_instance.subscribed_links.all():
-            inner_service_instance = link.provider_service_instance
-            inner_service_instance.save(update_fields = ["updated"])
-
-def __xos_save_base(self, *args, **kwargs):
-    self.validate_unique_service_specific_id(none_okay=True)
-    if (not hasattr(self, 'caller') or not self.caller.is_admin):
-        if (self.has_field_changed("service_specific_id")):
-            raise XOSPermissionDenied("You do not have permission to change service_specific_id")
-
-    super(CordSubscriberRoot, self).save(*args, **kwargs)
-
-    self.invalidate_related_objects()
-
-    return True     # Indicate that we called super.save()
diff --git a/xos/synchronizer/models/attic/header.py b/xos/synchronizer/models/attic/header.py
deleted file mode 100644
index a1cae74..0000000
--- a/xos/synchronizer/models/attic/header.py
+++ /dev/null
@@ -1,34 +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 django.db.models import *
-from core.models import Service, ServiceInstance, XOSBase, Slice, Instance, Node, Image, User, Flavor, NetworkParameter, NetworkParameterType, Port, AddressPool, User
-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 Q
-from operator import itemgetter, attrgetter, methodcaller
-import traceback
-from xos.exceptions import *
-from xosconfig import Config
-
-class ConfigurationError(Exception):
-    pass
-
-CORD_SUBSCRIBER_KIND = "CordSubscriberRoot"
-
diff --git a/xos/synchronizer/models/models.py b/xos/synchronizer/models/models.py
new file mode 100644
index 0000000..11b0ad9
--- /dev/null
+++ b/xos/synchronizer/models/models.py
@@ -0,0 +1,53 @@
+
+# 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 *
+from core.models import Service
+
+class CordSubscriberRoot(CordSubscriberRoot_decl):
+    class Meta:
+        proxy = True
+
+    def invalidate_related_objects(self):
+        # Dirty all vSGs related to this subscriber, so the vSG synchronizer
+        # will run.
+
+        # FIXME: This should be reimplemented when multiple-objects-per-synchronizer is implemented.
+
+        for link in self.subscribed_links.all():
+            outer_service_instance = link.provider_service_instance
+            # TODO: We may need to invalide the vOLT too...
+            for link in outer_service_instance.subscribed_links.all():
+                inner_service_instance = link.provider_service_instance
+                inner_service_instance.save(update_fields=["updated"])
+
+    def save(self, *args, **kwargs):
+        self.validate_unique_service_specific_id(none_okay=True)
+
+        # NOTE setting owner_id
+        try:
+            rcord_service = Service.objects.filter(name="rcord")[0]
+            self.owner_id = rcord_service.id
+        except IndexError:
+            raise XOSValidationError("Service RCORD cannot be found, please make sure that the model exists.")
+
+        if (not hasattr(self, 'caller') or not self.caller.is_admin):
+            if (self.has_field_changed("service_specific_id")):
+                raise XOSPermissionDenied("You do not have permission to change service_specific_id")
+
+        super(CordSubscriberRoot, self).save(*args, **kwargs)
+        self.invalidate_related_objects()
+        return
\ No newline at end of file
diff --git a/xos/synchronizer/models/rcord.xproto b/xos/synchronizer/models/rcord.xproto
index 6fe7072..e34ca81 100644
--- a/xos/synchronizer/models/rcord.xproto
+++ b/xos/synchronizer/models/rcord.xproto
@@ -1,6 +1,7 @@
 option name = "rcord";
 option app_label = "rcord";
 option verbose_name = "RCORD Subscriber";
+option legacy="True";
 
 message CordSubscriberRoot (ServiceInstance) {
     option kind = "CordSubscriberRoot";
