diff --git a/xos/core/xoslib/methods/cordsubscriber.py b/xos/core/xoslib/methods/cordsubscriber.py
index 0615024..f0bee26 100644
--- a/xos/core/xoslib/methods/cordsubscriber.py
+++ b/xos/core/xoslib/methods/cordsubscriber.py
@@ -47,6 +47,12 @@
         ssh_command = ReadOnlyField()
         bbs_account = ReadOnlyField()
 
+        wan_container_ip = ReadOnlyField()
+        uplink_speed = serializers.CharField(required=False)
+        downlink_speed = serializers.CharField(required=False)
+        status = serializers.CharField()
+        enable_uverse = serializers.BooleanField()
+
         lan_ip = ReadOnlyField()
         wan_ip = ReadOnlyField()
         nat_ip = ReadOnlyField()
@@ -68,7 +74,9 @@
                       'bbs_account',
                       'ssh_command',
                       'vcpe_synced',
-                      'cdn_enable', 'vbng_id', 'routeable_subnet', 'nat_ip', 'lan_ip', 'wan_ip', 'private_ip', 'wan_mac')
+                      'cdn_enable', 'vbng_id', 'routeable_subnet', 'nat_ip', 'lan_ip', 'wan_ip', 'private_ip', 'wan_mac',
+                      'wan_container_ip',
+                      'uplink_speed', 'downlink_speed', 'status', 'enable_uverse')
 
 
         def getHumanReadableName(self, obj):
