diff --git a/src/main/java/org/onosproject/segmentrouting/DefaultRoutingHandler.java b/src/main/java/org/onosproject/segmentrouting/DefaultRoutingHandler.java
index e645165..b3e432c 100644
--- a/src/main/java/org/onosproject/segmentrouting/DefaultRoutingHandler.java
+++ b/src/main/java/org/onosproject/segmentrouting/DefaultRoutingHandler.java
@@ -44,8 +44,8 @@
 
     private SegmentRoutingManager srManager;
     private RoutingRulePopulator rulePopulator;
-    private HashMap<DeviceId, ECMPShortestPathGraph> currentEcmpSpgMap;
-    private HashMap<DeviceId, ECMPShortestPathGraph> updatedEcmpSpgMap;
+    private HashMap<DeviceId, EcmpShortestPathGraph> currentEcmpSpgMap;
+    private HashMap<DeviceId, EcmpShortestPathGraph> updatedEcmpSpgMap;
     private DeviceConfiguration config;
     private final Lock statusLock = new ReentrantLock();
     private volatile Status populationStatus;
@@ -103,7 +103,7 @@
                     continue;
                 }
 
-                ECMPShortestPathGraph ecmpSpg = new ECMPShortestPathGraph(sw.id(), srManager);
+                EcmpShortestPathGraph ecmpSpg = new EcmpShortestPathGraph(sw.id(), srManager);
                 if (!populateEcmpRoutingRules(sw.id(), ecmpSpg)) {
                     log.debug("populateAllRoutingRules: populationStatus is ABORTED");
                     populationStatus = Status.ABORTED;
@@ -149,8 +149,8 @@
                 if (!srManager.mastershipService.isLocalMaster(sw.id())) {
                     continue;
                 }
-                ECMPShortestPathGraph ecmpSpgUpdated =
-                        new ECMPShortestPathGraph(sw.id(), srManager);
+                EcmpShortestPathGraph ecmpSpgUpdated =
+                        new EcmpShortestPathGraph(sw.id(), srManager);
                 updatedEcmpSpgMap.put(sw.id(), ecmpSpgUpdated);
             }
 
