diff --git a/conf/onos.properties b/conf/onos.properties
index 20d90c4..0235dc0 100644
--- a/conf/onos.properties
+++ b/conf/onos.properties
@@ -1,6 +1,6 @@
 floodlight.modules = net.floodlightcontroller.core.FloodlightProvider,\
 net.floodlightcontroller.threadpool.ThreadPool,\
-net.onrc.onos.core.topology.NetworkGraphPublisher, \
+net.onrc.onos.core.topology.TopologyPublisher, \
 net.onrc.onos.core.datagrid.HazelcastDatagrid,\
 net.onrc.onos.core.flowprogrammer.FlowProgrammer,\
 net.onrc.onos.core.intent.runtime.PathCalcRuntimeModule,\
diff --git a/src/main/java/net/onrc/onos/apps/forwarding/Forwarding.java b/src/main/java/net/onrc/onos/apps/forwarding/Forwarding.java
index e9a29c0..9dc840b 100644
--- a/src/main/java/net/onrc/onos/apps/forwarding/Forwarding.java
+++ b/src/main/java/net/onrc/onos/apps/forwarding/Forwarding.java
@@ -33,9 +33,9 @@
 import net.onrc.onos.core.packet.Ethernet;
 import net.onrc.onos.core.registry.IControllerRegistryService;
 import net.onrc.onos.core.topology.Device;
-import net.onrc.onos.core.topology.INetworkGraphService;
+import net.onrc.onos.core.topology.ITopologyService;
 import net.onrc.onos.core.topology.LinkEvent;
-import net.onrc.onos.core.topology.NetworkGraph;
+import net.onrc.onos.core.topology.Topology;
 import net.onrc.onos.core.topology.Port;
 import net.onrc.onos.core.topology.Switch;
 import net.onrc.onos.core.util.Dpid;
@@ -65,8 +65,8 @@
     private IPacketService packetService;
     private IControllerRegistryService controllerRegistryService;
 
-    private INetworkGraphService networkGraphService;
-    private NetworkGraph networkGraph;
+    private ITopologyService topologyService;
+    private Topology topology;
     private IPathCalcRuntimeService pathRuntime;
     private IntentMap intentMap;
 
@@ -154,7 +154,7 @@
         dependencies.add(IControllerRegistryService.class);
         dependencies.add(IOnosDeviceService.class);
         dependencies.add(IDatagridService.class);
-        dependencies.add(INetworkGraphService.class);
+        dependencies.add(ITopologyService.class);
         dependencies.add(IPathCalcRuntimeService.class);
         // We don't use the IProxyArpService directly, but reactive forwarding
         // requires it to be loaded and answering ARP requests