diff --git a/xos/core/xoslib/objects/cordsubscriber.py b/xos/core/xoslib/objects/cordsubscriber.py
index d859cd2..27596b7 100644
--- a/xos/core/xoslib/objects/cordsubscriber.py
+++ b/xos/core/xoslib/objects/cordsubscriber.py
@@ -18,81 +18,6 @@
 c=CordSubscriber.get_tenant_objects().select_related().all()[0]
 """
 
-class CordSubscriberOld(VOLTTenant, PlusObjectMixin):
-    class Meta:
-        proxy = True
-
-    def __init__(self, *args, **kwargs):
-        super(CordSubscriber, self).__init__(*args, **kwargs)
-
-    def __unicode__(self):
-        return u"cordSubscriber-%s" % str(self.id)
-
-    passthroughs = ( ("firewall_enable", "vcpe.firewall_enable"),
-                     ("firewall_rules", "vcpe.firewall_rules"),
-                     ("url_filter_enable", "vcpe.url_filter_enable"),
-                     ("url_filter_rules", "vcpe.url_filter_rules"),
-                     ("url_filter_level", "vcpe.url_filter_level"),
-                     ("ssh_command", "vcpe.ssh_command"),
-                     ("bbs_account", "vcpe.bbs_account"),
-                     ("users", "vcpe.users"),
-                     ("services", "vcpe.services"),
-                     ("cdn_enable", "vcpe.cdn_enable"),
-                     ("image", "vcpe.image.id"),
-                     ("image_name", "vcpe.image.name"),
-                     ("instance", "vcpe.instance.id"),
-                     ("instance_name", "vcpe.instance.name"),
-                     ("routeable_subnet", "vcpe.vbng.routeable_subnet"),
-                     ("vcpe_id", "vcpe.id"),
-                     ("vbng_id", "vcpe.vbng.id"),
-                     ("nat_ip", "vcpe.nat_ip"),
-                     ("lan_ip", "vcpe.lan_ip"),
-                     ("private_ip", "vcpe.private_ip"),
-                     ("wan_ip", "vcpe.wan_ip"),
-                     ("wan_mac", "vcpe.wan_mac"),
-                     ("vcpe_synced", "vcpe.is_synced"),
-                     )
-
-    def __getattr__(self, key):
-        for (member_name, passthrough_name) in self.passthroughs:
-            if key==member_name:
-                parts = passthrough_name.split(".")
-                obj = self
-                for part in parts[:-1]:
-                    obj = getattr(obj, part)
-                    if not obj:
-                        return None
-                return getattr(obj, parts[-1])
-
-        raise AttributeError("getattr: %r object has no attribute %r" %
-                         (self.__class__, key))
-
-    def __setattr__(self, key, value):
-        for (member_name, passthrough_name) in self.passthroughs:
-            if key==member_name:
-                parts = passthrough_name.split(".")
-                obj = self
-                for part in parts[:-1]:
-                     obj = getattr(obj, part)
-                     if not obj:
-                         return
-                setattr(obj, parts[-1], value)
-
-        super(CordSubscriber, self).__setattr__(key, value)
-
-    def save(self, *args, **kwargs):
-        super(CordSubscriber, self).save(*args, **kwargs)
-
-        # in case the vcpe or vbng fields were altered
-        #   TODO: dirty detection?
-        if (self.vcpe):
-            print "save vcpe"
-            self.vcpe.save()
-            if (self.vcpe.vbng):
-                print "save vbng", self.vcpe.vbng
-                print "attr", self.vcpe.vbng.service_specific_attribute
-                self.vcpe.vbng.save()
-
 class CordSubscriber(CordSubscriberRoot):
     class Meta:
         proxy = True
@@ -112,6 +37,7 @@
                      # ("users", "vcpe.users"),
                      # ("services", "vcpe.services"),
                      # ("cdn_enable", "vcpe.cdn_enable"),
+                     # uplink_speed, downlink_speed, status, enable_uverse
 
                      ("vlan_id", "volt.vlan_id"),      # XXX remove this
                      ("c_tag", "volt.c_tag"),
@@ -132,6 +58,7 @@
                      ("wan_ip", "volt.vcpe.wan_ip"),
                      ("wan_mac", "volt.vcpe.wan_mac"),
                      ("vcpe_synced", "volt.vcpe.is_synced"),
+                     ("wan_container_ip", "volt.vcpe.wan_container_ip"),
                      )
 
     def __getattr__(self, key):
diff --git a/xos/services/cord/admin.py b/xos/services/cord/admin.py
index 76b505c..4ec4c6f 100644
--- a/xos/services/cord/admin.py
+++ b/xos/services/cord/admin.py
@@ -344,18 +344,34 @@
 
 class CordSubscriberRootForm(forms.ModelForm):
     url_filter_level = forms.CharField(required = False)
+    uplink_speed = forms.CharField(required = False)
+    downlink_speed = forms.CharField(required = False)
+    status = forms.ChoiceField(choices=CordSubscriberRoot.status_choices, required=True)
+    enable_uverse = forms.BooleanField(required=False)
 
     def __init__(self,*args,**kwargs):
         super (CordSubscriberRootForm,self ).__init__(*args,**kwargs)
         self.fields['kind'].widget.attrs['readonly'] = True
         if self.instance:
             self.fields['url_filter_level'].initial = self.instance.url_filter_level
+            self.fields['uplink_speed'].initial = self.instance.uplink_speed
+            self.fields['downlink_speed'].initial = self.instance.downlink_speed
+            self.fields['status'].initial = self.instance.status
+            self.fields['enable_uverse'].initial = self.instance.enable_uverse
         if (not self.instance) or (not self.instance.pk):
             # default fields for an 'add' form
             self.fields['kind'].initial = CORD_SUBSCRIBER_KIND
+            self.fields['uplink_speed'].initial = CordSubscriberRoot.get_default_attribute("uplink_speed")
+            self.fields['downlink_speed'].initial = CordSubscriberRoot.get_default_attribute("downlink_speed")
+            self.fields['status'].initial = CordSubscriberRoot.get_default_attribute("status")
+            self.fields['enable_uverse'].initial = CordSubscriberRoot.get_default_attribute("enable_uverse")
 
     def save(self, commit=True):
         self.instance.url_filter_level = self.cleaned_data.get("url_filter_level")
+        self.instance.uplink_speed = self.cleaned_data.get("uplink_speed")
+        self.instance.downlink_speed = self.cleaned_data.get("downlink_speed")
+        self.instance.status = self.cleaned_data.get("status")
+        self.instance.enable_uverse = self.cleaned_data.get("enable_uverse")
         return super(CordSubscriberRootForm, self).save(commit=commit)
 
     class Meta:
@@ -365,9 +381,9 @@
     list_display = ('backend_status_icon', 'id',  'name', )
     list_display_links = ('backend_status_icon', 'id', 'name', )
     fieldsets = [ (None, {'fields': ['backend_status_text', 'kind', 'name', 'service_specific_id', # 'service_specific_attribute',
-                                     'url_filter_level'],
+                                     'url_filter_level', "uplink_speed", "downlink_speed", "status", "enable_uverse"],
                           'classes':['suit-tab suit-tab-general']})]
-    readonly_fields = ('backend_status_text', 'service_specific_attribute', 'bbs_account')
+    readonly_fields = ('backend_status_text', 'service_specific_attribute',)
     form = CordSubscriberRootForm
     inlines = (VOLTTenantInline, TenantRootPrivilegeInline)
 
diff --git a/xos/services/cord/models.py b/xos/services/cord/models.py
index 37ee78e..cbbc143 100644
--- a/xos/services/cord/models.py
+++ b/xos/services/cord/models.py
@@ -32,14 +32,28 @@
 
     KIND = CORD_SUBSCRIBER_KIND
 
-    default_attributes = {"firewall_enable": False,
-                          "firewall_rules": "accept all anywhere anywhere",
-                          "url_filter_enable": False,
-                          "url_filter_rules": "allow all",
-                          "url_filter_level": "PG",
-                          "cdn_enable": False,
-                          "users": [],
-                          "is_demo_user": False }
+    status_choices = (("enabled", "Enabled"),
+                      ("suspended", "Suspended"),
+                      ("delinquent", "Delinquent"),
+                      ("copyrightviolation", "Copyright Violation"))
+
+    # 'simple_attributes' will be expanded into properties and setters that
+    # store the attribute using self.set_attribute / self.get_attribute.
+
+    simple_attributes = ( ("firewall_enable", False),
+                          ("firewall_rules", "accept all anywhere anywhere"),
+                          ("url_filter_enable", False),
+                          ("url_filter_rules", "allow all"),
+                          ("url_filter_level", "PG"),
+                          ("cdn_enable", False),
+                          ("users", []),
+                          ("is_demo_user", False),
+
+                          ("uplink_speed", "1000000000"),  # 1 gigabit, a reasonable default?
+                          ("downlink_speed", "1000000000"),
+                          ("enable_uverse", True) )
+
+    default_attributes = {"status": "enabled"}
 
     sync_attributes = ("firewall_enable",
                        "firewall_rules",
@@ -67,60 +81,14 @@
         return volt
 
     @property
-    def firewall_enable(self):
-        return self.get_attribute("firewall_enable", self.default_attributes["firewall_enable"])
+    def status(self):
+        return self.get_attribute("status", self.default_attributes["status"])
 
-    @firewall_enable.setter
-    def firewall_enable(self, value):
-        self.set_attribute("firewall_enable", value)
-
-    @property
-    def firewall_rules(self):
-        return self.get_attribute("firewall_rules", self.default_attributes["firewall_rules"])
-
-    @firewall_rules.setter
-    def firewall_rules(self, value):
-        self.set_attribute("firewall_rules", value)
-
-    @property
-    def url_filter_enable(self):
-        return self.get_attribute("url_filter_enable", self.default_attributes["url_filter_enable"])
-
-    @url_filter_enable.setter
-    def url_filter_enable(self, value):
-        self.set_attribute("url_filter_enable", value)
-
-    @property
-    def url_filter_level(self):
-        return self.get_attribute("url_filter_level", self.default_attributes["url_filter_level"])
-
-    @url_filter_level.setter
-    def url_filter_level(self, value):
-        self.set_attribute("url_filter_level", value)
-
-    @property
-    def url_filter_rules(self):
-        return self.get_attribute("url_filter_rules", self.default_attributes["url_filter_rules"])
-
-    @url_filter_rules.setter
-    def url_filter_rules(self, value):
-        self.set_attribute("url_filter_rules", value)
-
-    @property
-    def cdn_enable(self):
-        return self.get_attribute("cdn_enable", self.default_attributes["cdn_enable"])
-
-    @cdn_enable.setter
-    def cdn_enable(self, value):
-        self.set_attribute("cdn_enable", value)
-
-    @property
-    def users(self):
-        return self.get_attribute("users", self.default_attributes["users"])
-
-    @users.setter
-    def users(self, value):
-        self.set_attribute("users", value)
+    @status.setter
+    def status(self, value):
+        if not value in [x[0] for x in self.status_choices]:
+            raise Exception("invalid status %s" % value)
+        self.set_attribute("status", value)
 
     def find_user(self, uid):
         uid = int(uid)
@@ -195,13 +163,7 @@
             # 2) trigger vcpe observer to wake up
             self.volt.vcpe.save()
 
-    @property
-    def is_demo_user(self):
-        return self.get_attribute("is_demo_user", self.default_attributes["is_demo_user"])
-
-    @is_demo_user.setter
-    def is_demo_user(self, value):
-        self.set_attribute("is_demo_user", value)
+CordSubscriberRoot.setup_simple_attributes()
 
 # -------------------------------------------
 # VOLT