@@ -200,7 +200,7 @@
             // When only the source device is defined, reinstall routes to all other devices
             if (link.size() == 1) {
                 log.trace("repopulateRoutingRulesForRoutes: running ECMP graph for device {}", link.get(0));
-                ECMPShortestPathGraph ecmpSpg = new ECMPShortestPathGraph(link.get(0), srManager);
+                EcmpShortestPathGraph ecmpSpg = new EcmpShortestPathGraph(link.get(0), srManager);
                 if (populateEcmpRoutingRules(link.get(0), ecmpSpg)) {
                     log.debug("Populating flow rules from {} to all is successful",
                               link.get(0));
@@ -228,7 +228,7 @@
                           link.get(0), link.get(1));
                 DeviceId src = link.get(0);
                 DeviceId dst = link.get(1);
-                ECMPShortestPathGraph ecmpSpg = updatedEcmpSpgMap.get(dst);
+                EcmpShortestPathGraph ecmpSpg = updatedEcmpSpgMap.get(dst);
                 HashMap<Integer, HashMap<DeviceId, ArrayList<ArrayList<DeviceId>>>> switchVia =
                         ecmpSpg.getAllLearnedSwitchesAndVia();
                 for (Integer itrIdx : switchVia.keySet()) {
@@ -275,7 +275,7 @@
             if (!srManager.mastershipService.isLocalMaster(sw.id())) {
                 continue;
             }
-            ECMPShortestPathGraph ecmpSpg = currentEcmpSpgMap.get(sw.id());
+            EcmpShortestPathGraph ecmpSpg = currentEcmpSpgMap.get(sw.id());
             if (ecmpSpg == null) {
                 log.error("No existing ECMP graph for switch {}", sw.id());
                 continue;
@@ -330,7 +330,7 @@
             }
 
             log.debug("Checking route change for switch {}", sw.id());
-            ECMPShortestPathGraph ecmpSpg = currentEcmpSpgMap.get(sw.id());
+            EcmpShortestPathGraph ecmpSpg = currentEcmpSpgMap.get(sw.id());
             if (ecmpSpg == null) {
                 log.debug("No existing ECMP graph for device {}", sw.id());
                 ArrayList<DeviceId> route = new ArrayList<>();
@@ -338,7 +338,7 @@
                 routes.add(route);
                 continue;
             }
-            ECMPShortestPathGraph newEcmpSpg = updatedEcmpSpgMap.get(sw.id());
+            EcmpShortestPathGraph newEcmpSpg = updatedEcmpSpgMap.get(sw.id());
             //currentEcmpSpgMap.put(sw.id(), newEcmpSpg);
             HashMap<Integer, HashMap<DeviceId, ArrayList<ArrayList<DeviceId>>>> switchVia =
                     ecmpSpg.getAllLearnedSwitchesAndVia();
@@ -414,7 +414,7 @@
     }
 
     private boolean populateEcmpRoutingRules(DeviceId destSw,
-                                             ECMPShortestPathGraph ecmpSPG) {
+                                             EcmpShortestPathGraph ecmpSPG) {
 
         HashMap<Integer, HashMap<DeviceId, ArrayList<ArrayList<DeviceId>>>> switchVia = ecmpSPG
                 .getAllLearnedSwitchesAndVia();
diff --git a/src/main/java/org/onosproject/segmentrouting/ECMPShortestPathGraph.java b/src/main/java/org/onosproject/segmentrouting/EcmpShortestPathGraph.java
similarity index 98%
rename from src/main/java/org/onosproject/segmentrouting/ECMPShortestPathGraph.java
rename to src/main/java/org/onosproject/segmentrouting/EcmpShortestPathGraph.java
index e9a59ba..4fd5991 100644
--- a/src/main/java/org/onosproject/segmentrouting/ECMPShortestPathGraph.java
+++ b/src/main/java/org/onosproject/segmentrouting/EcmpShortestPathGraph.java
@@ -36,7 +36,7 @@
  * calculated. The paths are snapshot paths at the point of the class
  * instantiation.
  */
-public class ECMPShortestPathGraph {
+public class EcmpShortestPathGraph {
     LinkedList<DeviceId> deviceQueue = new LinkedList<>();
     LinkedList<Integer> distanceQueue = new LinkedList<>();
     HashMap<DeviceId, Integer> deviceSearched = new HashMap<>();
@@ -46,7 +46,7 @@
     DeviceId rootDevice;
     private SegmentRoutingManager srManager;
     private static final Logger log = LoggerFactory
-            .getLogger(ECMPShortestPathGraph.class);
+            .getLogger(EcmpShortestPathGraph.class);
 
     /**
      * Constructor.
@@ -55,7 +55,7 @@
      * @param linkListToAvoid link list to avoid
      * @param deviceIdListToAvoid device list to avoid
      */
-    public ECMPShortestPathGraph(DeviceId rootDevice, List<String> deviceIdListToAvoid,
+    public EcmpShortestPathGraph(DeviceId rootDevice, List<String> deviceIdListToAvoid,
                                  List<Link> linkListToAvoid) {
         this.rootDevice = rootDevice;
         calcECMPShortestPathGraph(deviceIdListToAvoid, linkListToAvoid);
@@ -67,7 +67,7 @@
      * @param rootDevice root of the BFS tree
      * @param srManager SegmentRoutingManager object
      */
-    public ECMPShortestPathGraph(DeviceId rootDevice, SegmentRoutingManager srManager) {
+    public EcmpShortestPathGraph(DeviceId rootDevice, SegmentRoutingManager srManager) {
         this.rootDevice = rootDevice;
         this.srManager = srManager;
         calcECMPShortestPathGraph();
