diff --git a/pom.xml b/pom.xml
index fae5f19..0ae7ec1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -30,11 +30,11 @@
     <artifactId>onos-cord-config</artifactId>
     <packaging>bundle</packaging>
 
-    <description>Cord configuration meta applications </description>
+    <description>CORD configuration meta application</description>
 
     <properties>
         <onos.app.name>org.onosproject.cord-config</onos.app.name>
-        <onos.app.title>Cord Configuratuon Meta Application</onos.app.title>
+        <onos.app.title>CORD Configuratuon Meta Application</onos.app.title>
         <onos.app.category>Utility</onos.app.category>
         <onos.app.url>http://opencord.org</onos.app.url>
     </properties>
diff --git a/src/main/java/org/onosproject/cordconfig/access/AccessDeviceConfig.java b/src/main/java/org/onosproject/cordconfig/access/AccessDeviceConfig.java
index 1e5e8cf..47f35da 100644
--- a/src/main/java/org/onosproject/cordconfig/access/AccessDeviceConfig.java
+++ b/src/main/java/org/onosproject/cordconfig/access/AccessDeviceConfig.java
@@ -38,8 +38,19 @@
      * Gets the access device configuration for this device.
      *
      * @return access device configuration
+     * @deprecated in Goldeneye release. Use {@link #getAccessDevice()} instead.
      */
+    @Deprecated
     public AccessDeviceData getOlt() {
+        return getAccessDevice();
+    }
+
+    /**
+     * Gets the access device configuration for this device.
+     *
+     * @return access device configuration
+     */
+    public AccessDeviceData getAccessDevice() {
         PortNumber uplink = PortNumber.portNumber(node.path(UPLINK).asText());
         VlanId vlan = VlanId.vlanId(Short.parseShort(node.path(VLAN).asText()));
         JsonNode defaultVlanNode = node.path(DEFAULT_VLAN);
diff --git a/src/main/java/org/onosproject/cordconfig/access/CordConfig.java b/src/main/java/org/onosproject/cordconfig/access/CordConfig.java
new file mode 100644
index 0000000..2bc47b4
--- /dev/null
+++ b/src/main/java/org/onosproject/cordconfig/access/CordConfig.java
@@ -0,0 +1,186 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * 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.
+ */
+
+package org.onosproject.cordconfig.access;
+
+import com.google.common.collect.ImmutableSet;
+import org.apache.felix.scr.annotations.Activate;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Deactivate;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.ReferenceCardinality;
+import org.apache.felix.scr.annotations.Service;
+import org.onosproject.net.DeviceId;
+import org.onosproject.net.config.ConfigFactory;
+import org.onosproject.net.config.NetworkConfigEvent;
+import org.onosproject.net.config.NetworkConfigListener;
+import org.onosproject.net.config.NetworkConfigRegistry;
+import org.onosproject.net.config.basics.SubjectFactories;
+
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+/**
+ * Manages the common CORD configuration.
+ */
+@Service
+@Component(immediate = true)
+public class CordConfig implements CordConfigService {
+
+    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
+    protected NetworkConfigRegistry networkConfig;
+
+    private Map<DeviceId, AccessDeviceData> accessDevices = new ConcurrentHashMap<>();
+    private Map<DeviceId, AccessAgentData> accessAgents = new ConcurrentHashMap<>();
+
+    private static final Class<AccessDeviceConfig> ACCESS_DEVICE_CONFIG_CLASS =
+            AccessDeviceConfig.class;
+    private static final String ACCESS_DEVICE_CONFIG_KEY = "accessDevice";
+
+    private ConfigFactory<DeviceId, AccessDeviceConfig> deviceConfigFactory =
+            new ConfigFactory<DeviceId, AccessDeviceConfig>(
+                    SubjectFactories.DEVICE_SUBJECT_FACTORY,
+                    ACCESS_DEVICE_CONFIG_CLASS, ACCESS_DEVICE_CONFIG_KEY) {
+                @Override
+                public AccessDeviceConfig createConfig() {
+                    return new AccessDeviceConfig();
+                }
+            };
+
+    private static final Class<AccessAgentConfig> ACCESS_AGENT_CONFIG_CLASS =
+            AccessAgentConfig.class;
+    private static final String ACCESS_AGENT_CONFIG_KEY = "accessAgent";
+
+    private ConfigFactory<DeviceId, AccessAgentConfig> agentConfigFactory =
+            new ConfigFactory<DeviceId, AccessAgentConfig>(
+                    SubjectFactories.DEVICE_SUBJECT_FACTORY,
+                    ACCESS_AGENT_CONFIG_CLASS, ACCESS_AGENT_CONFIG_KEY) {
+                @Override
+                public AccessAgentConfig createConfig() {
+                    return new AccessAgentConfig();
+                }
+            };
+
+    private InternalNetworkConfigListener configListener =
+            new InternalNetworkConfigListener();
+
+    @Activate
+    protected void activate() {
+        networkConfig.registerConfigFactory(deviceConfigFactory);
+        networkConfig.registerConfigFactory(agentConfigFactory);
+
+        networkConfig.addListener(configListener);
+
+        networkConfig.getSubjects(DeviceId.class, AccessDeviceConfig.class)
+                .forEach(this::addAccessDeviceConfig);
+
+        networkConfig.getSubjects(DeviceId.class, AccessAgentConfig.class)
+                .forEach(this::addAccessAgentConfig);
+    }
+
+    @Deactivate
+    protected void deactivate() {
+        networkConfig.unregisterConfigFactory(deviceConfigFactory);
+        networkConfig.unregisterConfigFactory(agentConfigFactory);
+    }
+
+    private void addAccessDeviceConfig(DeviceId subject) {
+        AccessDeviceConfig config =
+                networkConfig.getConfig(subject, ACCESS_DEVICE_CONFIG_CLASS);
+        if (config != null) {
+            addAccessDevice(config);
+        }
+    }
+
+    private void addAccessDevice(AccessDeviceConfig config) {
+        AccessDeviceData accessDevice = config.getAccessDevice();
+        accessDevices.put(accessDevice.deviceId(), accessDevice);
+    }
+
+    private void removeAccessDeviceConfig(DeviceId subject) {
+        accessDevices.remove(subject);
+    }
+
+    private void addAccessAgentConfig(DeviceId subject) {
+        AccessAgentConfig config =
+                networkConfig.getConfig(subject, ACCESS_AGENT_CONFIG_CLASS);
+        if (config != null) {
+            addAccessAgent(config);
+        }
+    }
+
+    private void addAccessAgent(AccessAgentConfig config) {
+        AccessAgentData accessAgent = config.getAgent();
+        accessAgents.put(accessAgent.deviceId(), accessAgent);
+    }
+
+    private void removeAccessAgentConfig(DeviceId subject) {
+        accessAgents.remove(subject);
+    }
+
+    @Override
+    public Set<AccessDeviceData> getAccessDevices() {
+        return ImmutableSet.copyOf(accessDevices.values());
+    }
+
+    @Override
+    public Optional<AccessDeviceData> getAccessDevice(DeviceId deviceId) {
+        checkNotNull(deviceId, "Device ID cannot be null");
+        return Optional.ofNullable(accessDevices.get(deviceId));
+    }
+
+    @Override
+    public Set<AccessAgentData> getAccessAgents() {
+        return ImmutableSet.copyOf(accessAgents.values());
+    }
+
+    @Override
+    public Optional<AccessAgentData> getAccessAgent(DeviceId deviceId) {
+        checkNotNull(deviceId, "Device ID cannot be null");
+        return Optional.ofNullable(accessAgents.get(deviceId));
+    }
+
+    private class InternalNetworkConfigListener implements NetworkConfigListener {
+        @Override
+        public void event(NetworkConfigEvent event) {
+            switch (event.type()) {
+            case CONFIG_ADDED:
+            case CONFIG_UPDATED:
+                if (event.configClass().equals(ACCESS_DEVICE_CONFIG_CLASS)) {
+                    addAccessDeviceConfig((DeviceId) event.subject());
+                } else if (event.configClass().equals(ACCESS_AGENT_CONFIG_CLASS)) {
+                    addAccessAgentConfig((DeviceId) event.subject());
+                }
+                break;
+            case CONFIG_REMOVED:
+                if (event.configClass().equals(ACCESS_DEVICE_CONFIG_CLASS)) {
+                    removeAccessDeviceConfig((DeviceId) event.subject());
+                } else if (event.configClass().equals(ACCESS_AGENT_CONFIG_CLASS)) {
+                    removeAccessAgentConfig((DeviceId) event.subject());
+                }
+                break;
+            case CONFIG_REGISTERED:
+            case CONFIG_UNREGISTERED:
+            default:
+                break;
+            }
+        }
+    }
+}
diff --git a/src/main/java/org/onosproject/cordconfig/access/CordConfigService.java b/src/main/java/org/onosproject/cordconfig/access/CordConfigService.java
new file mode 100644
index 0000000..fdab6c0
--- /dev/null
+++ b/src/main/java/org/onosproject/cordconfig/access/CordConfigService.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * 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.
+ */
+
+package org.onosproject.cordconfig.access;
+
+import org.onosproject.net.DeviceId;
+
+import java.util.Optional;
+import java.util.Set;
+
+/**
+ * Provides access to the common CORD configuration.
+ */
+public interface CordConfigService {
+
+    /**
+     * Retrieves the set of all access devices in the system.
+     *
+     * @return set of access devices
+     */
+    Set<AccessDeviceData> getAccessDevices();
+
+    /**
+     * Retrieves the access device with the given device ID.
+     *
+     * @param deviceId device ID
+     * @return access device
+     */
+    Optional<AccessDeviceData> getAccessDevice(DeviceId deviceId);
+
+    /**
+     * Retrieves the set of all access agents in the system.
+     *
+     * @return set of access agents
+     */
+    Set<AccessAgentData> getAccessAgents();
+
+    /**
+     * Retrieves the access agent for the given device ID.
+     *
+     * @param deviceId device ID
+     * @return access agent
+     */
+    Optional<AccessAgentData> getAccessAgent(DeviceId deviceId);
+}
