diff --git a/src/route/name-prefix-table.cpp b/src/route/name-prefix-table.cpp
index e6a7ccf..f791d0a 100644
--- a/src/route/name-prefix-table.cpp
+++ b/src/route/name-prefix-table.cpp
@@ -5,6 +5,7 @@
 #include "nlsr.hpp"
 #include "name-prefix-table.hpp"
 #include "name-prefix-table-entry.hpp"
+#include "routing-table.hpp"
 
 
 
@@ -13,7 +14,7 @@
 using namespace std;
 
 static bool
-npteCompare(NamePrefixTableEntry& npte, const string& name)
+npteCompare(NamePrefixTableEntry& npte, const ndn::Name& name)
 {
   return npte.getNamePrefix() == name;
 }
@@ -21,7 +22,7 @@
 
 
 void
-NamePrefixTable::addEntry(const string& name, RoutingTableEntry& rte, Nlsr& pnlsr)
+NamePrefixTable::addEntry(const ndn::Name& name, RoutingTableEntry& rte)
 {
   std::list<NamePrefixTableEntry>::iterator it = std::find_if(m_table.begin(),
                                                               m_table.end(), bind(&npteCompare, _1, name));
@@ -34,7 +35,7 @@
     m_table.push_back(newEntry);
     if (rte.getNexthopList().getSize() > 0)
     {
-      pnlsr.getFib().update(pnlsr, name, newEntry.getNexthopList());
+      m_nlsr.getFib().update(name, newEntry.getNexthopList());
     }
   }
   else
@@ -44,77 +45,82 @@
       (*it).addRoutingTableEntry(rte);
       (*it).generateNhlfromRteList();
       (*it).getNexthopList().sort();
-      pnlsr.getFib().update(pnlsr, name, (*it).getNexthopList());
+      m_nlsr.getFib().update(name, (*it).getNexthopList());
     }
     else
     {
       (*it).resetRteListNextHop();
       (*it).getNexthopList().reset();
-      pnlsr.getFib().remove(pnlsr, name);
+      m_nlsr.getFib().remove(name);
     }
   }
 }
 
 void
-NamePrefixTable::removeEntry(const string& name, RoutingTableEntry& rte, Nlsr& pnlsr)
+NamePrefixTable::removeEntry(const ndn::Name& name, RoutingTableEntry& rte)
 {
   std::list<NamePrefixTableEntry>::iterator it = std::find_if(m_table.begin(),
                                                               m_table.end(), bind(&npteCompare, _1, name));
   if (it != m_table.end())
   {
-    string destRouter = rte.getDestination();
+    ndn::Name destRouter = rte.getDestination();
     (*it).removeRoutingTableEntry(rte);
     if (((*it).getRteListSize() == 0) &&
-        (!pnlsr.getLsdb().doesLsaExist(destRouter + "/1", 1)) &&
-        (!pnlsr.getLsdb().doesLsaExist(destRouter + "/2", 2)) &&
-        (!pnlsr.getLsdb().doesLsaExist(destRouter + "/3", 3)))
+        (!m_nlsr.getLsdb().doesLsaExist(destRouter.append("/name"),
+                                        std::string("name"))) &&
+        (!m_nlsr.getLsdb().doesLsaExist(destRouter.append("/adjacency"),
+                                        std::string("adjacency"))) &&
+        (!m_nlsr.getLsdb().doesLsaExist(destRouter.append("/coordinate"),
+                                        std::string("coordinate"))))
     {
       m_table.erase(it);
-      pnlsr.getFib().remove(pnlsr, name);
+      m_nlsr.getFib().remove(name);
     }
     else
     {
       (*it).generateNhlfromRteList();
-      pnlsr.getFib().update(pnlsr, name, (*it).getNexthopList());
+      m_nlsr.getFib().update(name, (*it).getNexthopList());
     }
   }
 }
 
 
 void
-NamePrefixTable::addEntry(const string& name, const string& destRouter, Nlsr& pnlsr)
+NamePrefixTable::addEntry(const ndn::Name& name, const ndn::Name& destRouter)
 {
+  //
   RoutingTableEntry* rteCheck =
-    pnlsr.getRoutingTable().findRoutingTableEntry(destRouter);
+    m_nlsr.getRoutingTable().findRoutingTableEntry(destRouter);
   if (rteCheck != 0)
   {
-    addEntry(name, *(rteCheck) , pnlsr);
+    addEntry(name, *(rteCheck));
   }
   else
   {
     RoutingTableEntry rte(destRouter);
-    addEntry(name, rte, pnlsr);
+    addEntry(name, rte);
   }
 }
 
 void
-NamePrefixTable::removeEntry(const string& name, const string& destRouter, Nlsr& pnlsr)
+NamePrefixTable::removeEntry(const ndn::Name& name, const ndn::Name& destRouter)
 {
+  //
   RoutingTableEntry* rteCheck =
-    pnlsr.getRoutingTable().findRoutingTableEntry(destRouter);
+    m_nlsr.getRoutingTable().findRoutingTableEntry(destRouter);
   if (rteCheck != 0)
   {
-    removeEntry(name, *(rteCheck), pnlsr);
+    removeEntry(name, *(rteCheck));
   }
   else
   {
     RoutingTableEntry rte(destRouter);
-    removeEntry(name, rte, pnlsr);
+    removeEntry(name, rte);
   }
 }
 
 void
-NamePrefixTable::updateWithNewRoute(Nlsr& pnlsr)
+NamePrefixTable::updateWithNewRoute()
 {
   for (std::list<NamePrefixTableEntry>::iterator it = m_table.begin();
        it != m_table.end(); ++it)
@@ -124,15 +130,15 @@
          rteit != rteList.end(); ++rteit)
     {
       RoutingTableEntry* rteCheck =
-        pnlsr.getRoutingTable().findRoutingTableEntry((*rteit).getDestination());
+        m_nlsr.getRoutingTable().findRoutingTableEntry((*rteit).getDestination());
       if (rteCheck != 0)
       {
-        addEntry((*it).getNamePrefix(), *(rteCheck), pnlsr);
+        addEntry((*it).getNamePrefix(), *(rteCheck));
       }
       else
       {
         RoutingTableEntry rte((*rteit).getDestination());
-        addEntry((*it).getNamePrefix(), rte, pnlsr);
+        addEntry((*it).getNamePrefix(), rte);
       }
     }
   }