@@ -167,7 +167,7 @@
     public void init(FloodlightModuleContext context) {
         datagrid = context.getServiceImpl(IDatagridService.class);
         controllerRegistryService = context.getServiceImpl(IControllerRegistryService.class);
-        networkGraphService = context.getServiceImpl(INetworkGraphService.class);
+        topologyService = context.getServiceImpl(ITopologyService.class);
         pathRuntime = context.getServiceImpl(IPathCalcRuntimeService.class);
         packetService = context.getServiceImpl(IPacketService.class);
 
@@ -179,7 +179,7 @@
     public void startUp(FloodlightModuleContext context) {
         packetService.registerPacketListener(this);
 
-        networkGraph = networkGraphService.getNetworkGraph();
+        topology = topologyService.getTopology();
         intentMap = pathRuntime.getPathIntents();
         datagrid.addListener("onos.pathintent_state", this, Long.class, IntentStateList.class);
     }
@@ -217,7 +217,7 @@
                 HexString.toHexString(eth.getDestinationMACAddress());
 
         //FIXME getDeviceByMac() is a blocking call, so it may be better way to handle it to avoid the condition.
-        Device deviceObject = networkGraph.getDeviceByMac(MACAddress.valueOf(destinationMac));
+        Device deviceObject = topology.getDeviceByMac(MACAddress.valueOf(destinationMac));
 
         if (deviceObject == null) {
             log.debug("No device entry found for {}",
@@ -245,7 +245,7 @@
 
         @Override
         public void run() {
-            Device deviceObject = networkGraph.getDeviceByMac(MACAddress.valueOf(eth.getDestinationMACAddress()));
+            Device deviceObject = topology.getDeviceByMac(MACAddress.valueOf(eth.getDestinationMACAddress()));
             if (deviceObject == null) {
                 log.debug("wait {}ms and device was not found. Send broadcast packet and the thread finish.", SLEEP_TIME_FOR_DB_DEVICE_INSTALLED);
                 handleBroadcast(sw, inPort, eth);
diff --git a/src/main/java/net/onrc/onos/apps/proxyarp/ProxyArpManager.java b/src/main/java/net/onrc/onos/apps/proxyarp/ProxyArpManager.java
index a148f0a..90ec662 100644
--- a/src/main/java/net/onrc/onos/apps/proxyarp/ProxyArpManager.java
+++ b/src/main/java/net/onrc/onos/apps/proxyarp/ProxyArpManager.java
@@ -31,8 +31,8 @@
 import net.onrc.onos.core.packet.Ethernet;
 import net.onrc.onos.core.packet.IPv4;
 import net.onrc.onos.core.topology.Device;
-import net.onrc.onos.core.topology.INetworkGraphService;
-import net.onrc.onos.core.topology.NetworkGraph;
+import net.onrc.onos.core.topology.ITopologyService;
+import net.onrc.onos.core.topology.Topology;
 import net.onrc.onos.core.topology.Port;
 import net.onrc.onos.core.topology.Switch;
 import net.onrc.onos.core.util.SwitchPort;
@@ -65,8 +65,8 @@
     private IConfigInfoService configService;
     private IRestApiService restApi;
 
-    private INetworkGraphService networkGraphService;
-    private NetworkGraph networkGraph;
+    private ITopologyService topologyService;
+    private Topology topology;
     private IOnosDeviceService onosDeviceService;
     private IPacketService packetService;
 
@@ -246,7 +246,7 @@
         dependencies.add(IRestApiService.class);
         dependencies.add(IDatagridService.class);
         dependencies.add(IConfigInfoService.class);
-        dependencies.add(INetworkGraphService.class);
+        dependencies.add(ITopologyService.class);
         dependencies.add(IOnosDeviceService.class);
         dependencies.add(IPacketService.class);
         return dependencies;
@@ -257,7 +257,7 @@
         this.configService = context.getServiceImpl(IConfigInfoService.class);
         this.restApi = context.getServiceImpl(IRestApiService.class);
         this.datagrid = context.getServiceImpl(IDatagridService.class);
-        this.networkGraphService = context.getServiceImpl(INetworkGraphService.class);
+        this.topologyService = context.getServiceImpl(ITopologyService.class);
         this.onosDeviceService = context.getServiceImpl(IOnosDeviceService.class);
         this.packetService = context.getServiceImpl(IPacketService.class);
 
@@ -292,7 +292,7 @@
 
         restApi.addRestletRoutable(new ArpWebRoutable());
         packetService.registerPacketListener(this);
-        networkGraph = networkGraphService.getNetworkGraph();
+        topology = topologyService.getTopology();
 
         //
         // Event notification setup: channels and event handlers
@@ -353,9 +353,9 @@
                     // If the ARP request is expired and then delete the device
                     HostArpRequester requester = (HostArpRequester) request.requester;
                     ARP req = requester.getArpRequest();
-                    networkGraph.acquireReadLock();
-                    Device targetDev = networkGraph.getDeviceByMac(MACAddress.valueOf(req.getTargetHardwareAddress()));
-                    networkGraph.releaseReadLock();
+                    topology.acquireReadLock();
+                    Device targetDev = topology.getDeviceByMac(MACAddress.valueOf(req.getTargetHardwareAddress()));
+                    topology.releaseReadLock();
                     if (targetDev != null) {
                         onosDeviceService.deleteOnosDeviceByMac(MACAddress.valueOf(req.getTargetHardwareAddress()));
                         if (log.isDebugEnabled()) {
@@ -453,10 +453,10 @@
         arpRequests.put(target, new ArpRequest(
                 new HostArpRequester(arp, dpid, inPort), false));
 
-        networkGraph.acquireReadLock();
-        Device targetDevice = networkGraph.getDeviceByMac(
+        topology.acquireReadLock();
+        Device targetDevice = topology.getDeviceByMac(
                 MACAddress.valueOf(arp.getTargetHardwareAddress()));
-        networkGraph.releaseReadLock();
+        topology.releaseReadLock();
 
         if (targetDevice == null) {
             if (log.isTraceEnabled()) {
diff --git a/src/main/java/net/onrc/onos/core/datagrid/web/GetNGEventsResource.java b/src/main/java/net/onrc/onos/core/datagrid/web/GetNGEventsResource.java
index 3191762..00b7c68 100644
--- a/src/main/java/net/onrc/onos/core/datagrid/web/GetNGEventsResource.java
+++ b/src/main/java/net/onrc/onos/core/datagrid/web/GetNGEventsResource.java
@@ -23,7 +23,7 @@
                         get(IDatagridService.class.getCanonicalName());
 
 
-        log.debug("Get network graph events");
+        log.debug("Get topology events");
 
         IEventChannel<byte[], TopologyEvent> channel = datagridService.createChannel(TopologyManager.EVENT_CHANNEL_NAME,
                 byte[].class, TopologyEvent.class);
diff --git a/src/main/java/net/onrc/onos/core/devicemanager/OnosDeviceManager.java b/src/main/java/net/onrc/onos/core/devicemanager/OnosDeviceManager.java
index 3177f61..38a8746 100644
--- a/src/main/java/net/onrc/onos/core/devicemanager/OnosDeviceManager.java
+++ b/src/main/java/net/onrc/onos/core/devicemanager/OnosDeviceManager.java
@@ -32,8 +32,8 @@
 import net.onrc.onos.core.packet.Ethernet;
 import net.onrc.onos.core.packet.IPv4;
 import net.onrc.onos.core.packet.UDP;
-import net.onrc.onos.core.topology.INetworkGraphService;
-import net.onrc.onos.core.topology.NetworkGraph;
+import net.onrc.onos.core.topology.ITopologyService;
+import net.onrc.onos.core.topology.Topology;
 
 import org.openflow.protocol.OFMessage;
 import org.openflow.protocol.OFPacketIn;
@@ -59,8 +59,8 @@
     private IEventChannel<Long, OnosDevice> eventChannel;
     private static final String DEVICE_CHANNEL_NAME = "onos.device";
     private Map<Long, OnosDevice> mapDevice = new ConcurrentHashMap<Long, OnosDevice>();
-    private INetworkGraphService networkGraphService;
-    private NetworkGraph networkGraph;
+    private ITopologyService topologyService;
+    private Topology topology;
 
     public enum OnosDeviceUpdateType {
         ADD, DELETE, UPDATE;
@@ -166,7 +166,7 @@
         }
 
         //If the switch port we try to attach a new device already has a link, then stop adding device
-        if (networkGraph.getOutgoingLink(dpid, (long) portId) != null) {
+        if (topology.getOutgoingLink(dpid, (long) portId) != null) {
             if (log.isTraceEnabled()) {
                 log.trace("Stop adding OnosDevice {} due to there is a link to: dpid {} port {}",
                         srcDevice.getMacAddress(), dpid, portId);
@@ -292,7 +292,7 @@
         List<Class<? extends IFloodlightService>> dependencies =
                 new ArrayList<Class<? extends IFloodlightService>>();
         dependencies.add(IFloodlightProviderService.class);
-        dependencies.add(INetworkGraphService.class);
+        dependencies.add(ITopologyService.class);
         dependencies.add(IDatagridService.class);
         return dependencies;
     }
@@ -303,8 +303,8 @@
         floodlightProvider = context.getServiceImpl(IFloodlightProviderService.class);
         deviceListeners = new CopyOnWriteArrayList<IOnosDeviceListener>();
         datagrid = context.getServiceImpl(IDatagridService.class);
-        networkGraphService = context.getServiceImpl(INetworkGraphService.class);
-        networkGraph = networkGraphService.getNetworkGraph();
+        topologyService = context.getServiceImpl(ITopologyService.class);
+        topology = topologyService.getTopology();
 
         setOnosDeviceManagerProperty(context);
     }
diff --git a/src/main/java/net/onrc/onos/core/intent/PathIntent.java b/src/main/java/net/onrc/onos/core/intent/PathIntent.java
index 2e1f6a6..cc00979 100644
--- a/src/main/java/net/onrc/onos/core/intent/PathIntent.java
+++ b/src/main/java/net/onrc/onos/core/intent/PathIntent.java
@@ -25,7 +25,6 @@
     }
 
     /**
-     * @param graph
      * @param path
      * @param bandwidth    bandwidth which should be allocated for the path.
      *                     If 0, no intent for bandwidth allocation (best effort).
diff --git a/src/main/java/net/onrc/onos/core/intent/runtime/PathCalcRuntime.java b/src/main/java/net/onrc/onos/core/intent/runtime/PathCalcRuntime.java
index 4939f90..c900698 100644
--- a/src/main/java/net/onrc/onos/core/intent/runtime/PathCalcRuntime.java
+++ b/src/main/java/net/onrc/onos/core/intent/runtime/PathCalcRuntime.java
@@ -17,8 +17,8 @@
 import net.onrc.onos.core.intent.PathIntent;
 import net.onrc.onos.core.intent.PathIntentMap;
 import net.onrc.onos.core.intent.ShortestPathIntent;
-import net.onrc.onos.core.topology.NetworkGraph;
 import net.onrc.onos.core.topology.Switch;
+import net.onrc.onos.core.topology.Topology;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -27,11 +27,11 @@
  * @author Toshio Koide (t-koide@onlab.us)
  */
 public class PathCalcRuntime implements IFloodlightService {
-    private NetworkGraph graph;
+    private Topology topology;
     private static final Logger log = LoggerFactory.getLogger(PathCalcRuntime.class);
 
-    public PathCalcRuntime(NetworkGraph g) {
-        this.graph = g;
+    public PathCalcRuntime(Topology topology) {
+        this.topology = topology;
     }
 
     /**
@@ -45,9 +45,9 @@
         IntentOperationList pathIntentOpList = new IntentOperationList();
         HashMap<Switch, ConstrainedBFSTree> spfTrees = new HashMap<>();
 
-        // TODO optimize locking of NetworkGraph
-        graph.acquireReadLock();
-        log.debug("NetworkGraph: {}", graph.getLinks());
+        // TODO optimize locking of Topology
+        topology.acquireReadLock();
+        log.debug("Topology: {}", topology.getLinks());
 
         for (IntentOperation intentOp : intentOpList) {
             switch (intentOp.operator) {
@@ -62,13 +62,13 @@
                     }
 
                     ShortestPathIntent spIntent = (ShortestPathIntent) intentOp.intent;
-                    Switch srcSwitch = graph.getSwitch(spIntent.getSrcSwitchDpid());
-                    Switch dstSwitch = graph.getSwitch(spIntent.getDstSwitchDpid());
+                    Switch srcSwitch = topology.getSwitch(spIntent.getSrcSwitchDpid());
+                    Switch dstSwitch = topology.getSwitch(spIntent.getDstSwitchDpid());
                     if (srcSwitch == null || dstSwitch == null) {
-                        log.error("Switch not found. src:{}, dst:{}, NetworkGraph:{}",
+                        log.error("Switch not found. src:{}, dst:{}, Topology:{}",
                                 spIntent.getSrcSwitchDpid(),
                                 spIntent.getDstSwitchDpid(),
-                                graph.getLinks());
+                                topology.getLinks());
                         pathIntentOpList.add(Operator.ERROR, new ErrorIntent(
                                 ErrorType.SWITCH_NOT_FOUND,
                                 "Switch not found.",
@@ -90,7 +90,7 @@
                     }
                     Path path = tree.getPath(dstSwitch);
                     if (path == null) {
-                        log.error("Path not found. Intent: {}, NetworkGraph:{}", spIntent.toString(), graph.getLinks());
+                        log.error("Path not found. Intent: {}, Topology: {}", spIntent.toString(), topology.getLinks());
                         pathIntentOpList.add(Operator.ERROR, new ErrorIntent(
                                 ErrorType.PATH_NOT_FOUND,
                                 "Path not found.",
@@ -137,8 +137,8 @@
                     break;
             }
         }
-        // TODO optimize locking of NetworkGraph
-        graph.releaseReadLock();
+        // TODO optimize locking of Topology
+        topology.releaseReadLock();
 
         return pathIntentOpList;
     }
diff --git a/src/main/java/net/onrc/onos/core/intent/runtime/PathCalcRuntimeModule.java b/src/main/java/net/onrc/onos/core/intent/runtime/PathCalcRuntimeModule.java
index 1e6ae00..76fa263 100644
--- a/src/main/java/net/onrc/onos/core/intent/runtime/PathCalcRuntimeModule.java
+++ b/src/main/java/net/onrc/onos/core/intent/runtime/PathCalcRuntimeModule.java
@@ -15,7 +15,6 @@
 import net.floodlightcontroller.core.module.IFloodlightModule;
 import net.floodlightcontroller.core.module.IFloodlightService;
 import net.floodlightcontroller.restserver.IRestApiService;
-
 import net.onrc.onos.core.datagrid.IDatagridService;
 import net.onrc.onos.core.datagrid.IEventChannel;
 import net.onrc.onos.core.datagrid.IEventChannelListener;
@@ -31,8 +30,8 @@
 import net.onrc.onos.core.intent.runtime.web.IntentWebRoutable;
 import net.onrc.onos.core.registry.IControllerRegistryService;
 import net.onrc.onos.core.topology.DeviceEvent;
-import net.onrc.onos.core.topology.INetworkGraphListener;
-import net.onrc.onos.core.topology.INetworkGraphService;
+import net.onrc.onos.core.topology.ITopologyListener;
+import net.onrc.onos.core.topology.ITopologyService;
 import net.onrc.onos.core.topology.LinkEvent;
 import net.onrc.onos.core.topology.PortEvent;
 import net.onrc.onos.core.topology.SwitchEvent;
@@ -43,7 +42,7 @@
 /**
  * @author Toshio Koide (t-koide@onlab.us)
  */
-public class PathCalcRuntimeModule implements IFloodlightModule, IPathCalcRuntimeService, INetworkGraphListener, IEventChannelListener<Long, IntentStateList> {
+public class PathCalcRuntimeModule implements IFloodlightModule, IPathCalcRuntimeService, ITopologyListener, IEventChannelListener<Long, IntentStateList> {
     static class PerfLog {
         private String step;
         private long time;
@@ -80,7 +79,7 @@
 
     private PathCalcRuntime runtime;
     private IDatagridService datagridService;
-    private INetworkGraphService networkGraphService;
+    private ITopologyService topologyService;
     private IntentMap highLevelIntents;
     private PathIntentMap pathIntents;
     private IControllerRegistryService controllerRegistry;
@@ -140,15 +139,15 @@
     public Collection<Class<? extends IFloodlightService>> getModuleDependencies() {
         Collection<Class<? extends IFloodlightService>> l = new ArrayList<>(2);
         l.add(IDatagridService.class);
-        l.add(INetworkGraphService.class);
         l.add(IRestApiService.class);
+        l.add(ITopologyService.class);
         return l;
     }
 
     @Override
     public void init(FloodlightModuleContext context) throws FloodlightModuleException {
         datagridService = context.getServiceImpl(IDatagridService.class);
-        networkGraphService = context.getServiceImpl(INetworkGraphService.class);
+        topologyService = context.getServiceImpl(ITopologyService.class);
         controllerRegistry = context.getServiceImpl(IControllerRegistryService.class);
         restApi = context.getServiceImpl(IRestApiService.class);
     }
@@ -156,11 +155,11 @@
     @Override
     public void startUp(FloodlightModuleContext context) {
         highLevelIntents = new IntentMap();
-        runtime = new PathCalcRuntime(networkGraphService.getNetworkGraph());
+        runtime = new PathCalcRuntime(topologyService.getTopology());
         pathIntents = new PathIntentMap();
         opEventChannel = datagridService.createChannel(INTENT_OP_EVENT_CHANNEL_NAME, Long.class, IntentOperationList.class);
         datagridService.addListener(INTENT_STATE_EVENT_CHANNEL_NAME, this, Long.class, IntentStateList.class);
-        networkGraphService.registerNetworkGraphListener(this);
+        topologyService.registerTopologyListener(this);
         persistIntent = new PersistIntent(controllerRegistry);
         restApi.addRestletRoutable(new IntentWebRoutable());
     }
@@ -287,12 +286,12 @@
     }
 
     // ================================================================================
-    // INetworkGraphListener implementations
+    // ITopologyListener implementations
     // ================================================================================
 
     // CHECKSTYLE:OFF suppress warning about too many parameters
     @Override
-    public void networkGraphEvents(Collection<SwitchEvent> addedSwitchEvents,
+    public void topologyEvents(Collection<SwitchEvent> addedSwitchEvents,
                                    Collection<SwitchEvent> removedSwitchEvents,
                                    Collection<PortEvent> addedPortEvents,
                                    Collection<PortEvent> removedPortEvents,
diff --git a/src/main/java/net/onrc/onos/core/intent/runtime/PlanCalcRuntime.java b/src/main/java/net/onrc/onos/core/intent/runtime/PlanCalcRuntime.java
index 436edaf..087bff8 100644
--- a/src/main/java/net/onrc/onos/core/intent/runtime/PlanCalcRuntime.java
+++ b/src/main/java/net/onrc/onos/core/intent/runtime/PlanCalcRuntime.java
@@ -19,7 +19,7 @@
 import net.onrc.onos.core.intent.PathIntent;
 import net.onrc.onos.core.intent.ShortestPathIntent;
 import net.onrc.onos.core.topology.LinkEvent;
-//import net.onrc.onos.core.topology.NetworkGraph;
+//import net.onrc.onos.core.topology.Topology;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -30,10 +30,10 @@
 
 public class PlanCalcRuntime {
 
-    //    NetworkGraph graph;
+    //    Topology graph;
     private static final Logger log = LoggerFactory.getLogger(PlanCalcRuntime.class);
 
-    public PlanCalcRuntime(/*NetworkGraph graph*/) {
+    public PlanCalcRuntime(/*Topology graph*/) {
 //      this.graph = graph;
     }
 
diff --git a/src/main/java/net/onrc/onos/core/intent/runtime/PlanInstallModule.java b/src/main/java/net/onrc/onos/core/intent/runtime/PlanInstallModule.java
index 6afe6b0..15230ec 100644
--- a/src/main/java/net/onrc/onos/core/intent/runtime/PlanInstallModule.java
+++ b/src/main/java/net/onrc/onos/core/intent/runtime/PlanInstallModule.java
@@ -21,15 +21,15 @@
 import net.onrc.onos.core.intent.Intent.IntentState;
 import net.onrc.onos.core.intent.IntentOperation;
 import net.onrc.onos.core.intent.IntentOperationList;
-import net.onrc.onos.core.topology.INetworkGraphService;
-//import net.onrc.onos.core.topology.NetworkGraph;
+import net.onrc.onos.core.topology.ITopologyService;
+//import net.onrc.onos.core.topology.Topology;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class PlanInstallModule implements IFloodlightModule {
     protected volatile IFloodlightProviderService floodlightProvider;
-    protected volatile INetworkGraphService networkGraph;
+    protected volatile ITopologyService topologyService;
     protected volatile IDatagridService datagridService;
     protected volatile IFlowPusherService flowPusher;
     private PlanCalcRuntime planCalc;
@@ -47,10 +47,9 @@
     public void init(FloodlightModuleContext context)
             throws FloodlightModuleException {
         floodlightProvider = context.getServiceImpl(IFloodlightProviderService.class);
-        networkGraph = context.getServiceImpl(INetworkGraphService.class);
+        topologyService = context.getServiceImpl(ITopologyService.class);
         datagridService = context.getServiceImpl(IDatagridService.class);
         flowPusher = context.getServiceImpl(IFlowPusherService.class);
-//      NetworkGraph graph = networkGraph.getNetworkGraph();
         planCalc = new PlanCalcRuntime();
         planInstall = new PlanInstallRuntime(floodlightProvider, flowPusher);
         eventListener = new EventListener();
@@ -175,7 +174,7 @@
         Collection<Class<? extends IFloodlightService>> l =
                 new ArrayList<Class<? extends IFloodlightService>>();
         l.add(IFloodlightProviderService.class);
-        l.add(INetworkGraphService.class);
+        l.add(ITopologyService.class);
         l.add(IDatagridService.class);
         l.add(IFlowPusherService.class);
         return l;
diff --git a/src/main/java/net/onrc/onos/core/intent/runtime/PlanInstallRuntime.java b/src/main/java/net/onrc/onos/core/intent/runtime/PlanInstallRuntime.java
index 4805f51..a807bc8 100644
--- a/src/main/java/net/onrc/onos/core/intent/runtime/PlanInstallRuntime.java
+++ b/src/main/java/net/onrc/onos/core/intent/runtime/PlanInstallRuntime.java
@@ -13,7 +13,7 @@
 import net.floodlightcontroller.core.internal.OFMessageFuture;
 import net.onrc.onos.core.flowprogrammer.IFlowPusherService;
 import net.onrc.onos.core.intent.FlowEntry;
-//import net.onrc.onos.core.topology.NetworkGraph;
+//import net.onrc.onos.core.topology.Topology;
 import net.onrc.onos.core.util.Pair;
 
 import org.openflow.protocol.OFBarrierReply;
@@ -25,12 +25,12 @@
  */
 
 public class PlanInstallRuntime {
-    //    NetworkGraph graph;
+    //    Topology graph;
     IFlowPusherService pusher;
     IFloodlightProviderService provider;
     private static final Logger log = LoggerFactory.getLogger(PlanInstallRuntime.class);
 
-    public PlanInstallRuntime(//NetworkGraph graph,
+    public PlanInstallRuntime(//Topology graph,
                               IFloodlightProviderService provider,
                               IFlowPusherService pusher) {
 //      this.graph = graph;
diff --git a/src/main/java/net/onrc/onos/core/intent/runtime/web/ShortestPathResource.java b/src/main/java/net/onrc/onos/core/intent/runtime/web/ShortestPathResource.java
index 6338d52..4989d6d 100644
--- a/src/main/java/net/onrc/onos/core/intent/runtime/web/ShortestPathResource.java
+++ b/src/main/java/net/onrc/onos/core/intent/runtime/web/ShortestPathResource.java
@@ -6,11 +6,11 @@
 
 import net.onrc.onos.core.intent.ConstrainedBFSTree;
 import net.onrc.onos.core.intent.Path;
-import net.onrc.onos.core.topology.INetworkGraphService;
+import net.onrc.onos.core.topology.ITopologyService;
 import net.onrc.onos.core.topology.Link;
 import net.onrc.onos.core.topology.LinkEvent;
-import net.onrc.onos.core.topology.NetworkGraph;
 import net.onrc.onos.core.topology.Switch;
+import net.onrc.onos.core.topology.Topology;
 import net.onrc.onos.core.topology.serializers.LinkSerializer;
 import net.onrc.onos.core.util.Dpid;
 
@@ -38,11 +38,11 @@
      */
     @Get("json")
     public String retrieve() {
-        INetworkGraphService networkGraphService =
-                (INetworkGraphService) getContext().getAttributes().
-                        get(INetworkGraphService.class.getCanonicalName());
+        ITopologyService topologyService =
+                (ITopologyService) getContext().getAttributes().
+                        get(ITopologyService.class.getCanonicalName());
 
-        NetworkGraph graph = networkGraphService.getNetworkGraph();
+        Topology topology = topologyService.getTopology();
 
         //
         // Prepare the JSON serializer
@@ -65,10 +65,10 @@
         // Do the Shortest Path computation and return the result: a list of
         // links.
         //
-        graph.acquireReadLock();
+        topology.acquireReadLock();
         try {
-            Switch srcSwitch = graph.getSwitch(srcDpid.value());
-            Switch dstSwitch = graph.getSwitch(dstDpid.value());
+            Switch srcSwitch = topology.getSwitch(srcDpid.value());
+            Switch dstSwitch = topology.getSwitch(dstDpid.value());
             if ((srcSwitch == null) || (dstSwitch == null)) {
                 return "";
             }
@@ -76,7 +76,7 @@
             Path path = bfsTree.getPath(dstSwitch);
             List<Link> links = new LinkedList<>();
             for (LinkEvent linkEvent : path) {
-                Link link = graph.getLink(linkEvent.getSrc().getDpid(),
+                Link link = topology.getLink(linkEvent.getSrc().getDpid(),
                         linkEvent.getSrc().getNumber(),
                         linkEvent.getDst().getDpid(),
                         linkEvent.getDst().getNumber());
@@ -90,7 +90,7 @@
             log.error("Error writing Shortest Path to JSON", e);
             return "";
         } finally {
-            graph.releaseReadLock();
+            topology.releaseReadLock();
         }
     }
 }
diff --git a/src/main/java/net/onrc/onos/core/packetservice/BroadcastPacketOutNotification.java b/src/main/java/net/onrc/onos/core/packetservice/BroadcastPacketOutNotification.java
index e2f9d21..c1c631c 100644
--- a/src/main/java/net/onrc/onos/core/packetservice/BroadcastPacketOutNotification.java
+++ b/src/main/java/net/onrc/onos/core/packetservice/BroadcastPacketOutNotification.java
@@ -2,7 +2,7 @@
 
 import java.util.Map;
 
-import net.onrc.onos.core.topology.NetworkGraph;
+import net.onrc.onos.core.topology.Topology;
 import net.onrc.onos.core.topology.Port;
 
 import com.google.common.collect.HashMultimap;
@@ -82,17 +82,17 @@
 
     @Override
     public Multimap<Long, Short> calculateOutPorts(
-            Multimap<Long, Short> localPorts, NetworkGraph networkGraph) {
+            Multimap<Long, Short> localPorts, Topology topology) {
         Multimap<Long, Short> outPorts = HashMultimap.create();
 
         for (Map.Entry<Long, Short> entry : localPorts.entries()) {
             Port globalPort;
-            networkGraph.acquireReadLock();
+            topology.acquireReadLock();
             try {
-                globalPort = networkGraph.getPort(entry.getKey(),
+                globalPort = topology.getPort(entry.getKey(),
                     entry.getValue().longValue());
             } finally {
-                networkGraph.releaseReadLock();
+                topology.releaseReadLock();
             }
 
             if ((!entry.getKey().equals(inSwitch) ||
diff --git a/src/main/java/net/onrc/onos/core/packetservice/PacketModule.java b/src/main/java/net/onrc/onos/core/packetservice/PacketModule.java
index 6bdf874..2bed639 100644
--- a/src/main/java/net/onrc/onos/core/packetservice/PacketModule.java
+++ b/src/main/java/net/onrc/onos/core/packetservice/PacketModule.java
@@ -22,10 +22,10 @@
 import net.onrc.onos.core.datagrid.IEventChannelListener;
 import net.onrc.onos.core.flowprogrammer.IFlowPusherService;
 import net.onrc.onos.core.packet.Ethernet;
-import net.onrc.onos.core.topology.INetworkGraphService;
-import net.onrc.onos.core.topology.NetworkGraph;
+import net.onrc.onos.core.topology.ITopologyService;
 import net.onrc.onos.core.topology.Port;
 import net.onrc.onos.core.topology.Switch;
+import net.onrc.onos.core.topology.Topology;
 import net.onrc.onos.core.util.SwitchPort;
 
 import org.openflow.protocol.OFMessage;
@@ -49,7 +49,7 @@
     private final CopyOnWriteArrayList<IPacketListener> listeners;
 
     private IFloodlightProviderService floodlightProvider;
-    private NetworkGraph networkGraph;
+    private Topology topology;
     private IDatagridService datagrid;
     private IFlowPusherService flowPusher;
 
@@ -74,7 +74,7 @@
                 }
             }
             Multimap<Long, Short> outPorts = value.calculateOutPorts(
-                    localPorts, networkGraph);
+                    localPorts, topology);
             sendPacketToSwitches(outPorts, value.getPacketData());
         }
 
@@ -159,24 +159,24 @@
         Ethernet eth = IFloodlightProviderService.bcStore.
                 get(cntx, IFloodlightProviderService.CONTEXT_PI_PAYLOAD);
 
-        Switch networkGraphSwitch;
+        Switch topologySwitch;
         Port inPort;
         try {
-            networkGraph.acquireReadLock();
-            networkGraphSwitch = networkGraph.getSwitch(sw.getId());
-            inPort = networkGraph.getPort(sw.getId(), (long) pi.getInPort());
+            topology.acquireReadLock();
+            topologySwitch = topology.getSwitch(sw.getId());
+            inPort = topology.getPort(sw.getId(), (long) pi.getInPort());
         } finally {
-            networkGraph.releaseReadLock();
+            topology.releaseReadLock();
         }
 
-        if (networkGraphSwitch == null || inPort == null) {
+        if (topologySwitch == null || inPort == null) {
             // We can't send packets for switches or ports that aren't in the
-            // network graph yet
+            // topology yet
             return Command.CONTINUE;
         }
 
         for (IPacketListener listener : listeners) {
-            listener.receive(networkGraphSwitch, inPort, eth);
+            listener.receive(topologySwitch, inPort, eth);
         }
 
         return Command.CONTINUE;
@@ -202,7 +202,7 @@
     public Collection<Class<? extends IFloodlightService>> getModuleDependencies() {
         List<Class<? extends IFloodlightService>> dependencies = new ArrayList<>();
         dependencies.add(IFloodlightProviderService.class);
-        dependencies.add(INetworkGraphService.class);
+        dependencies.add(ITopologyService.class);
         dependencies.add(IDatagridService.class);
         dependencies.add(IFlowPusherService.class);
         return dependencies;
@@ -213,8 +213,8 @@
             throws FloodlightModuleException {
         floodlightProvider =
                 context.getServiceImpl(IFloodlightProviderService.class);
-        networkGraph = context.getServiceImpl(INetworkGraphService.class)
-                .getNetworkGraph();
+        topology = context.getServiceImpl(ITopologyService.class)
+                .getTopology();
         datagrid = context.getServiceImpl(IDatagridService.class);
         flowPusher = context.getServiceImpl(IFlowPusherService.class);
     }
diff --git a/src/main/java/net/onrc/onos/core/packetservice/PacketOutNotification.java b/src/main/java/net/onrc/onos/core/packetservice/PacketOutNotification.java
index 0307d2f..b92518a 100644
--- a/src/main/java/net/onrc/onos/core/packetservice/PacketOutNotification.java
+++ b/src/main/java/net/onrc/onos/core/packetservice/PacketOutNotification.java
@@ -3,7 +3,7 @@
 import java.io.Serializable;
 import java.util.Arrays;
 
-import net.onrc.onos.core.topology.NetworkGraph;
+import net.onrc.onos.core.topology.Topology;
 
 import com.google.common.collect.Multimap;
 
@@ -54,11 +54,11 @@
      * instance.
      *
      * @param localPorts the map of locally-controlled ports
-     * @param networkGraph an instance of the global network graph
+     * @param topology an instance of the global topology
      * @return a multimap of ports that the packet should be sent out,
      * in the form
      * {@code {dpid1 => {portnum1, portnum2, ...}, dpid2 => {portnum1}, ...}}
      */
     public abstract Multimap<Long, Short> calculateOutPorts(
-            Multimap<Long, Short> localPorts, NetworkGraph networkGraph);
+            Multimap<Long, Short> localPorts, Topology topology);
 }
diff --git a/src/main/java/net/onrc/onos/core/packetservice/SinglePacketOutNotification.java b/src/main/java/net/onrc/onos/core/packetservice/SinglePacketOutNotification.java
index edf017b..0521434 100644
--- a/src/main/java/net/onrc/onos/core/packetservice/SinglePacketOutNotification.java
+++ b/src/main/java/net/onrc/onos/core/packetservice/SinglePacketOutNotification.java
@@ -1,6 +1,6 @@
 package net.onrc.onos.core.packetservice;
 
-import net.onrc.onos.core.topology.NetworkGraph;
+import net.onrc.onos.core.topology.Topology;
 
 import com.google.common.collect.HashMultimap;
 import com.google.common.collect.Multimap;
@@ -72,7 +72,7 @@
 
     @Override
     public Multimap<Long, Short> calculateOutPorts(
-            Multimap<Long, Short> localPorts, NetworkGraph networkGraph) {
+            Multimap<Long, Short> localPorts, Topology topology) {
         Multimap<Long, Short> outPorts = HashMultimap.create();
 
         if (localPorts.containsEntry(outSwitch, outPort)) {
diff --git a/src/main/java/net/onrc/onos/core/topology/DeviceImpl.java b/src/main/java/net/onrc/onos/core/topology/DeviceImpl.java
index d070570..6bb133a 100644
--- a/src/main/java/net/onrc/onos/core/topology/DeviceImpl.java
+++ b/src/main/java/net/onrc/onos/core/topology/DeviceImpl.java
@@ -8,14 +8,14 @@
 /**
  * @author Toshio Koide (t-koide@onlab.us)
  */
-public class DeviceImpl extends NetworkGraphObject implements Device {
+public class DeviceImpl extends TopologyObject implements Device {
 
     private final MACAddress macAddr;
     protected LinkedList<Port> attachmentPoints;
     private long lastSeenTime;
 
-    public DeviceImpl(NetworkGraph graph, MACAddress mac) {
-        super(graph);
+    public DeviceImpl(Topology topology, MACAddress mac) {
+        super(topology);
         this.macAddr = mac;
         this.attachmentPoints = new LinkedList<>();
     }
diff --git a/src/main/java/net/onrc/onos/core/topology/INetworkGraphService.java b/src/main/java/net/onrc/onos/core/topology/INetworkGraphService.java
deleted file mode 100644
index 18eb785..0000000
--- a/src/main/java/net/onrc/onos/core/topology/INetworkGraphService.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package net.onrc.onos.core.topology;
-
-import net.floodlightcontroller.core.module.IFloodlightService;
-
-/**
- * Interface for providing the Network Graph Service to other modules.
- */
-public interface INetworkGraphService extends IFloodlightService {
-    /**
-     * Allows a module to get a reference to the global network graph object.
-     *
-     * @return
-     */
-    public NetworkGraph getNetworkGraph();
-
-    public void registerNetworkGraphListener(INetworkGraphListener listener);
-
-    public void deregisterNetworkGraphListener(INetworkGraphListener listener);
-
-    /**
-     * Allows a module to get a reference to the southbound interface to
-     * the network graph.
-     * TODO Figure out how to hide the southbound interface from
-     * applications/modules that shouldn't touch it
-     *
-     * @return
-     */
-    public NetworkGraphDiscoveryInterface getNetworkGraphDiscoveryInterface();
-}
diff --git a/src/main/java/net/onrc/onos/core/topology/INetworkGraphListener.java b/src/main/java/net/onrc/onos/core/topology/ITopologyListener.java
similarity index 92%
rename from src/main/java/net/onrc/onos/core/topology/INetworkGraphListener.java
rename to src/main/java/net/onrc/onos/core/topology/ITopologyListener.java
index 6132fbb..889db03 100644
--- a/src/main/java/net/onrc/onos/core/topology/INetworkGraphListener.java
+++ b/src/main/java/net/onrc/onos/core/topology/ITopologyListener.java
@@ -4,11 +4,11 @@
 
 /**
  * Interface which needs to be implemented to receive Topology events from
- * the NetworkGraph.
+ * the Topology.
  */
-public interface INetworkGraphListener {
+public interface ITopologyListener {
     /**
-     * Network Graph events.
+     * Topology events.
      * <p/>
      * The recommended ordering rules for applying/processing the events is:
      * (a) Process "added" events before "removed" events.
@@ -34,7 +34,7 @@
      * @param removedDeviceEvents the Removed Device Events.
      */
     // CHECKSTYLE:OFF suppress warning about too many parameters
-    public void networkGraphEvents(Collection<SwitchEvent> addedSwitchEvents,
+    public void topologyEvents(Collection<SwitchEvent> addedSwitchEvents,
                                    Collection<SwitchEvent> removedSwitchEvents,
                                    Collection<PortEvent> addedPortEvents,
                                    Collection<PortEvent> removedPortEvents,
diff --git a/src/main/java/net/onrc/onos/core/topology/ITopologyService.java b/src/main/java/net/onrc/onos/core/topology/ITopologyService.java
new file mode 100644
index 0000000..b6280bc
--- /dev/null
+++ b/src/main/java/net/onrc/onos/core/topology/ITopologyService.java
@@ -0,0 +1,40 @@
+package net.onrc.onos.core.topology;
+
+import net.floodlightcontroller.core.module.IFloodlightService;
+
+/**
+ * Interface for providing the topology service to other modules.
+ */
+public interface ITopologyService extends IFloodlightService {
+    /**
+     * Allows a module to get a reference to the global topology object.
+     *
+     * @return the global Topology object
+     */
+    public Topology getTopology();
+
+    /**
+     * Registers a listener for topology events.
+     *
+     * @param listener the listener to register
+     */
+    public void registerTopologyListener(ITopologyListener listener);
+
+    /**
+     * Deregisters a listener for topology events. The listener will no longer
+     * receive topology events after this call.
+     *
+     * @param listener the listener to deregister
+     */
+    public void deregisterTopologyListener(ITopologyListener listener);
+
+    /**
+     * Allows a module to get a reference to the southbound interface to
+     * the topology.
+     * TODO Figure out how to hide the southbound interface from
+     * applications/modules that shouldn't touch it
+     *
+     * @return the TopologyDiscoveryInterface object
+     */
+    public TopologyDiscoveryInterface getTopologyDiscoveryInterface();
+}
diff --git a/src/main/java/net/onrc/onos/core/topology/Link.java b/src/main/java/net/onrc/onos/core/topology/Link.java
index 8715b12..2bd9cef 100644
--- a/src/main/java/net/onrc/onos/core/topology/Link.java
+++ b/src/main/java/net/onrc/onos/core/topology/Link.java
@@ -3,7 +3,7 @@
 // TODO Everything returned by these interfaces must be either Unmodifiable view,
 // immutable object, or a copy of the original "SB" In-memory Topology.
 /**
- * Interface of Link object in Network Graph topology.
+ * Interface of Link object in the topology.
  */
 public interface Link {
     /**
diff --git a/src/main/java/net/onrc/onos/core/topology/LinkImpl.java b/src/main/java/net/onrc/onos/core/topology/LinkImpl.java
index bf66100..7347172 100644
--- a/src/main/java/net/onrc/onos/core/topology/LinkImpl.java
+++ b/src/main/java/net/onrc/onos/core/topology/LinkImpl.java
@@ -8,7 +8,7 @@
  * TODO REMOVE following design memo: This object itself may hold the DBObject,
  * but this Object itself will not issue any read/write to the DataStore.
  */
-public class LinkImpl extends NetworkGraphObject implements Link {
+public class LinkImpl extends TopologyObject implements Link {
     private SwitchPort srcPort;
     private SwitchPort dstPort;
 
@@ -20,36 +20,36 @@
 
     /**
      * Constructor for when a link is read from the database and the Ports
-     * already exist in the in-memory network graph.
+     * already exist in the in-memory topology.
      *
-     * @param graph
+     * @param topology
      * @param srcPort
      * @param dstPort
      */
-    public LinkImpl(NetworkGraph graph, Port srcPort, Port dstPort) {
-        super(graph);
+    public LinkImpl(Topology topology, Port srcPort, Port dstPort) {
+        super(topology);
         this.srcPort = srcPort.asSwitchPort();
         this.dstPort = dstPort.asSwitchPort();
     }
 
     @Override
     public Switch getSrcSwitch() {
-        return graph.getSwitch(srcPort.dpid().value());
+        return topology.getSwitch(srcPort.dpid().value());
     }
 
     @Override
     public Port getSrcPort() {
-        return graph.getPort(srcPort.dpid().value(), (long) srcPort.port().value());
+        return topology.getPort(srcPort.dpid().value(), (long) srcPort.port().value());
     }
 
     @Override
     public Switch getDstSwitch() {
-        return graph.getSwitch(dstPort.dpid().value());
+        return topology.getSwitch(dstPort.dpid().value());
     }
 
     @Override
     public Port getDstPort() {
-        return graph.getPort(dstPort.dpid().value(), (long) dstPort.port().value());
+        return topology.getPort(dstPort.dpid().value(), (long) dstPort.port().value());
     }
 
     @Override
diff --git a/src/main/java/net/onrc/onos/core/topology/NetworkGraphObject.java b/src/main/java/net/onrc/onos/core/topology/NetworkGraphObject.java
deleted file mode 100644
index bef0e11..0000000
--- a/src/main/java/net/onrc/onos/core/topology/NetworkGraphObject.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package net.onrc.onos.core.topology;
-
-
-public class NetworkGraphObject {
-
-    protected final NetworkGraph graph;
-
-    public NetworkGraphObject(NetworkGraph graph) {
-        this.graph = graph;
-    }
-
-}
diff --git a/src/main/java/net/onrc/onos/core/topology/Port.java b/src/main/java/net/onrc/onos/core/topology/Port.java
index 44f4bcf..9a0c06e 100644
--- a/src/main/java/net/onrc/onos/core/topology/Port.java
+++ b/src/main/java/net/onrc/onos/core/topology/Port.java
@@ -6,7 +6,7 @@
 //immutable object, or a copy of the original "SB" In-memory Topology.
 
 /**
- * Interface of Port object in Network Graph topology.
+ * Interface of Port object in the topology.
  */
 public interface Port {
 
diff --git a/src/main/java/net/onrc/onos/core/topology/PortImpl.java b/src/main/java/net/onrc/onos/core/topology/PortImpl.java
index 1f6946a..e88d23b 100644
--- a/src/main/java/net/onrc/onos/core/topology/PortImpl.java
+++ b/src/main/java/net/onrc/onos/core/topology/PortImpl.java
@@ -12,7 +12,7 @@
  * TODO REMOVE following design memo: This object itself may hold the DBObject,
  * but this Object itself will not issue any read/write to the DataStore.
  */
-public class PortImpl extends NetworkGraphObject implements Port {
+public class PortImpl extends TopologyObject implements Port {
 
     private Switch sw;
 
@@ -21,11 +21,12 @@
 
     private final SwitchPort switchPort;
 
-    // These needs to be ConcurrentCollecton if allowing Graph to be accessed Concurrently
+    // These needs to be ConcurrentCollecton if allowing the topology to be
+    // accessed concurrently
     protected Set<Device> devices;
 
-    public PortImpl(NetworkGraph graph, Switch parentSwitch, Long number) {
-        super(graph);
+    public PortImpl(Topology topology, Switch parentSwitch, Long number) {
+        super(topology);
         this.sw = parentSwitch;
         this.number = number;
         this.devices = new HashSet<>();
@@ -70,13 +71,13 @@
 
     @Override
     public Link getOutgoingLink() {
-        return graph.getOutgoingLink(switchPort.dpid().value(),
+        return topology.getOutgoingLink(switchPort.dpid().value(),
                 (long) switchPort.port().value());
     }
 
     @Override
     public Link getIncomingLink() {
-        return graph.getIncomingLink(switchPort.dpid().value(),
+        return topology.getIncomingLink(switchPort.dpid().value(),
                 (long) switchPort.port().value());
     }
 
diff --git a/src/main/java/net/onrc/onos/core/topology/Switch.java b/src/main/java/net/onrc/onos/core/topology/Switch.java
index 5f635df..32dedd8 100644
--- a/src/main/java/net/onrc/onos/core/topology/Switch.java
+++ b/src/main/java/net/onrc/onos/core/topology/Switch.java
@@ -5,7 +5,7 @@
 // TOOD Everything returned by these interfaces must be either Unmodifiable view,
 // immutable object, or a copy of the original "SB" In-memory Topology.
 /**
- * Interface of Switch object in Network Graph topology.
+ * Interface of Switch object in the topology.
  */
 public interface Switch {
 
diff --git a/src/main/java/net/onrc/onos/core/topology/SwitchImpl.java b/src/main/java/net/onrc/onos/core/topology/SwitchImpl.java
index 1e5e1e2..5d287a8 100644
--- a/src/main/java/net/onrc/onos/core/topology/SwitchImpl.java
+++ b/src/main/java/net/onrc/onos/core/topology/SwitchImpl.java
@@ -16,14 +16,15 @@
  * TODO REMOVE following design memo: This object itself may hold the DBObject,
  * but this Object itself will not issue any read/write to the DataStore.
  */
-public class SwitchImpl extends NetworkGraphObject implements Switch {
+public class SwitchImpl extends TopologyObject implements Switch {
 
     private Long dpid;
-    // These needs to be ConcurrentCollecton if allowing Graph to be accessed Concurrently
+    // These needs to be ConcurrentCollecton if allowing the topology to be
+    // accessed concurrently
     private final Map<Long, Port> ports;
 
-    public SwitchImpl(NetworkGraph graph, Long dpid) {
-        super(graph);
+    public SwitchImpl(Topology topology, Long dpid) {
+        super(topology);
         this.dpid = dpid;
         ports = new HashMap<Long, Port>();
     }
@@ -91,7 +92,7 @@
     }
 
     public Port addPort(Long portNumber) {
-        PortImpl port = new PortImpl(graph, this, portNumber);
+        PortImpl port = new PortImpl(topology, this, portNumber);
         ports.put(port.getNumber(), port);
         return port;
     }
diff --git a/src/main/java/net/onrc/onos/core/topology/NetworkGraph.java b/src/main/java/net/onrc/onos/core/topology/Topology.java
similarity index 96%
rename from src/main/java/net/onrc/onos/core/topology/NetworkGraph.java
rename to src/main/java/net/onrc/onos/core/topology/Topology.java
index 6133bb6..3b90f89 100644
--- a/src/main/java/net/onrc/onos/core/topology/NetworkGraph.java
+++ b/src/main/java/net/onrc/onos/core/topology/Topology.java
@@ -3,11 +3,11 @@
 import net.floodlightcontroller.util.MACAddress;
 
 /**
- * The northbound interface to the topology network graph. This interface
+ * The northbound interface to the topology. This interface
  * is presented to the rest of ONOS. It is currently read-only, as we want
  * only the discovery modules to be allowed to modify the topology.
  */
-public interface NetworkGraph {
+public interface Topology {
     /**
      * Get the switch for a given switch DPID.
      *
diff --git a/src/main/java/net/onrc/onos/core/topology/NetworkGraphDatastore.java b/src/main/java/net/onrc/onos/core/topology/TopologyDatastore.java
similarity index 88%
rename from src/main/java/net/onrc/onos/core/topology/NetworkGraphDatastore.java
rename to src/main/java/net/onrc/onos/core/topology/TopologyDatastore.java
index 08eb061..5067666 100644
--- a/src/main/java/net/onrc/onos/core/topology/NetworkGraphDatastore.java
+++ b/src/main/java/net/onrc/onos/core/topology/TopologyDatastore.java
@@ -19,22 +19,10 @@
 import org.slf4j.LoggerFactory;
 
 /**
- * The southbound interface to the network graph which allows clients to
- * mutate the graph. This class will maintain the invariants of the network
- * graph. The southbound discovery modules will use this interface to update
- * the network graph as they learn about the state of the network.
- * <p/>
- * Modification to the Network Map by this module will:
- * 1. Writes to Cluster-wide DataStore.
- * 2. Update ONOS instance In-memory Network Map.
- * 3. Send-out Notification. (TBD)
- * (XXX: To update other instances In-memory Network Map,
- * notification should be triggered here.
- * But if we want to aggregate notification to minimize notification,
- * It might be better for the caller to trigger notification.)
+ * Contains methods which write topology events into the key-value data store.
  */
-public class NetworkGraphDatastore {
-    private static final Logger log = LoggerFactory.getLogger(NetworkGraphDatastore.class);
+public class TopologyDatastore {
+    private static final Logger log = LoggerFactory.getLogger(TopologyDatastore.class);
 
     /**
      * Add a switch to the database.
diff --git a/src/main/java/net/onrc/onos/core/topology/NetworkGraphDiscoveryInterface.java b/src/main/java/net/onrc/onos/core/topology/TopologyDiscoveryInterface.java
similarity index 96%
rename from src/main/java/net/onrc/onos/core/topology/NetworkGraphDiscoveryInterface.java
rename to src/main/java/net/onrc/onos/core/topology/TopologyDiscoveryInterface.java
index 219417f..16d8af1 100644
--- a/src/main/java/net/onrc/onos/core/topology/NetworkGraphDiscoveryInterface.java
+++ b/src/main/java/net/onrc/onos/core/topology/TopologyDiscoveryInterface.java
@@ -6,7 +6,7 @@
  * Interface used by the Topology Discovery module to write topology-related
  * events.
  */
-public interface NetworkGraphDiscoveryInterface {
+public interface TopologyDiscoveryInterface {
     /**
      * Switch discovered event.
      *
diff --git a/src/main/java/net/onrc/onos/core/topology/NetworkGraphImpl.java b/src/main/java/net/onrc/onos/core/topology/TopologyImpl.java
similarity index 95%
rename from src/main/java/net/onrc/onos/core/topology/NetworkGraphImpl.java
rename to src/main/java/net/onrc/onos/core/topology/TopologyImpl.java
index 395f2af..d48e222 100644
--- a/src/main/java/net/onrc/onos/core/topology/NetworkGraphImpl.java
+++ b/src/main/java/net/onrc/onos/core/topology/TopologyImpl.java
@@ -13,9 +13,9 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class NetworkGraphImpl implements NetworkGraph {
+public class TopologyImpl implements Topology {
     @SuppressWarnings("unused")
-    private static final Logger log = LoggerFactory.getLogger(NetworkGraphImpl.class);
+    private static final Logger log = LoggerFactory.getLogger(TopologyImpl.class);
 
     // DPID -> Switch
     private final ConcurrentMap<Long, Switch> switches;
@@ -29,7 +29,7 @@
     // TODO use the write lock after refactor
     private Lock writeLock = readWriteLock.writeLock();
 
-    public NetworkGraphImpl() {
+    public TopologyImpl() {
         // TODO: Does these object need to be stored in Concurrent Collection?
         switches = new ConcurrentHashMap<>();
         mac2Device = new ConcurrentHashMap<>();
diff --git a/src/main/java/net/onrc/onos/core/topology/TopologyManager.java b/src/main/java/net/onrc/onos/core/topology/TopologyManager.java
index 67e8e5d..ffad050 100644
--- a/src/main/java/net/onrc/onos/core/topology/TopologyManager.java
+++ b/src/main/java/net/onrc/onos/core/topology/TopologyManager.java
@@ -29,7 +29,9 @@
 import org.slf4j.LoggerFactory;
 
 /**
- * The "NB" read-only Network Map.
+ * The TopologyManager receives topology updates from the southbound discovery
+ * modules and from other ONOS instances. These updates are processed and
+ * applied to the in-memory topology instance.
  * <p/>
  * - Maintain Invariant/Relationships between Topology Objects.
  * <p/>
@@ -41,7 +43,7 @@
  * TODO TBD: This class may delay the requested change to handle event
  * re-ordering. e.g.) Link Add came in, but Switch was not there.
  */
-public class TopologyManager implements NetworkGraphDiscoveryInterface {
+public class TopologyManager implements TopologyDiscoveryInterface {
 
     private static final Logger log = LoggerFactory
             .getLogger(TopologyManager.class);
@@ -50,10 +52,10 @@
     public static final String EVENT_CHANNEL_NAME = "onos.topology";
     private EventHandler eventHandler = new EventHandler();
 
-    private final NetworkGraphDatastore datastore;
-    private final NetworkGraphImpl networkGraph = new NetworkGraphImpl();
+    private final TopologyDatastore datastore;
+    private final TopologyImpl topology = new TopologyImpl();
     private final IControllerRegistryService registryService;
-    private CopyOnWriteArrayList<INetworkGraphListener> networkGraphListeners;
+    private CopyOnWriteArrayList<ITopologyListener> topologyListeners;
 
     //
     // Local state for keeping track of reordered events.
@@ -98,24 +100,23 @@
     /**
      * Constructor.
      *
-     * @param registryService       the Registry Service to use.
-     * @param networkGraphListeners the collection of Network Graph Listeners
-     *                              to use.
+     * @param registryService the Registry Service to use.
+     * @param topologyListeners the collection of topology listeners to use.
      */
     public TopologyManager(IControllerRegistryService registryService,
-                           CopyOnWriteArrayList<INetworkGraphListener> networkGraphListeners) {
-        datastore = new NetworkGraphDatastore();
+                           CopyOnWriteArrayList<ITopologyListener> topologyListeners) {
+        datastore = new TopologyDatastore();
         this.registryService = registryService;
-        this.networkGraphListeners = networkGraphListeners;
+        this.topologyListeners = topologyListeners;
     }
 
     /**
-     * Get the Network Graph.
+     * Get the Topology.
      *
-     * @return the Network Graph.
+     * @return the Topology.
      */
-    NetworkGraph getNetworkGraph() {
-        return networkGraph;
+    Topology getTopology() {
+        return topology;
     }
 
     /**
@@ -271,9 +272,9 @@
             }
 
             //
-            // Lock the Network Graph while it is modified
+            // Lock the topology while it is modified
             //
-            networkGraph.acquireWriteLock();
+            topology.acquireWriteLock();
 
             try {
                 //
@@ -319,15 +320,15 @@
 
             } finally {
                 //
-                // Network Graph modifications completed: Release the lock
+                // Topology modifications completed: Release the lock
                 //
-                networkGraph.releaseWriteLock();
+                topology.releaseWriteLock();
             }
 
             //
             // Dispatch the Topology Notification Events to the applications
             //
-            dispatchNetworkGraphEvents();
+            dispatchTopologyEvents();
         }
 
         /**
@@ -382,9 +383,9 @@
     }
 
     /**
-     * Dispatch Network Graph Events to the listeners.
+     * Dispatch Topology Events to the listeners.
      */
-    private void dispatchNetworkGraphEvents() {
+    private void dispatchTopologyEvents() {
         if (apiAddedSwitchEvents.isEmpty() &&
                 apiRemovedSwitchEvents.isEmpty() &&
                 apiAddedPortEvents.isEmpty() &&
@@ -402,35 +403,35 @@
             // TODO: Those statements should be removed in the future
             //
             for (SwitchEvent switchEvent : apiAddedSwitchEvents) {
-                log.debug("Dispatch Network Graph Event: ADDED {}", switchEvent);
+                log.debug("Dispatch Topology Event: ADDED {}", switchEvent);
             }
             for (SwitchEvent switchEvent : apiRemovedSwitchEvents) {
-                log.debug("Dispatch Network Graph Event: REMOVED {}", switchEvent);
+                log.debug("Dispatch Topology Event: REMOVED {}", switchEvent);
             }
             for (PortEvent portEvent : apiAddedPortEvents) {
-                log.debug("Dispatch Network Graph Event: ADDED {}", portEvent);
+                log.debug("Dispatch Topology Event: ADDED {}", portEvent);
             }
             for (PortEvent portEvent : apiRemovedPortEvents) {
-                log.debug("Dispatch Network Graph Event: REMOVED {}", portEvent);
+                log.debug("Dispatch Topology Event: REMOVED {}", portEvent);
             }
             for (LinkEvent linkEvent : apiAddedLinkEvents) {
-                log.debug("Dispatch Network Graph Event: ADDED {}", linkEvent);
+                log.debug("Dispatch Topology Event: ADDED {}", linkEvent);
             }
             for (LinkEvent linkEvent : apiRemovedLinkEvents) {
-                log.debug("Dispatch Network Graph Event: REMOVED {}", linkEvent);
+                log.debug("Dispatch Topology Event: REMOVED {}", linkEvent);
             }
             for (DeviceEvent deviceEvent : apiAddedDeviceEvents) {
-                log.debug("Dispatch Network Graph Event: ADDED {}", deviceEvent);
+                log.debug("Dispatch Topology Event: ADDED {}", deviceEvent);
             }
             for (DeviceEvent deviceEvent : apiRemovedDeviceEvents) {
-                log.debug("Dispatch Network Graph Event: REMOVED {}", deviceEvent);
+                log.debug("Dispatch Topology Event: REMOVED {}", deviceEvent);
             }
         }
 
         // Deliver the events
-        for (INetworkGraphListener listener : this.networkGraphListeners) {
+        for (ITopologyListener listener : this.topologyListeners) {
             // TODO: Should copy before handing them over to listener?
-            listener.networkGraphEvents(apiAddedSwitchEvents,
+            listener.topologyEvents(apiAddedSwitchEvents,
                     apiRemovedSwitchEvents,
                     apiAddedPortEvents,
                     apiRemovedPortEvents,
@@ -747,7 +748,7 @@
             // Send out notification
             TopologyEvent topologyEvent = new TopologyEvent(deviceEvent);
             eventChannel.addEntry(topologyEvent.getID(), topologyEvent);
-            log.debug("Put the device info into the cache of the graph. mac {}", deviceEvent.getMac());
+            log.debug("Put the device info into the cache of the topology. mac {}", deviceEvent.getMac());
 
             // Store the new Device Event in the local cache
             // TODO: The implementation below is probably wrong
@@ -775,7 +776,7 @@
         if (datastore.removeDevice(deviceEvent)) {
             // Send out notification
             eventChannel.removeEntry(deviceEvent.getID());
-            log.debug("Remove the device info into the cache of the graph. mac {}", deviceEvent.getMac());
+            log.debug("Remove the device info into the cache of the topology. mac {}", deviceEvent.getMac());
 
             // Cleanup the Device Event from the local cache
             // TODO: The implementation below is probably wrong
@@ -791,15 +792,15 @@
     }
 
     /**
-     * Add a switch to the Network Graph.
+     * Add a switch to the topology.
      *
      * @param switchEvent the Switch Event with the switch to add.
      */
     private void addSwitch(SwitchEvent switchEvent) {
-        Switch sw = networkGraph.getSwitch(switchEvent.getDpid());
+        Switch sw = topology.getSwitch(switchEvent.getDpid());
         if (sw == null) {
-            sw = new SwitchImpl(networkGraph, switchEvent.getDpid());
-            networkGraph.putSwitch(sw);
+            sw = new SwitchImpl(topology, switchEvent.getDpid());
+            topology.putSwitch(sw);
         } else {
             // TODO: Update the switch attributes
             // TODO: Nothing to do for now
@@ -809,12 +810,12 @@
     }
 
     /**
-     * Remove a switch from the Network Graph.
+     * Remove a switch from the topology.
      *
      * @param switchEvent the Switch Event with the switch to remove.
      */
     private void removeSwitch(SwitchEvent switchEvent) {
-        Switch sw = networkGraph.getSwitch(switchEvent.getDpid());
+        Switch sw = topology.getSwitch(switchEvent.getDpid());
         if (sw == null) {
             log.warn("Switch {} already removed, ignoring", switchEvent);
             return;
@@ -835,17 +836,17 @@
             removePort(portEvent);
         }
 
-        networkGraph.removeSwitch(switchEvent.getDpid());
+        topology.removeSwitch(switchEvent.getDpid());
         apiRemovedSwitchEvents.add(switchEvent);
     }
 
     /**
-     * Add a port to the Network Graph.
+     * Add a port to the topology.
      *
      * @param portEvent the Port Event with the port to add.
      */
     private void addPort(PortEvent portEvent) {
-        Switch sw = networkGraph.getSwitch(portEvent.getDpid());
+        Switch sw = topology.getSwitch(portEvent.getDpid());
         if (sw == null) {
             // Reordered event: delay the event in local cache
             ByteBuffer id = portEvent.getIDasByteBuffer();
@@ -856,7 +857,7 @@
 
         Port port = sw.getPort(portEvent.getNumber());
         if (port == null) {
-            port = new PortImpl(networkGraph, sw, portEvent.getNumber());
+            port = new PortImpl(topology, sw, portEvent.getNumber());
             switchImpl.addPort(port);
         } else {
             // TODO: Update the port attributes
@@ -866,12 +867,12 @@
     }
 
     /**
-     * Remove a port from the Network Graph.
+     * Remove a port from the topology.
      *
      * @param portEvent the Port Event with the port to remove.
      */
     private void removePort(PortEvent portEvent) {
-        Switch sw = networkGraph.getSwitch(portEvent.getDpid());
+        Switch sw = topology.getSwitch(portEvent.getDpid());
         if (sw == null) {
             log.warn("Parent Switch for Port {} already removed, ignoring",
                     portEvent);
@@ -930,14 +931,14 @@
     }
 
     /**
-     * Add a link to the Network Graph.
+     * Add a link to the topology.
      *
      * @param linkEvent the Link Event with the link to add.
      */
     private void addLink(LinkEvent linkEvent) {
-        Port srcPort = networkGraph.getPort(linkEvent.getSrc().dpid,
+        Port srcPort = topology.getPort(linkEvent.getSrc().dpid,
                 linkEvent.getSrc().number);
-        Port dstPort = networkGraph.getPort(linkEvent.getDst().dpid,
+        Port dstPort = topology.getPort(linkEvent.getDst().dpid,
                 linkEvent.getDst().number);
         if ((srcPort == null) || (dstPort == null)) {
             // Reordered event: delay the event in local cache
@@ -950,8 +951,8 @@
         Link link = dstPort.getIncomingLink();
         assert (link == srcPort.getOutgoingLink());
         if (link == null) {
-            link = new LinkImpl(networkGraph, srcPort, dstPort);
-            networkGraph.putLink(link);
+            link = new LinkImpl(topology, srcPort, dstPort);
+            topology.putLink(link);
 
             // Remove all Devices attached to the Ports
             ArrayList<DeviceEvent> devicesToRemove = new ArrayList<>();
@@ -983,12 +984,12 @@
     }
 
     /**
-     * Remove a link from the Network Graph.
+     * Remove a link from the topology.
      *
      * @param linkEvent the Link Event with the link to remove.
      */
     private void removeLink(LinkEvent linkEvent) {
-        Port srcPort = networkGraph.getPort(linkEvent.getSrc().dpid,
+        Port srcPort = topology.getPort(linkEvent.getSrc().dpid,
                 linkEvent.getSrc().number);
         if (srcPort == null) {
             log.warn("Src Port for Link {} already removed, ignoring",
@@ -996,7 +997,7 @@
             return;
         }
 
-        Port dstPort = networkGraph.getPort(linkEvent.getDst().dpid,
+        Port dstPort = topology.getPort(linkEvent.getDst().dpid,
                 linkEvent.getDst().number);
         if (dstPort == null) {
             log.warn("Dst Port for Link {} already removed, ignoring",
@@ -1019,14 +1020,14 @@
 
         // TODO should we check that we get the same link from each port?
         if (link != null) {
-            networkGraph.removeLink(link);
+            topology.removeLink(link);
         }
 
         apiRemovedLinkEvents.add(linkEvent);
     }
 
     /**
-     * Add a device to the Network Graph.
+     * Add a device to the topology.
      * <p/>
      * TODO: Device-related work is incomplete.
      * TODO: Eventually, we might need to consider reordering
@@ -1035,12 +1036,12 @@
      * @param deviceEvent the Device Event with the device to add.
      */
     private void addDevice(DeviceEvent deviceEvent) {
-        log.debug("Adding a device to the Network Graph with mac {}", deviceEvent.getMac());
-        Device device = networkGraph.getDeviceByMac(deviceEvent.getMac());
+        log.debug("Adding a device to the topology with mac {}", deviceEvent.getMac());
+        Device device = topology.getDeviceByMac(deviceEvent.getMac());
 
         if (device == null) {
-            log.debug("Existing device was not found in the NetworkGraph: Adding new device: mac {}", deviceEvent.getMac());
-            device = new DeviceImpl(networkGraph, deviceEvent.getMac());
+            log.debug("Existing device was not found in the Topology: Adding new device: mac {}", deviceEvent.getMac());
+            device = new DeviceImpl(topology, deviceEvent.getMac());
         }
 
         DeviceImpl deviceImpl = getDeviceImpl(device);
@@ -1049,7 +1050,7 @@
         boolean attachmentFound = false;
         for (SwitchPort swp : deviceEvent.getAttachmentPoints()) {
             // Attached Ports must exist
-            Port port = networkGraph.getPort(swp.dpid, swp.number);
+            Port port = topology.getPort(swp.dpid, swp.number);
             if (port == null) {
                 // Reordered event: delay the event in local cache
                 ByteBuffer id = deviceEvent.getIDasByteBuffer();
@@ -1072,24 +1073,24 @@
             attachmentFound = true;
         }
 
-        // Update the device in the Network Graph
+        // Update the device in the topology
         if (attachmentFound) {
-            log.debug("Storing the device info into the NetworkGraph: mac {}", deviceEvent.getMac());
-            networkGraph.putDevice(device);
+            log.debug("Storing the device info into the Topology: mac {}", deviceEvent.getMac());
+            topology.putDevice(device);
             apiAddedDeviceEvents.add(deviceEvent);
         }
     }
 
     /**
-     * Remove a device from the Network Graph.
+     * Remove a device from the topology.
      * <p/>
      * TODO: Device-related work is incomplete.
      *
      * @param deviceEvent the Device Event with the device to remove.
      */
     private void removeDevice(DeviceEvent deviceEvent) {
-        log.debug("Removing a device to the Network Graph: mac {}", deviceEvent.getMac());
-        Device device = networkGraph.getDeviceByMac(deviceEvent.getMac());
+        log.debug("Removing a device to the topology: mac {}", deviceEvent.getMac());
+        Device device = topology.getDeviceByMac(deviceEvent.getMac());
         if (device == null) {
             log.warn("Device {} already removed, ignoring", deviceEvent);
             return;
@@ -1099,7 +1100,7 @@
         // Process each attachment point
         for (SwitchPort swp : deviceEvent.getAttachmentPoints()) {
             // Attached Ports must exist
-            Port port = networkGraph.getPort(swp.dpid, swp.number);
+            Port port = topology.getPort(swp.dpid, swp.number);
             if (port == null) {
                 log.warn("Port for the attachment point {} did not exist. skipping attachment point mutation", swp);
                 continue;
@@ -1111,8 +1112,8 @@
             deviceImpl.removeAttachmentPoint(port);
         }
 
-        log.debug("Removing the device info into the NetworkGraph: mac {}", deviceEvent.getMac());
-        networkGraph.removeDevice(device);
+        log.debug("Removing the device info into the Topology: mac {}", deviceEvent.getMac());
+        topology.removeDevice(device);
         apiRemovedDeviceEvents.add(deviceEvent);
     }
 
diff --git a/src/main/java/net/onrc/onos/core/topology/NetworkGraphModule.java b/src/main/java/net/onrc/onos/core/topology/TopologyModule.java
similarity index 68%
rename from src/main/java/net/onrc/onos/core/topology/NetworkGraphModule.java
rename to src/main/java/net/onrc/onos/core/topology/TopologyModule.java
index 77981d6..657682f 100644
--- a/src/main/java/net/onrc/onos/core/topology/NetworkGraphModule.java
+++ b/src/main/java/net/onrc/onos/core/topology/TopologyModule.java
@@ -14,18 +14,17 @@
 import net.floodlightcontroller.restserver.IRestApiService;
 import net.onrc.onos.core.datagrid.IDatagridService;
 import net.onrc.onos.core.registry.IControllerRegistryService;
-import net.onrc.onos.core.topology.web.NetworkGraphWebRoutable;
+import net.onrc.onos.core.topology.web.TopologyWebRoutable;
 
-public class NetworkGraphModule implements IFloodlightModule, INetworkGraphService {
+public class TopologyModule implements IFloodlightModule, ITopologyService {
 
     // This is initialized as a module for now
 
     private TopologyManager topologyManager;
-    //private NetworkGraphDatastore southboundNetworkGraph;
     private IDatagridService datagridService;
     private IControllerRegistryService registryService;
 
-    private CopyOnWriteArrayList<INetworkGraphListener> networkGraphListeners;
+    private CopyOnWriteArrayList<ITopologyListener> topologyListeners;
 
     private IRestApiService restApi;
 
@@ -33,7 +32,7 @@
     public Collection<Class<? extends IFloodlightService>> getModuleServices() {
         List<Class<? extends IFloodlightService>> services =
                 new ArrayList<Class<? extends IFloodlightService>>();
-        services.add(INetworkGraphService.class);
+        services.add(ITopologyService.class);
         return services;
     }
 
@@ -42,7 +41,7 @@
     getServiceImpls() {
         Map<Class<? extends IFloodlightService>, IFloodlightService> impls =
                 new HashMap<Class<? extends IFloodlightService>, IFloodlightService>();
-        impls.put(INetworkGraphService.class, this);
+        impls.put(ITopologyService.class, this);
         return impls;
     }
 
@@ -63,35 +62,34 @@
         datagridService = context.getServiceImpl(IDatagridService.class);
         registryService = context.getServiceImpl(IControllerRegistryService.class);
 
-        networkGraphListeners = new CopyOnWriteArrayList<>();
-        topologyManager = new TopologyManager(registryService, networkGraphListeners);
-        //southboundNetworkGraph = new NetworkGraphDatastore(networkGraph);
+        topologyListeners = new CopyOnWriteArrayList<>();
+        topologyManager = new TopologyManager(registryService, topologyListeners);
     }
 
     @Override
     public void startUp(FloodlightModuleContext context) {
-        restApi.addRestletRoutable(new NetworkGraphWebRoutable());
+        restApi.addRestletRoutable(new TopologyWebRoutable());
         topologyManager.startup(datagridService);
     }
 
     @Override
-    public NetworkGraph getNetworkGraph() {
-        return topologyManager.getNetworkGraph();
+    public Topology getTopology() {
+        return topologyManager.getTopology();
     }
 
     @Override
-    public NetworkGraphDiscoveryInterface getNetworkGraphDiscoveryInterface() {
+    public TopologyDiscoveryInterface getTopologyDiscoveryInterface() {
         return topologyManager;
     }
 
     @Override
-    public void registerNetworkGraphListener(INetworkGraphListener listener) {
-        networkGraphListeners.addIfAbsent(listener);
+    public void registerTopologyListener(ITopologyListener listener) {
+        topologyListeners.addIfAbsent(listener);
     }
 
     @Override
-    public void deregisterNetworkGraphListener(INetworkGraphListener listener) {
-        networkGraphListeners.remove(listener);
+    public void deregisterTopologyListener(ITopologyListener listener) {
+        topologyListeners.remove(listener);
     }
 
 }
diff --git a/src/main/java/net/onrc/onos/core/topology/TopologyObject.java b/src/main/java/net/onrc/onos/core/topology/TopologyObject.java
new file mode 100644
index 0000000..fd2d0ce
--- /dev/null
+++ b/src/main/java/net/onrc/onos/core/topology/TopologyObject.java
@@ -0,0 +1,12 @@
+package net.onrc.onos.core.topology;
+
+
+public class TopologyObject {
+
+    protected final Topology topology;
+
+    public TopologyObject(Topology topology) {
+        this.topology = topology;
+    }
+
+}
diff --git a/src/main/java/net/onrc/onos/core/topology/NetworkGraphPublisher.java b/src/main/java/net/onrc/onos/core/topology/TopologyPublisher.java
similarity index 86%
rename from src/main/java/net/onrc/onos/core/topology/NetworkGraphPublisher.java
rename to src/main/java/net/onrc/onos/core/topology/TopologyPublisher.java
index 6f9b332..6c90003 100644
--- a/src/main/java/net/onrc/onos/core/topology/NetworkGraphPublisher.java
+++ b/src/main/java/net/onrc/onos/core/topology/TopologyPublisher.java
@@ -31,27 +31,27 @@
 import org.slf4j.LoggerFactory;
 
 /**
- * The NetworkGraphPublisher subscribes to topology network events from the
- * discovery modules. These events are reformatted and relayed to the topology
- * part of the network graph
+ * The TopologyPublisher subscribes to topology network events from the
+ * discovery modules. These events are reformatted and relayed to the in-memory
+ * topology instance.
  */
-public class NetworkGraphPublisher implements /*IOFSwitchListener,*/
+public class TopologyPublisher implements /*IOFSwitchListener,*/
         IOFSwitchPortListener,
         ILinkDiscoveryListener,
         IFloodlightModule,
         IOnosDeviceListener {
     private static final Logger log =
-            LoggerFactory.getLogger(NetworkGraphPublisher.class);
+            LoggerFactory.getLogger(TopologyPublisher.class);
 
     private IFloodlightProviderService floodlightProvider;
     private ILinkDiscoveryService linkDiscovery;
     private IControllerRegistryService registryService;
-    private INetworkGraphService networkGraphService;
+    private ITopologyService topologyService;
 
     private IOnosDeviceService onosDeviceService;
 
-    private NetworkGraph networkGraph;
-    private NetworkGraphDiscoveryInterface networkGraphDiscoveryInterface;
+    private Topology topology;
+    private TopologyDiscoveryInterface topologyDiscoveryInterface;
 
     private static final String ENABLE_CLEANUP_PROPERTY = "EnableCleanup";
     private boolean cleanupEnabled = true;
@@ -59,7 +59,7 @@
     private SingletonTask cleanupTask;
 
     /**
-     * Cleanup old switches from the network graph. Old switches are those
+     * Cleanup old switches from the topology. Old switches are those
      * which have no controller in the registry.
      */
     private class SwitchCleanup implements ControlChangeCallback, Runnable {
@@ -86,7 +86,7 @@
          * registry.
          */
         private void switchCleanup() {
-            Iterable<Switch> switches = networkGraph.getSwitches();
+            Iterable<Switch> switches = topology.getSwitches();
 
             if (log.isTraceEnabled()) {
                 log.trace("Checking for inactive switches");
@@ -110,7 +110,7 @@
         /**
          * Second half of the switch cleanup operation. If the registry grants
          * control of a switch, we can be sure no other instance is writing
-         * this switch to the network graph, so we can remove it now.
+         * this switch to the topology, so we can remove it now.
          *
          * @param dpid       the dpid of the switch we requested control for
          * @param hasControl whether we got control or not
@@ -122,7 +122,7 @@
                         HexString.toHexString(dpid));
 
                 SwitchEvent switchEvent = new SwitchEvent(dpid);
-                networkGraphDiscoveryInterface.
+                topologyDiscoveryInterface.
                         removeSwitchDiscoveryEvent(switchEvent);
                 registryService.releaseControl(dpid);
             }
@@ -137,13 +137,13 @@
 
         switch (update.getOperation()) {
             case LINK_ADDED:
-                networkGraphDiscoveryInterface.putLinkDiscoveryEvent(linkEvent);
+                topologyDiscoveryInterface.putLinkDiscoveryEvent(linkEvent);
                 break;
             case LINK_UPDATED:
                 // We don't use the LINK_UPDATED event (unsure what it means)
                 break;
             case LINK_REMOVED:
-                networkGraphDiscoveryInterface.removeLinkDiscoveryEvent(linkEvent);
+                topologyDiscoveryInterface.removeLinkDiscoveryEvent(linkEvent);
                 break;
             default:
                 break;
@@ -153,14 +153,14 @@
     @Override
     public void switchPortAdded(Long switchId, OFPhysicalPort port) {
         PortEvent portEvent = new PortEvent(switchId, (long) port.getPortNumber());
-        networkGraphDiscoveryInterface.putPortDiscoveryEvent(portEvent);
+        topologyDiscoveryInterface.putPortDiscoveryEvent(portEvent);
         linkDiscovery.removeFromSuppressLLDPs(switchId, port.getPortNumber());
     }
 
     @Override
     public void switchPortRemoved(Long switchId, OFPhysicalPort port) {
         PortEvent portEvent = new PortEvent(switchId, (long) port.getPortNumber());
-        networkGraphDiscoveryInterface.removePortDiscoveryEvent(portEvent);
+        topologyDiscoveryInterface.removePortDiscoveryEvent(portEvent);
     }
 
     @Override
@@ -176,7 +176,7 @@
         for (OFPhysicalPort port : sw.getPorts()) {
             portEvents.add(new PortEvent(sw.getId(), (long) port.getPortNumber()));
         }
-        networkGraphDiscoveryInterface
+        topologyDiscoveryInterface
                 .putSwitchDiscoveryEvent(switchEvent, portEvents);
 
         for (OFPhysicalPort port : sw.getPorts()) {
@@ -226,7 +226,7 @@
         l.add(ILinkDiscoveryService.class);
         l.add(IThreadPoolService.class);
         l.add(IControllerRegistryService.class);
-        l.add(INetworkGraphService.class);
+        l.add(ITopologyService.class);
         l.add(IOnosDeviceService.class);
         return l;
     }
@@ -239,7 +239,7 @@
         registryService = context.getServiceImpl(IControllerRegistryService.class);
         onosDeviceService = context.getServiceImpl(IOnosDeviceService.class);
 
-        networkGraphService = context.getServiceImpl(INetworkGraphService.class);
+        topologyService = context.getServiceImpl(ITopologyService.class);
     }
 
     @Override
@@ -248,9 +248,9 @@
         linkDiscovery.addListener(this);
         onosDeviceService.addOnosDeviceListener(this);
 
-        networkGraph = networkGraphService.getNetworkGraph();
-        networkGraphDiscoveryInterface =
-                networkGraphService.getNetworkGraphDiscoveryInterface();
+        topology = topologyService.getTopology();
+        topologyDiscoveryInterface =
+                topologyService.getTopologyDiscoveryInterface();
 
         // Run the cleanup thread
         String enableCleanup =
@@ -285,13 +285,13 @@
         event.setLastSeenTime(device.getLastSeenTimestamp().getTime());
         // Does not use vlan info now.
 
-        networkGraphDiscoveryInterface.putDeviceDiscoveryEvent(event);
+        topologyDiscoveryInterface.putDeviceDiscoveryEvent(event);
     }
 
     @Override
     public void onosDeviceRemoved(OnosDevice device) {
         log.debug("Called onosDeviceRemoved");
         DeviceEvent event = new DeviceEvent(device.getMacAddress());
-        networkGraphDiscoveryInterface.removeDeviceDiscoveryEvent(event);
+        topologyDiscoveryInterface.removeDeviceDiscoveryEvent(event);
     }
 }
diff --git a/src/main/java/net/onrc/onos/core/topology/web/NetworkGraphDevicesResource.java b/src/main/java/net/onrc/onos/core/topology/web/NetworkGraphDevicesResource.java
deleted file mode 100644
index 84aaeba..0000000
--- a/src/main/java/net/onrc/onos/core/topology/web/NetworkGraphDevicesResource.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package net.onrc.onos.core.topology.web;
-
-import java.io.IOException;
-
-import net.onrc.onos.core.topology.INetworkGraphService;
-import net.onrc.onos.core.topology.NetworkGraph;
-import net.onrc.onos.core.topology.serializers.DeviceSerializer;
-
-import org.codehaus.jackson.Version;
-import org.codehaus.jackson.map.ObjectMapper;
-import org.codehaus.jackson.map.module.SimpleModule;
-import org.restlet.resource.Get;
-import org.restlet.resource.ServerResource;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class NetworkGraphDevicesResource extends ServerResource {
-    private static final Logger log = LoggerFactory.getLogger(NetworkGraphDevicesResource.class);
-
-    @Get("json")
-    public String retrieve() {
-        INetworkGraphService networkGraphService = (INetworkGraphService) getContext().getAttributes().
-                get(INetworkGraphService.class.getCanonicalName());
-
-        NetworkGraph graph = networkGraphService.getNetworkGraph();
-
-        ObjectMapper mapper = new ObjectMapper();
-        SimpleModule module = new SimpleModule("module", new Version(1, 0, 0, null));
-        module.addSerializer(new DeviceSerializer());
-        mapper.registerModule(module);
-
-        graph.acquireReadLock();
-        try {
-            return mapper.writeValueAsString(graph.getDevices());
-        } catch (IOException e) {
-            log.error("Error writing device list to JSON", e);
-            return "";
-        } finally {
-            graph.releaseReadLock();
-        }
-    }
-
-}
diff --git a/src/main/java/net/onrc/onos/core/topology/web/NetworkGraphLinksResource.java b/src/main/java/net/onrc/onos/core/topology/web/NetworkGraphLinksResource.java
deleted file mode 100644
index 8d4bc93..0000000
--- a/src/main/java/net/onrc/onos/core/topology/web/NetworkGraphLinksResource.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package net.onrc.onos.core.topology.web;
-
-import java.io.IOException;
-
-import net.onrc.onos.core.topology.INetworkGraphService;
-import net.onrc.onos.core.topology.NetworkGraph;
-import net.onrc.onos.core.topology.serializers.LinkSerializer;
-
-import org.codehaus.jackson.Version;
-import org.codehaus.jackson.map.ObjectMapper;
-import org.codehaus.jackson.map.module.SimpleModule;
-import org.restlet.resource.Get;
-import org.restlet.resource.ServerResource;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class NetworkGraphLinksResource extends ServerResource {
-
-    private static final Logger log = LoggerFactory.getLogger(NetworkGraphLinksResource.class);
-
-    @Get("json")
-    public String retrieve() {
-        INetworkGraphService networkGraphService = (INetworkGraphService) getContext().getAttributes().
-                get(INetworkGraphService.class.getCanonicalName());
-
-        NetworkGraph graph = networkGraphService.getNetworkGraph();
-
-        ObjectMapper mapper = new ObjectMapper();
-        SimpleModule module = new SimpleModule("module", new Version(1, 0, 0, null));
-        module.addSerializer(new LinkSerializer());
-        mapper.registerModule(module);
-
-        try {
-            graph.acquireReadLock();
-            return mapper.writeValueAsString(graph.getLinks());
-        } catch (IOException e) {
-            log.error("Error writing link list to JSON", e);
-            return "";
-        } finally {
-            graph.releaseReadLock();
-        }
-    }
-}
diff --git a/src/main/java/net/onrc/onos/core/topology/web/TopologyDevicesResource.java b/src/main/java/net/onrc/onos/core/topology/web/TopologyDevicesResource.java
new file mode 100644
index 0000000..23f86e8
--- /dev/null
+++ b/src/main/java/net/onrc/onos/core/topology/web/TopologyDevicesResource.java
@@ -0,0 +1,43 @@
+package net.onrc.onos.core.topology.web;
+
+import java.io.IOException;
+
+import net.onrc.onos.core.topology.ITopologyService;
+import net.onrc.onos.core.topology.Topology;
+import net.onrc.onos.core.topology.serializers.DeviceSerializer;
+
+import org.codehaus.jackson.Version;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.codehaus.jackson.map.module.SimpleModule;
+import org.restlet.resource.Get;
+import org.restlet.resource.ServerResource;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class TopologyDevicesResource extends ServerResource {
+    private static final Logger log = LoggerFactory.getLogger(TopologyDevicesResource.class);
+
+    @Get("json")
+    public String retrieve() {
+        ITopologyService topologyService = (ITopologyService) getContext().getAttributes().
+                get(ITopologyService.class.getCanonicalName());
+
+        Topology topology = topologyService.getTopology();
+
+        ObjectMapper mapper = new ObjectMapper();
+        SimpleModule module = new SimpleModule("module", new Version(1, 0, 0, null));
+        module.addSerializer(new DeviceSerializer());
+        mapper.registerModule(module);
+
+        topology.acquireReadLock();
+        try {
+            return mapper.writeValueAsString(topology.getDevices());
+        } catch (IOException e) {
+            log.error("Error writing device list to JSON", e);
+            return "";
+        } finally {
+            topology.releaseReadLock();
+        }
+    }
+
+}
diff --git a/src/main/java/net/onrc/onos/core/topology/web/TopologyLinksResource.java b/src/main/java/net/onrc/onos/core/topology/web/TopologyLinksResource.java
new file mode 100644
index 0000000..b1b6de0
--- /dev/null
+++ b/src/main/java/net/onrc/onos/core/topology/web/TopologyLinksResource.java
@@ -0,0 +1,43 @@
+package net.onrc.onos.core.topology.web;
+
+import java.io.IOException;
+
+import net.onrc.onos.core.topology.ITopologyService;
+import net.onrc.onos.core.topology.Topology;
+import net.onrc.onos.core.topology.serializers.LinkSerializer;
+
+import org.codehaus.jackson.Version;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.codehaus.jackson.map.module.SimpleModule;
+import org.restlet.resource.Get;
+import org.restlet.resource.ServerResource;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class TopologyLinksResource extends ServerResource {
+
+    private static final Logger log = LoggerFactory.getLogger(TopologyLinksResource.class);
+
+    @Get("json")
+    public String retrieve() {
+        ITopologyService topologyService = (ITopologyService) getContext().getAttributes().
+                get(ITopologyService.class.getCanonicalName());
+
+        Topology topology = topologyService.getTopology();
+
+        ObjectMapper mapper = new ObjectMapper();
+        SimpleModule module = new SimpleModule("module", new Version(1, 0, 0, null));
+        module.addSerializer(new LinkSerializer());
+        mapper.registerModule(module);
+
+        try {
+            topology.acquireReadLock();
+            return mapper.writeValueAsString(topology.getLinks());
+        } catch (IOException e) {
+            log.error("Error writing link list to JSON", e);
+            return "";
+        } finally {
+            topology.releaseReadLock();
+        }
+    }
+}
diff --git a/src/main/java/net/onrc/onos/core/topology/web/NetworkGraphShortestPathResource.java b/src/main/java/net/onrc/onos/core/topology/web/TopologyShortestPathResource.java
similarity index 74%
rename from src/main/java/net/onrc/onos/core/topology/web/NetworkGraphShortestPathResource.java
rename to src/main/java/net/onrc/onos/core/topology/web/TopologyShortestPathResource.java
index d513804..29fd716 100644
--- a/src/main/java/net/onrc/onos/core/topology/web/NetworkGraphShortestPathResource.java
+++ b/src/main/java/net/onrc/onos/core/topology/web/TopologyShortestPathResource.java
@@ -6,10 +6,10 @@
 
 import net.onrc.onos.core.intent.ConstrainedBFSTree;
 import net.onrc.onos.core.intent.Path;
-import net.onrc.onos.core.topology.INetworkGraphService;
+import net.onrc.onos.core.topology.ITopologyService;
 import net.onrc.onos.core.topology.Link;
 import net.onrc.onos.core.topology.LinkEvent;
-import net.onrc.onos.core.topology.NetworkGraph;
+import net.onrc.onos.core.topology.Topology;
 import net.onrc.onos.core.topology.Switch;
 import net.onrc.onos.core.topology.serializers.LinkSerializer;
 import net.onrc.onos.core.util.Dpid;
@@ -22,17 +22,17 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class NetworkGraphShortestPathResource extends ServerResource {
+public class TopologyShortestPathResource extends ServerResource {
 
-    private static final Logger log = LoggerFactory.getLogger(NetworkGraphShortestPathResource.class);
+    private static final Logger log = LoggerFactory.getLogger(TopologyShortestPathResource.class);
 
     @Get("json")
     public String retrieve() {
-        INetworkGraphService networkGraphService =
-                (INetworkGraphService) getContext().getAttributes().
-                        get(INetworkGraphService.class.getCanonicalName());
+        ITopologyService topologyService =
+                (ITopologyService) getContext().getAttributes().
+                        get(ITopologyService.class.getCanonicalName());
 
-        NetworkGraph graph = networkGraphService.getNetworkGraph();
+        Topology topology = topologyService.getTopology();
 
         ObjectMapper mapper = new ObjectMapper();
         SimpleModule module = new SimpleModule("module", new Version(1, 0, 0, null));
@@ -53,9 +53,9 @@
         // links.
         //
         try {
-            graph.acquireReadLock();
-            Switch srcSwitch = graph.getSwitch(srcDpid.value());
-            Switch dstSwitch = graph.getSwitch(dstDpid.value());
+            topology.acquireReadLock();
+            Switch srcSwitch = topology.getSwitch(srcDpid.value());
+            Switch dstSwitch = topology.getSwitch(dstDpid.value());
             if ((srcSwitch == null) || (dstSwitch == null)) {
                 return "";
             }
@@ -63,7 +63,7 @@
             Path path = bfsTree.getPath(dstSwitch);
             List<Link> links = new LinkedList<>();
             for (LinkEvent linkEvent : path) {
-                Link link = graph.getLink(linkEvent.getSrc().getDpid(),
+                Link link = topology.getLink(linkEvent.getSrc().getDpid(),
                         linkEvent.getSrc().getNumber(),
                         linkEvent.getDst().getDpid(),
                         linkEvent.getDst().getNumber());
@@ -77,7 +77,7 @@
             log.error("Error writing Shortest Path to JSON", e);
             return "";
         } finally {
-            graph.releaseReadLock();
+            topology.releaseReadLock();
         }
     }
 }
diff --git a/src/main/java/net/onrc/onos/core/topology/web/NetworkGraphSwitchesResource.java b/src/main/java/net/onrc/onos/core/topology/web/TopologySwitchesResource.java
similarity index 60%
rename from src/main/java/net/onrc/onos/core/topology/web/NetworkGraphSwitchesResource.java
rename to src/main/java/net/onrc/onos/core/topology/web/TopologySwitchesResource.java
index 3a053e5..0ac8321 100644
--- a/src/main/java/net/onrc/onos/core/topology/web/NetworkGraphSwitchesResource.java
+++ b/src/main/java/net/onrc/onos/core/topology/web/TopologySwitchesResource.java
@@ -2,8 +2,8 @@
 
 import java.io.IOException;
 
-import net.onrc.onos.core.topology.INetworkGraphService;
-import net.onrc.onos.core.topology.NetworkGraph;
+import net.onrc.onos.core.topology.ITopologyService;
+import net.onrc.onos.core.topology.Topology;
 import net.onrc.onos.core.topology.serializers.PortSerializer;
 import net.onrc.onos.core.topology.serializers.SwitchSerializer;
 
@@ -15,16 +15,16 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class NetworkGraphSwitchesResource extends ServerResource {
+public class TopologySwitchesResource extends ServerResource {
 
-    private static final Logger log = LoggerFactory.getLogger(NetworkGraphSwitchesResource.class);
+    private static final Logger log = LoggerFactory.getLogger(TopologySwitchesResource.class);
 
     @Get("json")
     public String retrieve() {
-        INetworkGraphService networkGraphService = (INetworkGraphService) getContext().getAttributes().
-                get(INetworkGraphService.class.getCanonicalName());
+        ITopologyService topologyService = (ITopologyService) getContext().getAttributes().
+                get(ITopologyService.class.getCanonicalName());
 
-        NetworkGraph graph = networkGraphService.getNetworkGraph();
+        Topology topology = topologyService.getTopology();
 
         ObjectMapper mapper = new ObjectMapper();
         SimpleModule module = new SimpleModule("module", new Version(1, 0, 0, null));
@@ -33,13 +33,13 @@
         mapper.registerModule(module);
 
         try {
-            graph.acquireReadLock();
-            return mapper.writeValueAsString(graph.getSwitches());
+            topology.acquireReadLock();
+            return mapper.writeValueAsString(topology.getSwitches());
         } catch (IOException e) {
             log.error("Error writing switch list to JSON", e);
             return "";
         } finally {
-            graph.releaseReadLock();
+            topology.releaseReadLock();
         }
     }
 }
diff --git a/src/main/java/net/onrc/onos/core/topology/web/NetworkGraphWebRoutable.java b/src/main/java/net/onrc/onos/core/topology/web/TopologyWebRoutable.java
similarity index 72%
rename from src/main/java/net/onrc/onos/core/topology/web/NetworkGraphWebRoutable.java
rename to src/main/java/net/onrc/onos/core/topology/web/TopologyWebRoutable.java
index c0cf272..cef3ac3 100644
--- a/src/main/java/net/onrc/onos/core/topology/web/NetworkGraphWebRoutable.java
+++ b/src/main/java/net/onrc/onos/core/topology/web/TopologyWebRoutable.java
@@ -6,7 +6,7 @@
 import org.restlet.Restlet;
 import org.restlet.routing.Router;
 
-public class NetworkGraphWebRoutable implements RestletRoutable {
+public class TopologyWebRoutable implements RestletRoutable {
 
     @Override
     public Restlet getRestlet(Context context) {
@@ -17,11 +17,11 @@
         router.attach("/ds/ports/json", DatastorePortsResource.class);
 
         // Topology API
-        router.attach("/switches/json", NetworkGraphSwitchesResource.class);
-        router.attach("/links/json", NetworkGraphLinksResource.class);
-        router.attach("/devices/json", NetworkGraphDevicesResource.class);
+        router.attach("/switches/json", TopologySwitchesResource.class);
+        router.attach("/links/json", TopologyLinksResource.class);
+        router.attach("/devices/json", TopologyDevicesResource.class);
         // TODO: Move the Shortest Path REST API to the Intent framework
-        router.attach("/shortest-path/{src-dpid}/{dst-dpid}/json", NetworkGraphShortestPathResource.class);
+        router.attach("/shortest-path/{src-dpid}/{dst-dpid}/json", TopologyShortestPathResource.class);
 
         return router;
     }
diff --git a/src/main/resources/META-INF/services/net.floodlightcontroller.core.module.IFloodlightModule b/src/main/resources/META-INF/services/net.floodlightcontroller.core.module.IFloodlightModule
index 3365c59..190c425 100644
--- a/src/main/resources/META-INF/services/net.floodlightcontroller.core.module.IFloodlightModule
+++ b/src/main/resources/META-INF/services/net.floodlightcontroller.core.module.IFloodlightModule
@@ -1,5 +1,5 @@
 net.floodlightcontroller.core.FloodlightProvider
-net.onrc.onos.core.topology.NetworkGraphPublisher
+net.onrc.onos.core.topology.TopologyPublisher
 net.onrc.onos.core.linkdiscovery.internal.LinkDiscoveryManager
 net.floodlightcontroller.topology.TopologyManager
 net.floodlightcontroller.forwarding.Forwarding
@@ -18,7 +18,7 @@
 net.onrc.onos.apps.proxyarp.ProxyArpManager
 net.onrc.onos.core.main.config.DefaultConfiguration
 net.onrc.onos.core.devicemanager.OnosDeviceManager
-net.onrc.onos.core.topology.NetworkGraphModule
+net.onrc.onos.core.topology.TopologyModule
 net.onrc.onos.core.intent.runtime.PathCalcRuntimeModule
 net.onrc.onos.core.intent.runtime.PlanInstallModule
 net.onrc.onos.core.packetservice.PacketModule
diff --git a/src/test/java/net/onrc/onos/apps/proxyarp/ProxyArpManagerTest.java b/src/test/java/net/onrc/onos/apps/proxyarp/ProxyArpManagerTest.java
index 13385f4..7453a68 100644
--- a/src/test/java/net/onrc/onos/apps/proxyarp/ProxyArpManagerTest.java
+++ b/src/test/java/net/onrc/onos/apps/proxyarp/ProxyArpManagerTest.java
@@ -29,8 +29,8 @@
 import net.onrc.onos.core.packet.IPv4;
 import net.onrc.onos.core.packetservice.SinglePacketOutNotification;
 import net.onrc.onos.core.topology.Device;
-import net.onrc.onos.core.topology.INetworkGraphService;
-import net.onrc.onos.core.topology.NetworkGraph;
+import net.onrc.onos.core.topology.ITopologyService;
+import net.onrc.onos.core.topology.Topology;
 import net.onrc.onos.core.topology.Port;
 import net.onrc.onos.core.topology.Switch;
 
@@ -56,7 +56,7 @@
     IRestApiService restApiService;
     IDatagridService datagridService;
     IFlowPusherService flowPusherService;
-    INetworkGraphService networkGraphService;
+    ITopologyService topologyService;
     IOnosDeviceService onosDeviceService;
     IPacketService packetService;
     Map<String, String> config;
@@ -71,7 +71,7 @@
     ARP arpRequest, arpReply, rarpRequest;
     Ethernet ethArpRequest, ethArpReply, ethRarpRequest, ethArpOtherOp;
 
-    NetworkGraph ng;
+    Topology topology;
     IEventChannel eg;
     IEventChannelListener el;
     Device dev1;
@@ -212,14 +212,14 @@
         restApiService = EasyMock.createMock(IRestApiService.class);
         datagridService = EasyMock.createMock(IDatagridService.class);
         flowPusherService = EasyMock.createMock(IFlowPusherService.class);
-        networkGraphService = EasyMock.createMock(INetworkGraphService.class);
+        topologyService = EasyMock.createMock(ITopologyService.class);
         onosDeviceService = EasyMock.createMock(IOnosDeviceService.class);
         packetService = EasyMock.createMock(IPacketService.class);
         eg = EasyMock.createMock(IEventChannel.class);
         el = EasyMock.createMock(IEventChannelListener.class);
 
-        //Mock NetworkGraph related data
-        ng = EasyMock.createMock(NetworkGraph.class);
+        //Mock Topology related data
+        topology = EasyMock.createMock(Topology.class);
         dev1 = EasyMock.createMock(Device.class);
         inPort1 = EasyMock.createMock(Port.class);
         outPort1 = EasyMock.createMock(Port.class);
@@ -241,7 +241,7 @@
         EasyMock.expect(context.getServiceImpl(IRestApiService.class)).andReturn(restApiService);
         EasyMock.expect(context.getServiceImpl(IDatagridService.class)).andReturn(datagridService);
         EasyMock.expect(context.getServiceImpl(IFlowPusherService.class)).andReturn(flowPusherService);
-        EasyMock.expect(context.getServiceImpl(INetworkGraphService.class)).andReturn(networkGraphService);
+        EasyMock.expect(context.getServiceImpl(ITopologyService.class)).andReturn(topologyService);
         EasyMock.expect(context.getServiceImpl(IOnosDeviceService.class)).andReturn(onosDeviceService);
         EasyMock.expect(context.getServiceImpl(IPacketService.class)).andReturn(packetService);
     }
@@ -258,7 +258,7 @@
         EasyMock.expectLastCall();
         packetService.registerPacketListener(arpManager);
         EasyMock.expectLastCall();
-        EasyMock.expect(networkGraphService.getNetworkGraph()).andReturn(ng);
+        EasyMock.expect(topologyService.getTopology()).andReturn(topology);
         EasyMock.expect(datagridService.addListener((String)EasyMock.anyObject(), EasyMock.isA(IEventChannelListener.class),
                 (Class)EasyMock.anyObject(), (Class)EasyMock.anyObject())).andReturn(eg).anyTimes();
         List<ArpCacheNotification> list = new ArrayList<ArpCacheNotification>();
@@ -281,7 +281,7 @@
         EasyMock.expect(context.getConfigParams(arpManager)).andReturn(config);
 
         EasyMock.replay(context, floodligthProviderService, configInfoService, restApiService, datagridService, flowPusherService,
-                networkGraphService, onosDeviceService, packetService, ng, eg, el, dev1, inPort1, sw1);
+                topologyService, onosDeviceService, packetService, topology, eg, el, dev1, inPort1, sw1);
         arpManager.init(context);
         arpManager.startUp(context);
         assertEquals(defaultStrAgingMsec, String.valueOf(arpManager.getArpEntryTimeout()));
@@ -298,7 +298,7 @@
         EasyMock.expect(context.getConfigParams(arpManager)).andReturn(config);
 
         EasyMock.replay(context, floodligthProviderService, configInfoService, restApiService, datagridService, flowPusherService,
-                networkGraphService, onosDeviceService, packetService, ng, eg, el, dev1, inPort1, sw1);
+                topologyService, onosDeviceService, packetService, topology, eg, el, dev1, inPort1, sw1);
         arpManager.init(context);
         arpManager.startUp(context);
         assertEquals(defaultStrAgingMsec, String.valueOf(arpManager.getArpEntryTimeout()));
@@ -314,7 +314,7 @@
         EasyMock.expect(context.getConfigParams(arpManager)).andReturn(config);
 
         EasyMock.replay(context, floodligthProviderService, configInfoService, restApiService, datagridService, flowPusherService,
-                networkGraphService, onosDeviceService, packetService, ng, eg, el, dev1, inPort1, sw1);
+                topologyService, onosDeviceService, packetService, topology, eg, el, dev1, inPort1, sw1);
         arpManager.init(context);
         arpManager.startUp(context);
         assertEquals(strAgingMsec, String.valueOf(arpManager.getArpEntryTimeout()));
@@ -327,7 +327,7 @@
         EasyMock.expect(context.getConfigParams(arpManager)).andReturn(config);
 
         EasyMock.replay(context, floodligthProviderService, configInfoService, restApiService, datagridService, flowPusherService,
-                networkGraphService, onosDeviceService, packetService, ng, eg, el, dev1, inPort1, sw1);
+                topologyService, onosDeviceService, packetService, topology, eg, el, dev1, inPort1, sw1);
         arpManager.init(context);
         arpManager.startUp(context);
         MACAddress mac = arpManager.getMacAddress(cachedIp1);
@@ -340,7 +340,7 @@
         EasyMock.expect(context.getConfigParams(arpManager)).andReturn(config);
 
         EasyMock.replay(context, floodligthProviderService, configInfoService, restApiService, datagridService, flowPusherService,
-                networkGraphService, onosDeviceService, packetService, ng, eg, el, dev1, inPort1, sw1);
+                topologyService, onosDeviceService, packetService, topology, eg, el, dev1, inPort1, sw1);
         arpManager.init(context);
         arpManager.startUp(context);
         List<String> list = arpManager.getMappings();
@@ -355,7 +355,7 @@
         EasyMock.expect(context.getConfigParams(arpManager)).andReturn(config);
 
         EasyMock.replay(context, floodligthProviderService, configInfoService, restApiService, datagridService, flowPusherService,
-                networkGraphService, onosDeviceService, packetService, ng, eg, el, dev1, inPort1, sw1);
+                topologyService, onosDeviceService, packetService, topology, eg, el, dev1, inPort1, sw1);
         arpManager.init(context);
         arpManager.startUp(context);
         arpManager.receive(sw1, inPort1, ethRarpRequest);
@@ -369,7 +369,7 @@
         prepareExpectForLearnArp();
 
         EasyMock.replay(context, floodligthProviderService, configInfoService, restApiService, datagridService, flowPusherService,
-                networkGraphService, onosDeviceService, packetService, ng, eg, el, dev1, inPort1, sw1);
+                topologyService, onosDeviceService, packetService, topology, eg, el, dev1, inPort1, sw1);
         arpManager.init(context);
         arpManager.startUp(context);
         arpManager.receive(sw1, inPort1, ethArpOtherOp);
@@ -389,7 +389,7 @@
         EasyMock.expect(context.getServiceImpl(IDatagridService.class)).andReturn(datagridService);
 
         EasyMock.replay(context, floodligthProviderService, configInfoService, restApiService, datagridService, flowPusherService,
-                networkGraphService, onosDeviceService, packetService, ng, eg, el, dev1, inPort1, sw1);
+                topologyService, onosDeviceService, packetService, topology, eg, el, dev1, inPort1, sw1);
         arpManager.init(context);
         arpManager.startUp(context);
         arpManager.receive(sw1, inPort1, ethArpReply);
@@ -406,7 +406,7 @@
         EasyMock.expect(configInfoService.isInterfaceAddress(dstIp)).andReturn(false);
 
         EasyMock.replay(context, floodligthProviderService, configInfoService, restApiService, datagridService, flowPusherService,
-                networkGraphService, onosDeviceService, packetService, ng, eg, el, dev1, inPort1, sw1);
+                topologyService, onosDeviceService, packetService, topology, eg, el, dev1, inPort1, sw1);
         arpManager.init(context);
         arpManager.startUp(context);
         arpManager.receive(sw1, inPort1, ethArpRequest);
@@ -423,17 +423,17 @@
         prepareExpectForLearnArp();
 
         EasyMock.expect(configInfoService.fromExternalNetwork(EasyMock.anyLong(), EasyMock.anyShort())).andReturn(false);
-        ng.acquireReadLock();
+        topology.acquireReadLock();
         EasyMock.expectLastCall();
-        EasyMock.expect(ng.getDeviceByMac(dstMac)).andReturn(dev1);
-        ng.releaseReadLock();
+        EasyMock.expect(topology.getDeviceByMac(dstMac)).andReturn(dev1);
+        topology.releaseReadLock();
         EasyMock.expectLastCall();
         EasyMock.expect(dev1.getAttachmentPoints()).andReturn(portList);
         eg.addTransientEntry(EasyMock.anyLong(), (SinglePacketOutNotification)EasyMock.anyObject());
         EasyMock.expectLastCall();
 
         EasyMock.replay(context, configInfoService, restApiService, floodligthProviderService,
-                networkGraphService, datagridService, eg, ng, dev1, inPort1, outPort1, sw1);
+                topologyService, datagridService, eg, topology, dev1, inPort1, outPort1, sw1);
         arpManager.init(context);
         arpManager.startUp(context);
         arpManager.receive(sw1, inPort1, ethArpRequest);
diff --git a/src/test/java/net/onrc/onos/core/intent/ConstrainedBFSTreeTest.java b/src/test/java/net/onrc/onos/core/intent/ConstrainedBFSTreeTest.java
index a99fc10..8d5a6d6 100644
--- a/src/test/java/net/onrc/onos/core/intent/ConstrainedBFSTreeTest.java
+++ b/src/test/java/net/onrc/onos/core/intent/ConstrainedBFSTreeTest.java
@@ -26,81 +26,81 @@
 
     @Test
     public void testCreate() {
-        MockNetworkGraph graph = new MockNetworkGraph();
-        graph.createSampleTopology1();
-        ConstrainedBFSTree tree = new ConstrainedBFSTree(graph.getSwitch(1L));
+        MockTopology topology = new MockTopology();
+        topology.createSampleTopology1();
+        ConstrainedBFSTree tree = new ConstrainedBFSTree(topology.getSwitch(1L));
         assertNotNull(tree);
     }
 
     @Test
     public void testCreateConstrained() {
-        MockNetworkGraph graph = new MockNetworkGraph();
-        graph.createSampleTopology1();
+        MockTopology topology = new MockTopology();
+        topology.createSampleTopology1();
         PathIntentMap intents = new PathIntentMap();
-        ConstrainedBFSTree tree = new ConstrainedBFSTree(graph.getSwitch(1L), intents, 1000.0);
+        ConstrainedBFSTree tree = new ConstrainedBFSTree(topology.getSwitch(1L), intents, 1000.0);
         assertNotNull(tree);
     }
 
     @Test
     public void testGetPath() {
-        MockNetworkGraph graph = new MockNetworkGraph();
-        graph.createSampleTopology1();
-        ConstrainedBFSTree tree = new ConstrainedBFSTree(graph.getSwitch(1L));
-        Path path11 = tree.getPath(graph.getSwitch(1L));
-        Path path12 = tree.getPath(graph.getSwitch(2L));
-        Path path13 = tree.getPath(graph.getSwitch(3L));
-        Path path14 = tree.getPath(graph.getSwitch(4L));
+        MockTopology topology = new MockTopology();
+        topology.createSampleTopology1();
+        ConstrainedBFSTree tree = new ConstrainedBFSTree(topology.getSwitch(1L));
+        Path path11 = tree.getPath(topology.getSwitch(1L));
+        Path path12 = tree.getPath(topology.getSwitch(2L));
+        Path path13 = tree.getPath(topology.getSwitch(3L));
+        Path path14 = tree.getPath(topology.getSwitch(4L));
 
         assertNotNull(path11);
         assertEquals(0, path11.size());
 
         assertNotNull(path12);
         assertEquals(1, path12.size());
-        assertEquals(new LinkEvent(graph.getOutgoingLink(1L, 12L)), path12.get(0));
+        assertEquals(new LinkEvent(topology.getOutgoingLink(1L, 12L)), path12.get(0));
 
         assertNotNull(path13);
         assertEquals(2, path13.size());
         if (path13.get(0).getDst().getDpid() == 2L) {
-            assertEquals(new LinkEvent(graph.getOutgoingLink(1L, 12L)), path13.get(0));
-            assertEquals(new LinkEvent(graph.getOutgoingLink(2L, 23L)), path13.get(1));
+            assertEquals(new LinkEvent(topology.getOutgoingLink(1L, 12L)), path13.get(0));
+            assertEquals(new LinkEvent(topology.getOutgoingLink(2L, 23L)), path13.get(1));
         } else {
-            assertEquals(new LinkEvent(graph.getOutgoingLink(1L, 14L)), path13.get(0));
-            assertEquals(new LinkEvent(graph.getOutgoingLink(4L, 43L)), path13.get(1));
+            assertEquals(new LinkEvent(topology.getOutgoingLink(1L, 14L)), path13.get(0));
+            assertEquals(new LinkEvent(topology.getOutgoingLink(4L, 43L)), path13.get(1));
         }
 
         assertNotNull(path14);
         assertEquals(1, path14.size());
-        assertEquals(new LinkEvent(graph.getOutgoingLink(1L, 14L)), path14.get(0));
+        assertEquals(new LinkEvent(topology.getOutgoingLink(1L, 14L)), path14.get(0));
     }
 
     @Test
     public void testGetPathNull() {
-        MockNetworkGraph graph = new MockNetworkGraph();
-        graph.createSampleTopology1();
-        graph.removeLink(1L, 12L, 2L, 21L);
-        graph.removeLink(1L, 14L, 4L, 41L);
+        MockTopology topology = new MockTopology();
+        topology.createSampleTopology1();
+        topology.removeLink(1L, 12L, 2L, 21L);
+        topology.removeLink(1L, 14L, 4L, 41L);
         // now, there is no path from switch 1, but to switch1
 
-        ConstrainedBFSTree tree1 = new ConstrainedBFSTree(graph.getSwitch(1L));
-        Path path12 = tree1.getPath(graph.getSwitch(2L));
-        Path path13 = tree1.getPath(graph.getSwitch(3L));
-        Path path14 = tree1.getPath(graph.getSwitch(4L));
+        ConstrainedBFSTree tree1 = new ConstrainedBFSTree(topology.getSwitch(1L));
+        Path path12 = tree1.getPath(topology.getSwitch(2L));
+        Path path13 = tree1.getPath(topology.getSwitch(3L));
+        Path path14 = tree1.getPath(topology.getSwitch(4L));
 
-        ConstrainedBFSTree tree2 = new ConstrainedBFSTree(graph.getSwitch(2L));
-        Path path21 = tree2.getPath(graph.getSwitch(1L));
+        ConstrainedBFSTree tree2 = new ConstrainedBFSTree(topology.getSwitch(2L));
+        Path path21 = tree2.getPath(topology.getSwitch(1L));
 
         assertNull(path12);
         assertNull(path13);
         assertNull(path14);
         assertNotNull(path21);
         assertEquals(1, path21.size());
-        assertEquals(new LinkEvent(graph.getOutgoingLink(2L, 21L)), path21.get(0));
+        assertEquals(new LinkEvent(topology.getOutgoingLink(2L, 21L)), path21.get(0));
     }
 
     @Test
     public void testGetConstrainedPath() {
-        MockNetworkGraph graph = new MockNetworkGraph();
-        graph.createSampleTopology1();
+        MockTopology topology = new MockTopology();
+        topology.createSampleTopology1();
         PathIntentMap intents = new PathIntentMap();
         IntentOperationList intentOps = new IntentOperationList();
 
@@ -111,33 +111,33 @@
                 "2", 1L, LOCAL_PORT, 0x333L, 2L, LOCAL_PORT, 0x444L, 600.0);
 
         // calculate path of the intent1
-        ConstrainedBFSTree tree = new ConstrainedBFSTree(graph.getSwitch(1L), intents, 600.0);
-        Path path1 = tree.getPath(graph.getSwitch(2L));
+        ConstrainedBFSTree tree = new ConstrainedBFSTree(topology.getSwitch(1L), intents, 600.0);
+        Path path1 = tree.getPath(topology.getSwitch(2L));
 
         assertNotNull(path1);
         assertEquals(1, path1.size());
-        assertEquals(new LinkEvent(graph.getOutgoingLink(1L, 12L)), path1.get(0));
+        assertEquals(new LinkEvent(topology.getOutgoingLink(1L, 12L)), path1.get(0));
 
         PathIntent pathIntent1 = new PathIntent("pi1", path1, 600.0, intent1);
         intentOps.add(Operator.ADD, pathIntent1);
         intents.executeOperations(intentOps);
 
         // calculate path of the intent2
-        tree = new ConstrainedBFSTree(graph.getSwitch(1L), intents, 600.0);
-        Path path2 = tree.getPath(graph.getSwitch(2L));
+        tree = new ConstrainedBFSTree(topology.getSwitch(1L), intents, 600.0);
+        Path path2 = tree.getPath(topology.getSwitch(2L));
 
         assertNotNull(path2);
         assertEquals(2, path2.size());
-        assertEquals(new LinkEvent(graph.getOutgoingLink(1L, 14L)), path2.get(0));
-        assertEquals(new LinkEvent(graph.getOutgoingLink(4L, 42L)), path2.get(1));
+        assertEquals(new LinkEvent(topology.getOutgoingLink(1L, 14L)), path2.get(0));
+        assertEquals(new LinkEvent(topology.getOutgoingLink(4L, 42L)), path2.get(1));
 
         PathIntent pathIntent2 = new PathIntent("pi2", path2, 600.0, intent2);
         intentOps.add(Operator.ADD, pathIntent2);
         intents.executeOperations(intentOps);
 
         // calculate path of the intent3
-        tree = new ConstrainedBFSTree(graph.getSwitch(1L), intents, 600.0);
-        Path path3 = tree.getPath(graph.getSwitch(2L));
+        tree = new ConstrainedBFSTree(topology.getSwitch(1L), intents, 600.0);
+        Path path3 = tree.getPath(topology.getSwitch(2L));
 
         assertNull(path3);
     }
diff --git a/src/test/java/net/onrc/onos/core/intent/MockNetworkGraph.java b/src/test/java/net/onrc/onos/core/intent/MockTopology.java
similarity index 84%
rename from src/test/java/net/onrc/onos/core/intent/MockNetworkGraph.java
rename to src/test/java/net/onrc/onos/core/intent/MockTopology.java
index d481182..680acc2 100644
--- a/src/test/java/net/onrc/onos/core/intent/MockNetworkGraph.java
+++ b/src/test/java/net/onrc/onos/core/intent/MockTopology.java
@@ -2,22 +2,22 @@
 
 import net.onrc.onos.core.topology.Link;
 import net.onrc.onos.core.topology.LinkImpl;
-import net.onrc.onos.core.topology.NetworkGraphImpl;
 import net.onrc.onos.core.topology.Switch;
 import net.onrc.onos.core.topology.SwitchImpl;
+import net.onrc.onos.core.topology.TopologyImpl;
 
 /**
- * A mock class of NetworkGraph.
+ * A mock class of Topology.
  * This class should be used only by test codes.
  *
  * @author Toshio Koide (t-koide@onlab.us)
  */
-public class MockNetworkGraph extends NetworkGraphImpl {
-    // TODO this class doesn't seem like it should extend NetworkGraphImpl. It
-    // isn't a NetworkGraph, it's more of a NetworkGraphBuilder - methods to
-    // create an populate a fake network graph that's not based on discovery
+public class MockTopology extends TopologyImpl {
+    // TODO this class doesn't seem like it should extend TopologyImpl. It
+    // isn't a Topology, it's more of a TopologyBuilder - methods to
+    // create an populate a fake topology that's not based on discovery
     // data from the driver modules.
-    // We may well need a MockNetworkGraph, but that's not what this class is
+    // We may well need a MockTopology, but that's not what this class is
     // doing.
 
     public static Long LOCAL_PORT = 0xFFFEL;
diff --git a/src/test/java/net/onrc/onos/core/intent/runtime/PathCalcRuntimeModuleTest.java b/src/test/java/net/onrc/onos/core/intent/runtime/PathCalcRuntimeModuleTest.java
index 5e1a11d..2d57cfe 100644
--- a/src/test/java/net/onrc/onos/core/intent/runtime/PathCalcRuntimeModuleTest.java
+++ b/src/test/java/net/onrc/onos/core/intent/runtime/PathCalcRuntimeModuleTest.java
@@ -20,7 +20,6 @@
 import net.floodlightcontroller.core.module.FloodlightModuleContext;
 import net.floodlightcontroller.core.module.FloodlightModuleException;
 import net.floodlightcontroller.restserver.IRestApiService;
-
 import net.onrc.onos.core.datagrid.IDatagridService;
 import net.onrc.onos.core.datagrid.IEventChannel;
 import net.onrc.onos.core.datagrid.IEventChannelListener;
@@ -29,13 +28,13 @@
 import net.onrc.onos.core.intent.IntentMap;
 import net.onrc.onos.core.intent.IntentOperation.Operator;
 import net.onrc.onos.core.intent.IntentOperationList;
-import net.onrc.onos.core.intent.MockNetworkGraph;
+import net.onrc.onos.core.intent.MockTopology;
 import net.onrc.onos.core.intent.ShortestPathIntent;
 import net.onrc.onos.core.intent.runtime.web.IntentWebRoutable;
 import net.onrc.onos.core.registry.IControllerRegistryService;
 import net.onrc.onos.core.topology.DeviceEvent;
-import net.onrc.onos.core.topology.INetworkGraphListener;
-import net.onrc.onos.core.topology.INetworkGraphService;
+import net.onrc.onos.core.topology.ITopologyListener;
+import net.onrc.onos.core.topology.ITopologyService;
 import net.onrc.onos.core.topology.LinkEvent;
 import net.onrc.onos.core.topology.PortEvent;
 import net.onrc.onos.core.topology.SwitchEvent;
@@ -58,7 +57,7 @@
  *         <p/>
  *         Unit tests for the Path Calculation Runtime module (PathCalcRuntimeModule).
  *         These test cases check the results of creating paths, deleting paths, and
- *         rerouting paths.  The network graph, controller registry, and data grid are
+ *         rerouting paths.  The topology, controller registry, and data grid are
  *         mocked out.  The individual tests check the high level intents and the
  *         resulting operation lists to be sure they match the intended APIs.
  */
@@ -69,22 +68,22 @@
 
     private FloodlightModuleContext modContext;
     private IDatagridService datagridService;
-    private INetworkGraphService networkGraphService;
+    private ITopologyService topologyService;
     private IControllerRegistryService controllerRegistryService;
     private PersistIntent persistIntent;
     private IRestApiService restApi;
-    private MockNetworkGraph graph;
+    private MockTopology topology;
     private IEventChannel<Long, IntentOperationList> intentOperationChannel;
     private IEventChannel<Long, IntentStateList> intentStateChannel;
 
     @SuppressWarnings("unchecked")
     @Before
     public void setUp() throws Exception {
-        graph = new MockNetworkGraph();
-        graph.createSampleTopology1();
+        topology = new MockTopology();
+        topology.createSampleTopology1();
 
         datagridService = createMock(IDatagridService.class);
-        networkGraphService = createMock(INetworkGraphService.class);
+        topologyService = createMock(ITopologyService.class);
         controllerRegistryService = createMock(IControllerRegistryService.class);
         modContext = createMock(FloodlightModuleContext.class);
         intentOperationChannel = createMock(IEventChannel.class);
@@ -97,8 +96,8 @@
 
         expect(modContext.getServiceImpl(IDatagridService.class))
                 .andReturn(datagridService).once();
-        expect(modContext.getServiceImpl(INetworkGraphService.class))
-                .andReturn(networkGraphService).once();
+        expect(modContext.getServiceImpl(ITopologyService.class))
+                .andReturn(topologyService).once();
         expect(modContext.getServiceImpl(IControllerRegistryService.class))
                 .andReturn(controllerRegistryService).once();
         expect(persistIntent.getKey()).andReturn(1L).anyTimes();
@@ -108,10 +107,10 @@
         expect(modContext.getServiceImpl(IRestApiService.class))
                 .andReturn(restApi).once();
 
-        expect(networkGraphService.getNetworkGraph()).andReturn(graph)
+        expect(topologyService.getTopology()).andReturn(topology)
                 .anyTimes();
-        networkGraphService.registerNetworkGraphListener(
-                anyObject(INetworkGraphListener.class));
+        topologyService.registerTopologyListener(
+                anyObject(ITopologyListener.class));
         expectLastCall();
 
         expect(datagridService.createChannel("onos.pathintent",
@@ -127,7 +126,7 @@
         restApi.addRestletRoutable(anyObject(IntentWebRoutable.class));
 
         replay(datagridService);
-        replay(networkGraphService);
+        replay(topologyService);
         replay(modContext);
         replay(controllerRegistryService);
         PowerMock.replay(persistIntent, PersistIntent.class);
@@ -240,7 +239,7 @@
     @After
     public void tearDown() {
         verify(datagridService);
-        verify(networkGraphService);
+        verify(topologyService);
         verify(modContext);
         verify(controllerRegistryService);
         PowerMock.verify(persistIntent, PersistIntent.class);
@@ -494,13 +493,13 @@
         final List<LinkEvent> addedLinkEvents = new LinkedList<>();
         final List<LinkEvent> removedLinkEvents = new LinkedList<>();
 
-        graph.removeLink(1L, 12L, 2L, 21L); // This link is used by the intent "1"
-        graph.removeLink(2L, 21L, 1L, 12L);
+        topology.removeLink(1L, 12L, 2L, 21L); // This link is used by the intent "1"
+        topology.removeLink(2L, 21L, 1L, 12L);
         LinkEvent linkEvent1 = new LinkEvent(1L, 12L, 2L, 21L);
         LinkEvent linkEvent2 = new LinkEvent(2L, 21L, 1L, 12L);
         removedLinkEvents.add(linkEvent1);
         removedLinkEvents.add(linkEvent2);
-        runtime.networkGraphEvents(
+        runtime.topologyEvents(
                 emptySwitchEvents,
                 emptySwitchEvents,
                 emptyPortEvents,
diff --git a/src/test/java/net/onrc/onos/core/intent/runtime/UseCaseTest.java b/src/test/java/net/onrc/onos/core/intent/runtime/UseCaseTest.java
index f3c9aaa..8cacabc 100644
--- a/src/test/java/net/onrc/onos/core/intent/runtime/UseCaseTest.java
+++ b/src/test/java/net/onrc/onos/core/intent/runtime/UseCaseTest.java
@@ -25,19 +25,19 @@
 import net.onrc.onos.core.intent.Intent.IntentState;
 import net.onrc.onos.core.intent.IntentOperation.Operator;
 import net.onrc.onos.core.intent.IntentOperationList;
-import net.onrc.onos.core.intent.MockNetworkGraph;
+import net.onrc.onos.core.intent.MockTopology;
 import net.onrc.onos.core.intent.PathIntent;
 import net.onrc.onos.core.intent.PathIntentMap;
 import net.onrc.onos.core.intent.ShortestPathIntent;
 import net.onrc.onos.core.intent.runtime.web.IntentWebRoutable;
 import net.onrc.onos.core.registry.IControllerRegistryService;
 import net.onrc.onos.core.topology.DeviceEvent;
-import net.onrc.onos.core.topology.INetworkGraphListener;
-import net.onrc.onos.core.topology.INetworkGraphService;
+import net.onrc.onos.core.topology.ITopologyListener;
+import net.onrc.onos.core.topology.ITopologyService;
 import net.onrc.onos.core.topology.LinkEvent;
-import net.onrc.onos.core.topology.NetworkGraph;
 import net.onrc.onos.core.topology.PortEvent;
 import net.onrc.onos.core.topology.SwitchEvent;
+import net.onrc.onos.core.topology.Topology;
 
 import org.junit.After;
 import org.junit.Before;
@@ -57,10 +57,10 @@
 @RunWith(PowerMockRunner.class)
 @PrepareForTest(PathCalcRuntimeModule.class)
 public class UseCaseTest {
-    private NetworkGraph g;
+    private Topology topology;
     private FloodlightModuleContext modContext;
     private IDatagridService datagridService;
-    private INetworkGraphService networkGraphService;
+    private ITopologyService topologyService;
     private IControllerRegistryService controllerRegistryService;
     private PersistIntent persistIntent;
     private IRestApiService restApi;
@@ -72,12 +72,12 @@
     @SuppressWarnings("unchecked")
     @Before
     public void setUp() throws Exception {
-        MockNetworkGraph graph = new MockNetworkGraph();
-        graph.createSampleTopology1();
-        g = graph;
+        MockTopology topology = new MockTopology();
+        topology.createSampleTopology1();
+        this.topology = topology;
 
         datagridService = createMock(IDatagridService.class);
-        networkGraphService = createMock(INetworkGraphService.class);
+        topologyService = createMock(ITopologyService.class);
         controllerRegistryService = createMock(IControllerRegistryService.class);
         modContext = createMock(FloodlightModuleContext.class);
         intentOperationChannel = createMock(IEventChannel.class);
@@ -90,8 +90,8 @@
 
         expect(modContext.getServiceImpl(IDatagridService.class))
                 .andReturn(datagridService).once();
-        expect(modContext.getServiceImpl(INetworkGraphService.class))
-                .andReturn(networkGraphService).once();
+        expect(modContext.getServiceImpl(ITopologyService.class))
+                .andReturn(topologyService).once();
         expect(modContext.getServiceImpl(IControllerRegistryService.class))
                 .andReturn(controllerRegistryService).once();
         expect(persistIntent.getKey()).andReturn(1L).anyTimes();
@@ -100,8 +100,8 @@
         expect(modContext.getServiceImpl(IRestApiService.class))
                 .andReturn(restApi).once();
 
-        expect(networkGraphService.getNetworkGraph()).andReturn(g).anyTimes();
-        networkGraphService.registerNetworkGraphListener(anyObject(INetworkGraphListener.class));
+        expect(topologyService.getTopology()).andReturn(topology).anyTimes();
+        topologyService.registerTopologyListener(anyObject(ITopologyListener.class));
         expectLastCall();
 
         expect(datagridService.createChannel("onos.pathintent", Long.class, IntentOperationList.class))
@@ -116,7 +116,7 @@
         restApi.addRestletRoutable(anyObject(IntentWebRoutable.class));
 
         replay(datagridService);
-        replay(networkGraphService);
+        replay(topologyService);
         replay(modContext);
         replay(controllerRegistryService);
         PowerMock.replay(persistIntent, PersistIntent.class);
@@ -126,7 +126,7 @@
     @After
     public void tearDown() {
         verify(datagridService);
-        verify(networkGraphService);
+        verify(topologyService);
         verify(modContext);
         verify(controllerRegistryService);
         PowerMock.verify(persistIntent, PersistIntent.class);
@@ -258,14 +258,14 @@
         runtime1.getPathIntents().changeStates(states);
 
         // link down
-        ((MockNetworkGraph) g).removeLink(1L, 12L, 2L, 21L); // This link is used by the intent "1"
-        ((MockNetworkGraph) g).removeLink(2L, 21L, 1L, 12L);
+        ((MockTopology) topology).removeLink(1L, 12L, 2L, 21L); // This link is used by the intent "1"
+        ((MockTopology) topology).removeLink(2L, 21L, 1L, 12L);
         LinkEvent linkEvent1 = new LinkEvent(1L, 12L, 2L, 21L);
         LinkEvent linkEvent2 = new LinkEvent(2L, 21L, 1L, 12L);
         removedLinkEvents.clear();
         removedLinkEvents.add(linkEvent1);
         removedLinkEvents.add(linkEvent2);
-        runtime1.networkGraphEvents(
+        runtime1.topologyEvents(
                 addedSwitchEvents,
                 removedSwitchEvents,
                 addedPortEvents,
