diff --git a/BUCK b/BUCK
index 2c26e54..865cd75 100644
--- a/BUCK
+++ b/BUCK
@@ -2,7 +2,6 @@
     '//lib:CORE_DEPS',
     '//lib:org.apache.karaf.shell.console',
     '//lib:javax.ws.rs-api',
-    '//lib:cord-config',
     '//cli:onos-cli',
     '//core/store/serializers:onos-core-serializers',
     '//incubator/api:onos-incubator-api',
@@ -12,7 +11,6 @@
 BUNDLES = [
     '//apps/segmentrouting:onos-apps-segmentrouting',
     '//apps/routing-api:onos-apps-routing-api',
-    '//lib:cord-config'
 ]
 
 TEST_DEPS = [
diff --git a/app.xml b/app.xml
index 7af44fb..b7ee384 100644
--- a/app.xml
+++ b/app.xml
@@ -20,6 +20,4 @@
      features="${project.artifactId}" apps="">
     <description>${project.description}</description>
     <artifact>mvn:${project.groupId}/${project.artifactId}/${project.version}</artifact>
-    <!-- TODO: Replace this with variable -->
-    <artifact>mvn:org.onosproject/cord-config/1.0-b1</artifact>
 </app>
diff --git a/features.xml b/features.xml
index 6684345..416afe5 100644
--- a/features.xml
+++ b/features.xml
@@ -19,7 +19,5 @@
              description="${project.description}">
         <feature>onos-api</feature>
         <bundle>mvn:${project.groupId}/${project.artifactId}/${project.version}</bundle>
-        <!-- TODO: Replace this with variable -->
-        <bundle>mvn:org.onosproject/cord-config/1.0-b1</bundle>
     </feature>
 </features>
diff --git a/pom.xml b/pom.xml
index ddd72ce..521288e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -65,12 +65,6 @@
             <version>${project.version}</version>
         </dependency>
         <dependency>
-            <groupId>org.onosproject</groupId>
-            <artifactId>cord-config</artifactId>
-            <!-- TODO: Replace this with variable -->
-            <version>1.0-b1</version>
-        </dependency>
-        <dependency>
             <groupId>javax.ws.rs</groupId>
             <artifactId>javax.ws.rs-api</artifactId>
             <version>2.0.1</version>
diff --git a/src/main/java/org/onosproject/segmentrouting/CordConfigHandler.java b/src/main/java/org/onosproject/segmentrouting/CordConfigHandler.java
deleted file mode 100644
index 34f5d1e..0000000
--- a/src/main/java/org/onosproject/segmentrouting/CordConfigHandler.java
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- * 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.segmentrouting;
-
-import com.google.common.collect.ImmutableSet;
-import org.onlab.packet.Ip4Prefix;
-import org.onlab.packet.MacAddress;
-import org.onlab.packet.VlanId;
-import org.onosproject.net.ConnectPoint;
-import org.onosproject.net.DefaultHost;
-import org.onosproject.net.DeviceId;
-import org.onosproject.net.Host;
-import org.onosproject.net.HostId;
-import org.onosproject.net.HostLocation;
-import org.onosproject.net.provider.ProviderId;
-import org.opencord.cordconfig.CordConfigEvent;
-import org.opencord.cordconfig.access.AccessAgentData;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.Optional;
-
-/**
- * Handles access agent config event which is required for CORD integration.
- */
-public class CordConfigHandler {
-    private static Logger log = LoggerFactory.getLogger(CordConfigHandler.class);
-    private final SegmentRoutingManager srManager;
-
-    /**
-     * Constructs the CordConfigHandler.
-     *
-     * @param srManager Segment Routing manager
-     */
-    public CordConfigHandler(SegmentRoutingManager srManager) {
-        this.srManager = srManager;
-    }
-
-    /**
-     * Read initial access agent config for given device.
-     *
-     * @param deviceId ID of the device to be initialized
-     */
-    public void init(DeviceId deviceId) {
-        // Try to read access agent config
-        Optional<AccessAgentData> accessAgent =
-                srManager.cordConfigService.getAccessAgent(deviceId);
-
-        if (!accessAgent.isPresent()) {
-            log.debug("No access agent config on {}. Skip.", deviceId);
-            return;
-        }
-
-        processAccessAgentAdded(accessAgent.get());
-    }
-
-    // TODO javadoc
-    protected void processAccessAgentAddedEvent(CordConfigEvent event) {
-        log.debug("processAccessAgentAdded: {}, {}", event.subject(), event.prevSubject());
-        processAccessAgentAdded((AccessAgentData) event.subject());
-    }
-
-    protected void processAccessAgentUpdatedEvent(CordConfigEvent event) {
-        log.debug("processAccessAgentUpdated: {}, {}", event.subject(), event.prevSubject());
-        processAccessAgentRemoved((AccessAgentData) event.prevSubject());
-        processAccessAgentAdded((AccessAgentData) event.subject());
-    }
-
-    protected void processAccessAgentRemovedEvent(CordConfigEvent event) {
-        log.debug("processAccessAgentRemoved: {}, {}", event.subject(), event.prevSubject());
-        processAccessAgentRemoved((AccessAgentData) event.prevSubject());
-    }
-
-    protected void processAccessAgentAdded(AccessAgentData accessAgentData) {
-        if (!srManager.mastershipService.isLocalMaster(accessAgentData.deviceId())) {
-            log.debug("Not the master of {}. Abort.", accessAgentData.deviceId());
-            return;
-        }
-
-        // Do not proceed if vtn location is missing
-        if (!accessAgentData.getVtnLocation().isPresent()) {
-            log.warn("accessAgentData does not contain vtn location. Abort.");
-            return;
-        }
-
-        MacAddress agentMac = accessAgentData.getAgentMac();
-        ConnectPoint agentLocation = accessAgentData.getVtnLocation().get();
-
-        // Do not proceed if agent port doesn't have subnet configured
-        Ip4Prefix agentSubnet = srManager.deviceConfiguration
-                .getPortIPv4Subnet(agentLocation.deviceId(), agentLocation.port());
-        if (agentSubnet == null) {
-            log.warn("Agent port does not have subnet configuration. Abort.");
-            return;
-        }
-
-        // Add host information for agent
-        log.info("push host info for agent {}", agentMac);
-        srManager.hostHandler.processHostAdded(createHost(agentMac, agentLocation));
-
-        accessAgentData.getOltMacInfo().forEach((connectPoint, macAddress) -> {
-            // Do not proceed if olt port has subnet configured
-            Ip4Prefix oltSubnet = srManager.deviceConfiguration
-                    .getPortIPv4Subnet(connectPoint.deviceId(), connectPoint.port());
-            if (oltSubnet != null) {
-                log.warn("OLT port has subnet configuration. Abort.");
-                return;
-            }
-
-            // Add olt to the subnet of agent
-            log.info("push subnet for olt {}", agentSubnet);
-            srManager.deviceConfiguration.addSubnet(connectPoint, agentSubnet);
-            srManager.routingRulePopulator.populateVlanMacFilters(connectPoint.deviceId());
-
-            // Add host information for olt
-            log.info("push host info for olt {}", macAddress);
-            srManager.hostHandler.processHostAdded(createHost(macAddress, connectPoint));
-        });
-    }
-
-    protected void processAccessAgentRemoved(AccessAgentData accessAgentData) {
-        if (!srManager.mastershipService.isLocalMaster(accessAgentData.deviceId())) {
-            log.debug("Not the master of {}. Abort.", accessAgentData.deviceId());
-            return;
-        }
-
-        // Do not proceed if vtn location is missing
-        if (!accessAgentData.getVtnLocation().isPresent()) {
-            log.warn("accessAgentData does not contain vtn location. Abort.");
-            return;
-        }
-
-        MacAddress agentMac = accessAgentData.getAgentMac();
-        ConnectPoint agentLocation = accessAgentData.getVtnLocation().get();
-
-        // Do not proceed if olt port doesn't have subnet configured
-        Ip4Prefix agentSubnet = srManager.deviceConfiguration
-                .getPortIPv4Subnet(agentLocation.deviceId(), agentLocation.port());
-        if (agentSubnet == null) {
-            log.warn("Agent port does not have subnet configuration. Abort.");
-            return;
-        }
-
-        // Remove host information for agent
-        log.info("delete host info for agent {}", agentMac);
-        srManager.hostHandler.processHostRemoved(createHost(agentMac, agentLocation));
-
-        accessAgentData.getOltMacInfo().forEach((connectPoint, macAddress) -> {
-            // Do not proceed if agent port doesn't have subnet configured
-            Ip4Prefix oltSubnet = srManager.deviceConfiguration
-                    .getPortIPv4Subnet(connectPoint.deviceId(), connectPoint.port());
-            if (oltSubnet == null) {
-                log.warn("OLT port does not have subnet configuration. Abort.");
-                return;
-            }
-
-            // Remove host information for olt
-            log.info("delete host info for olt {}", macAddress);
-            srManager.hostHandler.processHostRemoved(createHost(macAddress, connectPoint));
-
-            // Remove olt to the subnet of agent
-            log.info("delete subnet for olt {}", agentSubnet);
-            srManager.deviceConfiguration.removeSubnet(connectPoint, agentSubnet);
-            srManager.routingRulePopulator.populateVlanMacFilters(connectPoint.deviceId());
-        });
-    }
-
-    private Host createHost(MacAddress macAddress, ConnectPoint location) {
-        return new DefaultHost(
-                new ProviderId("host", "org.onosproject.segmentrouting"),
-                HostId.hostId(macAddress),
-                macAddress,
-                VlanId.NONE,
-                new HostLocation(location, System.currentTimeMillis()),
-                ImmutableSet.of());
-    }
-}
diff --git a/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java b/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java
index 5b05187..c783081 100644
--- a/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java
+++ b/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java
@@ -94,9 +94,6 @@
 import org.onosproject.store.service.EventuallyConsistentMapBuilder;
 import org.onosproject.store.service.StorageService;
 import org.onosproject.store.service.WallClockTimestamp;
-import org.opencord.cordconfig.CordConfigEvent;
-import org.opencord.cordconfig.CordConfigListener;
-import org.opencord.cordconfig.CordConfigService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -164,9 +161,6 @@
     TopologyService topologyService;
 
     @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
-    CordConfigService cordConfigService;
-
-    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
     RouteService routeService;
 
     @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
@@ -192,7 +186,6 @@
     XConnectHandler xConnectHandler = null;
     private McastHandler mcastHandler = null;
     HostHandler hostHandler = null;
-    private CordConfigHandler cordConfigHandler = null;
     private RouteHandler routeHandler = null;
     private SegmentRoutingNeighbourDispatcher neighbourHandler = null;
     private L2TunnelHandler l2TunnelHandler = null;
@@ -200,7 +193,6 @@
     private final InternalHostListener hostListener = new InternalHostListener();
     private final InternalConfigListener cfgListener = new InternalConfigListener(this);
     private final InternalMcastListener mcastListener = new InternalMcastListener();
-    private final InternalCordConfigListener cordConfigListener = new InternalCordConfigListener();
     private final InternalRouteEventListener routeListener = new InternalRouteEventListener();
 
     private ScheduledExecutorService executorService = Executors
@@ -367,7 +359,6 @@
         xConnectHandler = new XConnectHandler(this);
         mcastHandler = new McastHandler(this);
         hostHandler = new HostHandler(this);
-        cordConfigHandler = new CordConfigHandler(this);
         routeHandler = new RouteHandler(this);
         neighbourHandler = new SegmentRoutingNeighbourDispatcher(this);
         l2TunnelHandler = new L2TunnelHandler(this);
@@ -383,7 +374,6 @@
         linkService.addListener(linkListener);
         deviceService.addListener(deviceListener);
         multicastRouteService.addListener(mcastListener);
-        cordConfigService.addListener(cordConfigListener);
 
         cfgListener.configureNetwork();
 
@@ -422,7 +412,6 @@
         linkService.removeListener(linkListener);
         deviceService.removeListener(deviceListener);
         multicastRouteService.removeListener(mcastListener);
-        cordConfigService.removeListener(cordConfigListener);
         routeService.removeListener(routeListener);
 
         neighbourResolutionService.unregisterNeighbourHandlers(appId);
@@ -995,7 +984,6 @@
             defaultRoutingHandler.populatePortAddressingRules(deviceId);
             hostHandler.init(deviceId);
             xConnectHandler.init(deviceId);
-            cordConfigHandler.init(deviceId);
             DefaultGroupHandler groupHandler = groupHandlerMap.get(deviceId);
             groupHandler.createGroupsFromVlanConfig();
             routingRulePopulator.populateSubnetBroadcastRule(deviceId);
@@ -1266,28 +1254,6 @@
         }
     }
 
-    private class InternalCordConfigListener implements CordConfigListener {
-        @Override
-        public void event(CordConfigEvent event) {
-            switch (event.type()) {
-                case ACCESS_AGENT_ADDED:
-                    cordConfigHandler.processAccessAgentAddedEvent(event);
-                    break;
-                case ACCESS_AGENT_UPDATED:
-                    cordConfigHandler.processAccessAgentUpdatedEvent(event);
-                    break;
-                case ACCESS_AGENT_REMOVED:
-                    cordConfigHandler.processAccessAgentRemovedEvent(event);
-                    break;
-                case ACCESS_DEVICE_ADDED:
-                case ACCESS_DEVICE_UPDATED:
-                case ACCESS_DEVICE_REMOVED:
-                default:
-                    break;
-            }
-        }
-    }
-
     private class InternalRouteEventListener implements RouteListener {
         @Override
         public void event(RouteEvent event) {
