diff --git a/src/route/fib-entry.cpp b/src/route/fib-entry.cpp
index ddb5dbd..05bee41 100644
--- a/src/route/fib-entry.cpp
+++ b/src/route/fib-entry.cpp
@@ -7,7 +7,7 @@
 using namespace std;
 
 bool
-FibEntry::isEqualNextHops(Nhl& nhlOther)
+FibEntry::isEqualNextHops(NexthopList& nhlOther)
 {
   if (m_nhl.getSize() != nhlOther.getSize())
   {
diff --git a/src/route/fib-entry.hpp b/src/route/fib-entry.hpp
index 66e2e8b..d320c9a 100644
--- a/src/route/fib-entry.hpp
+++ b/src/route/fib-entry.hpp
@@ -3,10 +3,10 @@
 
 #include <list>
 #include <iostream>
-#include <ndn-cpp-dev/util/scheduler.hpp>
+#include <ndn-cxx/util/scheduler.hpp>
 
 #include "nexthop.hpp"
-#include "nhl.hpp"
+#include "nexthop-list.hpp"
 
 namespace nlsr {
 
@@ -37,7 +37,7 @@
     return m_name;
   }
 
-  Nhl&
+  NexthopList&
   getNhl()
   {
     return m_nhl;
@@ -80,14 +80,14 @@
   }
 
   bool
-  isEqualNextHops(Nhl& nhlOther);
+  isEqualNextHops(NexthopList& nhlOther);
 
 private:
   std::string m_name;
   int m_timeToRefresh;
   ndn::EventId m_expiringEventId;
   int m_seqNo;
-  Nhl m_nhl;
+  NexthopList m_nhl;
 };
 
 std::ostream&
diff --git a/src/route/fib.cpp b/src/route/fib.cpp
index 5304d0e..1d7582b 100644
--- a/src/route/fib.cpp
+++ b/src/route/fib.cpp
@@ -1,8 +1,10 @@
 #include <list>
+
+#include "nlsr.hpp"
 #include "fib-entry.hpp"
 #include "fib.hpp"
-#include "nhl.hpp"
-#include "nlsr.hpp"
+#include "nexthop-list.hpp"
+
 
 
 namespace nlsr {
@@ -40,7 +42,8 @@
 Fib::remove(Nlsr& pnlsr, string name)
 {
   std::list<FibEntry>::iterator it = std::find_if(m_table.begin(),
-                                                  m_table.end(), bind(&fibEntryNameCompare, _1, name));
+                                                  m_table.end(), 
+                                                  bind(&fibEntryNameCompare, _1, name));
   if (it != m_table.end())
   {
     for (std::list<NextHop>::iterator nhit =
@@ -56,7 +59,7 @@
 
 
 void
-Fib::update(Nlsr& pnlsr, string name, Nhl& nextHopList)
+Fib::update(Nlsr& pnlsr, string name, NexthopList& nextHopList)
 {
   std::cout << "Fib::updateFib Called" << std::endl;
   int startFace = 0;
@@ -145,7 +148,7 @@
 }
 
 int
-Fib::getNumberOfFacesForName(Nhl& nextHopList, int maxFacesPerPrefix)
+Fib::getNumberOfFacesForName(NexthopList& nextHopList, int maxFacesPerPrefix)
 {
   int endFace = 0;
   if ((maxFacesPerPrefix == 0) || (nextHopList.getSize() <= maxFacesPerPrefix))
@@ -160,7 +163,7 @@
 }
 
 void
-Fib::removeHop(Nlsr& pnlsr, Nhl& nl, int doNotRemoveHopFaceId)
+Fib::removeHop(Nlsr& pnlsr, NexthopList& nl, int doNotRemoveHopFaceId)
 {
   for (std::list<NextHop>::iterator it = nl.getNextHopList().begin();
        it != nl.getNextHopList().end();   ++it)
diff --git a/src/route/fib.hpp b/src/route/fib.hpp
index f042362..4a80c48 100644
--- a/src/route/fib.hpp
+++ b/src/route/fib.hpp
@@ -24,7 +24,7 @@
   remove(Nlsr& pnlsr, string name);
 
   void
-  update(Nlsr& pnlsr, string name, Nhl& nextHopList);
+  update(Nlsr& pnlsr, string name, NexthopList& nextHopList);
 
   void
   clean(Nlsr& pnlsr);
@@ -40,10 +40,10 @@
 
 private:
   void
-  removeHop(Nlsr& pnlsr, Nhl& nl, int doNotRemoveHopFaceId);
+  removeHop(Nlsr& pnlsr, NexthopList& nl, int doNotRemoveHopFaceId);
 
   int
-  getNumberOfFacesForName(Nhl& nextHopList, int maxFacesPerPrefix);
+  getNumberOfFacesForName(NexthopList& nextHopList, int maxFacesPerPrefix);
 
   ndn::EventId
   scheduleEntryRefreshing(Nlsr& pnlsr, string name, int feSeqNum,
diff --git a/src/route/map.hpp b/src/route/map.hpp
index 9c9e6e8..bdacd4d 100644
--- a/src/route/map.hpp
+++ b/src/route/map.hpp
@@ -4,7 +4,7 @@
 #include <iostream>
 #include <list>
 
-#include <ndn-cpp-dev/face.hpp>
+#include <ndn-cxx/face.hpp>
 
 namespace nlsr {
 
diff --git a/src/route/npte.cpp b/src/route/name-prefix-table-entry.cpp
similarity index 86%
rename from src/route/npte.cpp
rename to src/route/name-prefix-table-entry.cpp
index 3194635..4389373 100644
--- a/src/route/npte.cpp
+++ b/src/route/name-prefix-table-entry.cpp
@@ -1,6 +1,6 @@
 #include <list>
 #include <utility>
-#include "npte.hpp"
+#include "name-prefix-table-entry.hpp"
 #include "routing-table-entry.hpp"
 #include "nexthop.hpp"
 
@@ -9,7 +9,7 @@
 using namespace std;
 
 void
-Npte::generateNhlfromRteList()
+NamePrefixTableEntry::generateNhlfromRteList()
 {
   m_nhl.reset();
   for (std::list<RoutingTableEntry>::iterator it = m_rteList.begin();
@@ -33,7 +33,7 @@
 }
 
 void
-Npte::removeRoutingTableEntry(RoutingTableEntry& rte)
+NamePrefixTableEntry::removeRoutingTableEntry(RoutingTableEntry& rte)
 {
   std::list<RoutingTableEntry>::iterator it = std::find_if(m_rteList.begin(),
                                                            m_rteList.end(),
@@ -45,7 +45,7 @@
 }
 
 void
-Npte::addRoutingTableEntry(RoutingTableEntry& rte)
+NamePrefixTableEntry::addRoutingTableEntry(RoutingTableEntry& rte)
 {
   std::list<RoutingTableEntry>::iterator it = std::find_if(m_rteList.begin(),
                                                            m_rteList.end(),
@@ -67,7 +67,7 @@
 
 //debugging purpose
 ostream&
-operator<<(ostream& os, Npte& npte)
+operator<<(ostream& os, NamePrefixTableEntry& npte)
 {
   os << "Name: " << npte.getNamePrefix() << endl;
   std::list<RoutingTableEntry> rteList = npte.getRteList();
diff --git a/src/route/npte.hpp b/src/route/name-prefix-table-entry.hpp
similarity index 84%
rename from src/route/npte.hpp
rename to src/route/name-prefix-table-entry.hpp
index 57fdfec..7f4f83a 100644
--- a/src/route/npte.hpp
+++ b/src/route/name-prefix-table-entry.hpp
@@ -9,16 +9,16 @@
 
 using namespace std;
 
-class Npte
+class NamePrefixTableEntry
 {
 public:
-  Npte()
+  NamePrefixTableEntry()
     : m_namePrefix()
     , m_nhl()
   {
   }
 
-  Npte(string np)
+  NamePrefixTableEntry(string np)
     : m_nhl()
   {
     m_namePrefix = np;
@@ -55,7 +55,7 @@
     return m_rteList.size();
   }
 
-  Nhl&
+  NexthopList&
   getNhl()
   {
     return m_nhl;
@@ -73,11 +73,11 @@
 private:
   std::string m_namePrefix;
   std::list<RoutingTableEntry> m_rteList;
-  Nhl m_nhl;
+  NexthopList m_nhl;
 };
 
 std::ostream&
-operator<<(std::ostream& os, Npte& npte);
+operator<<(std::ostream& os, NamePrefixTableEntry& npte);
 
 }//namespace nlsr
 
diff --git a/src/route/npt.cpp b/src/route/name-prefix-table.cpp
similarity index 69%
rename from src/route/npt.cpp
rename to src/route/name-prefix-table.cpp
index e094fe3..e37751b 100644
--- a/src/route/npt.cpp
+++ b/src/route/name-prefix-table.cpp
@@ -2,9 +2,10 @@
 #include <utility>
 #include <algorithm>
 
-#include "npt.hpp"
-#include "npte.hpp"
 #include "nlsr.hpp"
+#include "name-prefix-table.hpp"
+#include "name-prefix-table-entry.hpp"
+
 
 
 namespace nlsr {
@@ -12,7 +13,7 @@
 using namespace std;
 
 static bool
-npteCompare(Npte& npte, string& name)
+npteCompare(NamePrefixTableEntry& npte, string& name)
 {
   return npte.getNamePrefix() == name;
 }
@@ -20,13 +21,13 @@
 
 
 void
-Npt::addNpte(string name, RoutingTableEntry& rte, Nlsr& pnlsr)
+NamePrefixTable::addNpte(string name, RoutingTableEntry& rte, Nlsr& pnlsr)
 {
-  std::list<Npte>::iterator it = std::find_if(m_npteList.begin(),
-                                              m_npteList.end(), bind(&npteCompare, _1, name));
+  std::list<NamePrefixTableEntry>::iterator it = std::find_if(m_npteList.begin(),
+                                                              m_npteList.end(), bind(&npteCompare, _1, name));
   if (it == m_npteList.end())
   {
-    Npte newEntry(name);
+    NamePrefixTableEntry newEntry(name);
     newEntry.addRoutingTableEntry(rte);
     newEntry.generateNhlfromRteList();
     newEntry.getNhl().sort();
@@ -55,10 +56,10 @@
 }
 
 void
-Npt::removeNpte(string name, RoutingTableEntry& rte, Nlsr& pnlsr)
+NamePrefixTable::removeNpte(string name, RoutingTableEntry& rte, Nlsr& pnlsr)
 {
-  std::list<Npte>::iterator it = std::find_if(m_npteList.begin(),
-                                              m_npteList.end(), bind(&npteCompare, _1, name));
+  std::list<NamePrefixTableEntry>::iterator it = std::find_if(m_npteList.begin(),
+                                                              m_npteList.end(), bind(&npteCompare, _1, name));
   if (it != m_npteList.end())
   {
     string destRouter = rte.getDestination();
@@ -81,7 +82,7 @@
 
 
 void
-Npt::addNpteByDestName(string name, string destRouter, Nlsr& pnlsr)
+NamePrefixTable::addNpteByDestName(string name, string destRouter, Nlsr& pnlsr)
 {
   RoutingTableEntry* rteCheck =
     pnlsr.getRoutingTable().findRoutingTableEntry(destRouter);
@@ -97,7 +98,7 @@
 }
 
 void
-Npt::removeNpte(string name, string destRouter, Nlsr& pnlsr)
+NamePrefixTable::removeNpte(string name, string destRouter, Nlsr& pnlsr)
 {
   RoutingTableEntry* rteCheck =
     pnlsr.getRoutingTable().findRoutingTableEntry(destRouter);
@@ -113,9 +114,10 @@
 }
 
 void
-Npt::updateWithNewRoute(Nlsr& pnlsr)
+NamePrefixTable::updateWithNewRoute(Nlsr& pnlsr)
 {
-  for (std::list<Npte>::iterator it = m_npteList.begin(); it != m_npteList.end();
+  for (std::list<NamePrefixTableEntry>::iterator it = m_npteList.begin();
+       it != m_npteList.end();
        ++it)
   {
     std::list<RoutingTableEntry> rteList = (*it).getRteList();
@@ -138,10 +140,11 @@
 }
 
 void
-Npt::print()
+NamePrefixTable::print()
 {
   std::cout << "----------------NPT----------------------" << std::endl;
-  for (std::list<Npte>::iterator it = m_npteList.begin(); it != m_npteList.end();
+  for (std::list<NamePrefixTableEntry>::iterator it = m_npteList.begin();
+       it != m_npteList.end();
        ++it)
   {
     cout << (*it) << endl;
diff --git a/src/route/npt.hpp b/src/route/name-prefix-table.hpp
similarity index 81%
rename from src/route/npt.hpp
rename to src/route/name-prefix-table.hpp
index 8e6cd0a..1a59af2 100644
--- a/src/route/npt.hpp
+++ b/src/route/name-prefix-table.hpp
@@ -2,16 +2,16 @@
 #define NLSR_NPT_HPP
 
 #include <list>
-#include "npte.hpp"
+#include "name-prefix-table-entry.hpp"
 #include "routing-table-entry.hpp"
 
 namespace nlsr {
 class Nlsr;
 
-class Npt
+class NamePrefixTable
 {
 public:
-  Npt()
+  NamePrefixTable()
   {
   }
   void
@@ -34,7 +34,7 @@
   removeNpte(std::string name, RoutingTableEntry& rte, Nlsr& pnlsr);
 
 private:
-  std::list<Npte> m_npteList;
+  std::list<NamePrefixTableEntry> m_npteList;
 };
 
 }//namespace nlsr
diff --git a/src/route/nhl.cpp b/src/route/nexthop-list.cpp
similarity index 91%
rename from src/route/nhl.cpp
rename to src/route/nexthop-list.cpp
index 50d6303..7edb96e 100644
--- a/src/route/nhl.cpp
+++ b/src/route/nexthop-list.cpp
@@ -1,5 +1,5 @@
 #include <iostream>
-#include "nhl.hpp"
+#include "nexthop-list.hpp"
 #include "nexthop.hpp"
 
 namespace nlsr {
@@ -34,7 +34,7 @@
 */
 
 void
-Nhl::addNextHop(NextHop& nh)
+NexthopList::addNextHop(NextHop& nh)
 {
   std::list<NextHop>::iterator it = std::find_if(m_nexthopList.begin(),
                                                  m_nexthopList.end(),
@@ -55,7 +55,7 @@
 */
 
 void
-Nhl::removeNextHop(NextHop& nh)
+NexthopList::removeNextHop(NextHop& nh)
 {
   std::list<NextHop>::iterator it = std::find_if(m_nexthopList.begin(),
                                                  m_nexthopList.end(),
@@ -67,13 +67,13 @@
 }
 
 void
-Nhl::sort()
+NexthopList::sort()
 {
   m_nexthopList.sort(nextHopSortingComparator);
 }
 
 ostream&
-operator<<(ostream& os, Nhl& nhl)
+operator<<(ostream& os, NexthopList& nhl)
 {
   std::list<NextHop> nexthopList = nhl.getNextHopList();
   int i = 1;
diff --git a/src/route/nhl.hpp b/src/route/nexthop-list.hpp
similarity index 82%
rename from src/route/nhl.hpp
rename to src/route/nexthop-list.hpp
index ef43373..a8ebe7b 100644
--- a/src/route/nhl.hpp
+++ b/src/route/nexthop-list.hpp
@@ -1,7 +1,7 @@
 #ifndef NLSR_NHL_HPP
 #define NLSR_NHL_HPP
 
-#include <ndn-cpp-dev/face.hpp>
+#include <ndn-cxx/face.hpp>
 #include <list>
 #include <iostream>
 
@@ -10,15 +10,15 @@
 
 namespace nlsr {
 
-class Nhl
+class NexthopList
 {
 public:
-  Nhl()
+  NexthopList()
     : m_nexthopList()
   {
   }
 
-  ~Nhl()
+  ~NexthopList()
   {
   }
   void
@@ -56,7 +56,7 @@
 };
 
 std::ostream&
-operator<<(std::ostream& os, Nhl& nhl);
+operator<<(std::ostream& os, NexthopList& nhl);
 
 }//namespace nlsr
 
diff --git a/src/route/routing-table-calculator.cpp b/src/route/routing-table-calculator.cpp
index d63904e..7ec8a23 100644
--- a/src/route/routing-table-calculator.cpp
+++ b/src/route/routing-table-calculator.cpp
@@ -262,7 +262,7 @@
         string nextHopRouterName =
           pMap.getRouterNameByMappingNo(nextHopRouter);
         int nxtHopFace =
-          pnlsr.getAdl().getAdjacent(nextHopRouterName).getConnectingFace();
+          pnlsr.getAdjacencyList().getAdjacent(nextHopRouterName).getConnectingFace();
         std::cout << "Dest Router: " << pMap.getRouterNameByMappingNo(i) << std::endl;
         std::cout << "Next hop Router: " << nextHopRouterName << std::endl;
         std::cout << "Next hop Face: " << nxtHopFace << std::endl;
@@ -401,7 +401,7 @@
       {
         string nextHopRouterName = pMap.getRouterNameByMappingNo(links[j]);
         int nextHopFace =
-          pnlsr.getAdl().getAdjacent(nextHopRouterName).getConnectingFace();
+          pnlsr.getAdjacencyList().getAdjacent(nextHopRouterName).getConnectingFace();
         double distToNbr = getHyperbolicDistance(pnlsr, pMap,
                                                  sourceRouter, links[j]);
         double distToDestFromNbr = getHyperbolicDistance(pnlsr,
diff --git a/src/route/routing-table-entry.hpp b/src/route/routing-table-entry.hpp
index f185e61..8877275 100644
--- a/src/route/routing-table-entry.hpp
+++ b/src/route/routing-table-entry.hpp
@@ -3,7 +3,7 @@
 
 #include <iostream>
 
-#include "nhl.hpp"
+#include "nexthop-list.hpp"
 
 namespace nlsr {
 
@@ -32,7 +32,7 @@
     return m_destination;
   }
 
-  Nhl&
+  NexthopList&
   getNhl()
   {
     return m_nhl;
@@ -40,7 +40,7 @@
 
 private:
   std::string m_destination;
-  Nhl m_nhl;
+  NexthopList m_nhl;
 };
 
 std::ostream&
diff --git a/src/route/routing-table.cpp b/src/route/routing-table.cpp
index 097e95a..2bc827c 100644
--- a/src/route/routing-table.cpp
+++ b/src/route/routing-table.cpp
@@ -7,7 +7,7 @@
 #include "map.hpp"
 #include "routing-table-calculator.hpp"
 #include "routing-table-entry.hpp"
-#include "npt.hpp"
+#include "name-prefix-table.hpp"
 
 namespace nlsr {
 
@@ -18,7 +18,7 @@
 {
   //debugging purpose
   std::cout << pnlsr.getConfParameter() << std::endl;
-  pnlsr.getNpt().print();
+  pnlsr.getNamePrefixTable().print();
   pnlsr.getLsdb().printAdjLsdb();
   pnlsr.getLsdb().printCorLsdb();
   pnlsr.getLsdb().printNameLsdb();
@@ -50,10 +50,10 @@
           calculateHypDryRoutingTable(pnlsr);
         }
         //need to update NPT here
-        pnlsr.getNpt().updateWithNewRoute(pnlsr);
+        pnlsr.getNamePrefixTable().updateWithNewRoute(pnlsr);
         //debugging purpose
         printRoutingTable();
-        pnlsr.getNpt().print();
+        pnlsr.getNamePrefixTable().print();
         pnlsr.getFib().print();
         //debugging purpose end
       }
@@ -71,10 +71,10 @@
       clearDryRoutingTable(); // for dry run options
       // need to update NPT here
       std::cout << "Calling Update NPT With new Route" << std::endl;
-      pnlsr.getNpt().updateWithNewRoute(pnlsr);
+      pnlsr.getNamePrefixTable().updateWithNewRoute(pnlsr);
       //debugging purpose
       printRoutingTable();
-      pnlsr.getNpt().print();
+      pnlsr.getNamePrefixTable().print();
       pnlsr.getFib().print();
       //debugging purpose end
     }
