diff --git a/nsync/openssl.h b/nsync/openssl.h
new file mode 100644
index 0000000..a8707a9
--- /dev/null
+++ b/nsync/openssl.h
@@ -0,0 +1,21 @@
+#ifndef NSYNC_OPENSSL_H
+#define NSYNC_OPENSSL_H
+
+// suppress deprecation warnings in OSX >= 10.7
+
+#if defined(__APPLE__)
+
+#ifdef __clang__
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#endif // __clang__
+
+#ifdef __GNUC__
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif // __GNUC__
+
+#endif
+
+
+#include <openssl/evp.h>
+
+#endif // NSYNC_OPENSSL_H
diff --git a/nsync/sync-digest.h b/nsync/sync-digest.h
index ecc8522..da45758 100644
--- a/nsync/sync-digest.h
+++ b/nsync/sync-digest.h
@@ -17,16 +17,16 @@
  *
  * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
  *         Chaoyi Bian <bcy@pku.edu.cn>
- *	   Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ *         Alexander Afanasyev <alexander.afanasyev@ucla.edu>
  */
 
 #ifndef SYNC_DIGEST_H
 #define SYNC_DIGEST_H
 
 #include <boost/exception/all.hpp>
-#include <openssl/evp.h>
 #include <boost/cstdint.hpp>
 #include <vector>
+#include "openssl.h"
 
 namespace Sync {
 
@@ -47,7 +47,7 @@
    */
   bool
   empty () const;
-  
+
   /**
    * @brief Reset digest to the initial state
    */
@@ -84,7 +84,7 @@
   bool
   operator != (const Digest &digest) const
   { return ! (*this == digest); }
-  
+
 
   /**
    * @brief Add existing digest to digest calculation
@@ -116,11 +116,11 @@
    */
   bool
   isZero () const;
-  
+
 private:
   Digest &
   operator = (Digest &digest) { (void)digest; return *this; }
-  
+
   /**
    * @brief Add size bytes of buffer to the hash
    */
@@ -132,7 +132,7 @@
 
   friend std::istream &
   operator >> (std::istream &is, Digest &digest);
-  
+
 private:
   EVP_MD_CTX *m_context;
   std::vector<uint8_t> m_buffer;
diff --git a/src/adjacency-list.cpp b/src/adjacency-list.cpp
index 7f21a80..a529b17 100644
--- a/src/adjacency-list.cpp
+++ b/src/adjacency-list.cpp
@@ -8,6 +8,8 @@
 
 namespace nlsr {
 
+using namespace std;
+
 AdjacencyList::AdjacencyList()
 {
 }
@@ -16,26 +18,20 @@
 {
 }
 
-static bool
-adjacent_compare(Adjacent& adj1, Adjacent& adj2)
+int32_t
+AdjacencyList::insert(Adjacent& adjacent)
 {
-  return adj1.getName() == adj2.getName();
-}
-
-int
-AdjacencyList::insert(Adjacent& adj)
-{
-  std::list<Adjacent>::iterator it = find(adj.getName());
+  std::list<Adjacent>::iterator it = find(adjacent.getName());
   if (it != m_adjList.end())
   {
     return -1;
   }
-  m_adjList.push_back(adj);
+  m_adjList.push_back(adjacent);
   return 0;
 }
 
 void
-AdjacencyList::addAdjacentsFromAdl(AdjacencyList& adl)
+AdjacencyList::addAdjacents(AdjacencyList& adl)
 {
   for (std::list<Adjacent>::iterator it = adl.getAdjList().begin();
        it != adl.getAdjList().end(); ++it)
@@ -44,8 +40,8 @@
   }
 }
 
-int
-AdjacencyList::updateAdjacentStatus(const string& adjName, int s)
+int32_t
+AdjacencyList::updateAdjacentStatus(const string& adjName, int32_t s)
 {
   std::list<Adjacent>::iterator it = find(adjName);
   if (it == m_adjList.end())
@@ -68,24 +64,29 @@
   return adj;
 }
 
+static bool
+compareAdjacent(const Adjacent& adjacent1, const Adjacent& adjacent2)
+{
+  return adjacent1.getName() < adjacent2.getName();
+}
 
 bool
-AdjacencyList::isEqual(AdjacencyList& adl)
+AdjacencyList::operator==(AdjacencyList& adl)
 {
   if (getSize() != adl.getSize())
   {
     return false;
   }
-  m_adjList.sort(adjacent_compare);
-  adl.getAdjList().sort(adjacent_compare);
-  int equalAdjCount = 0;
-  std::list<Adjacent> adjList2 = adl.getAdjList();
+  m_adjList.sort(compareAdjacent);
+  adl.getAdjList().sort(compareAdjacent);
+  uint32_t equalAdjCount = 0;
+  std::list<Adjacent>& adjList2 = adl.getAdjList();
   std::list<Adjacent>::iterator it1;
   std::list<Adjacent>::iterator it2;
   for (it1 = m_adjList.begin(), it2 = adjList2.begin();
        it1 != m_adjList.end(); it1++, it2++)
   {
-    if (!(*it1).isEqual((*it2)))
+    if (!((*it1) == (*it2)))
     {
       break;
     }
@@ -94,8 +95,7 @@
   return equalAdjCount == getSize();
 }
 
-
-int
+int32_t
 AdjacencyList::updateAdjacentLinkCost(const string& adjName, double lc)
 {
   std::list<Adjacent>::iterator it = find(adjName);
@@ -130,7 +130,7 @@
 }
 
 void
-AdjacencyList::setTimedOutInterestCount(const string& neighbor, int count)
+AdjacencyList::setTimedOutInterestCount(const string& neighbor, uint32_t count)
 {
   std::list<Adjacent>::iterator it = find(neighbor);
   if (it != m_adjList.end())
@@ -139,7 +139,7 @@
   }
 }
 
-int
+int32_t
 AdjacencyList::getTimedOutInterestCount(const string& neighbor)
 {
   std::list<Adjacent>::iterator it = find(neighbor);
@@ -150,7 +150,7 @@
   return (*it).getInterestTimedOutNo();
 }
 
-int
+uint32_t
 AdjacencyList::getStatusOfNeighbor(const string& neighbor)
 {
   std::list<Adjacent>::iterator it = find(neighbor);
@@ -162,7 +162,7 @@
 }
 
 void
-AdjacencyList::setStatusOfNeighbor(const string& neighbor, int status)
+AdjacencyList::setStatusOfNeighbor(const string& neighbor, int32_t status)
 {
   std::list<Adjacent>::iterator it = find(neighbor);
   if (it != m_adjList.end())
@@ -204,10 +204,10 @@
   return false;
 }
 
-int
+int32_t
 AdjacencyList::getNumOfActiveNeighbor()
 {
-  int actNbrCount = 0;
+  int32_t actNbrCount = 0;
   for (std::list<Adjacent>::iterator it = m_adjList.begin();
        it != m_adjList.end(); it++)
   {
@@ -225,7 +225,7 @@
   Adjacent adj(adjName);
   std::list<Adjacent>::iterator it = std::find_if(m_adjList.begin(),
                                                   m_adjList.end(),
-                                                  bind(&adjacent_compare, _1, adj));
+                                                  bind(&Adjacent::compareName, &adj, _1));
   return it;
 }
 
diff --git a/src/adjacency-list.hpp b/src/adjacency-list.hpp
index 45123df..a88a6ba 100644
--- a/src/adjacency-list.hpp
+++ b/src/adjacency-list.hpp
@@ -1,8 +1,9 @@
-#ifndef NLSR_ADL_HPP
-#define NLSR_ADL_HPP
+#ifndef NLSR_ADJACENCY_LIST_HPP
+#define NLSR_ADJACENCY_LIST_HPP
 
-#include <ndn-cxx/common.hpp>
 #include <list>
+#include <boost/cstdint.hpp>
+#include <ndn-cxx/common.hpp>
 
 #include "adjacent.hpp"
 
@@ -16,13 +17,13 @@
   AdjacencyList();
   ~AdjacencyList();
 
-  int
-  insert(Adjacent& adj);
+  int32_t
+  insert(Adjacent& adjacent);
 
-  int
-  updateAdjacentStatus(const std::string& adjName, int s);
+  int32_t
+  updateAdjacentStatus(const std::string& adjName, int32_t s);
 
-  int
+  int32_t
   updateAdjacentLinkCost(const std::string& adjName, double lc);
 
   std::list<Adjacent>&
@@ -34,34 +35,34 @@
   void
   incrementTimedOutInterestCount(const std::string& neighbor);
 
-  int
+  int32_t
   getTimedOutInterestCount(const std::string& neighbor);
 
-  int
+  uint32_t
   getStatusOfNeighbor(const std::string& neighbor);
 
   void
-  setStatusOfNeighbor(const std::string& neighbor, int status);
+  setStatusOfNeighbor(const std::string& neighbor, int32_t status);
 
   void
-  setTimedOutInterestCount(const std::string& neighbor, int count);
+  setTimedOutInterestCount(const std::string& neighbor, uint32_t count);
 
   void
-  addAdjacentsFromAdl(AdjacencyList& adl);
+  addAdjacents(AdjacencyList& adl);
 
   bool
   isAdjLsaBuildable(Nlsr& pnlsr);
 
-  int
+  int32_t
   getNumOfActiveNeighbor();
 
   Adjacent
   getAdjacent(const std::string& adjName);
 
   bool
-  isEqual(AdjacencyList& adl);
+  operator==(AdjacencyList& adl);
 
-  int
+  size_t
   getSize()
   {
     return m_adjList.size();
@@ -88,4 +89,4 @@
 };
 
 } //namespace nlsr
-#endif //NLSR_ADL_HPP
+#endif //NLSR_ADJACENCY_LIST_HPP
diff --git a/src/adjacent.cpp b/src/adjacent.cpp
index 3212c1e..f5a2c8e 100644
--- a/src/adjacent.cpp
+++ b/src/adjacent.cpp
@@ -3,13 +3,14 @@
 #include <cmath>
 #include <limits>
 
+
 #include "adjacent.hpp"
 
 namespace nlsr {
 
 using namespace std;
 
-Adjacent::Adjacent(const string& an, int cf, double lc, int s, int iton)
+Adjacent::Adjacent(const string& an, uint32_t cf, double lc, uint32_t s, uint32_t iton)
 {
   m_name = an;
   m_connectingFace = cf;
@@ -19,18 +20,24 @@
 }
 
 bool
-Adjacent::isEqual(Adjacent& adj)
+Adjacent::operator==(const Adjacent& adjacent) const
 {
-  return (m_name == adj.getName()) &&
-         (m_connectingFace == adj.getConnectingFace()) &&
-         (std::abs(m_linkCost - adj.getLinkCost()) <
+  return (m_name == adjacent.getName()) &&
+         (m_connectingFace == adjacent.getConnectingFace()) &&
+         (std::abs(m_linkCost - adjacent.getLinkCost()) <
           std::numeric_limits<double>::epsilon()) ;
 }
 
-std::ostream&
-operator<<(std::ostream& os, Adjacent& adj)
+bool
+Adjacent::compareName(const Adjacent& adjacent)
 {
-  os << "Adjacent : " << adj.getName()	<< endl;
+  return m_name == adjacent.getName();
+}
+
+std::ostream&
+operator<<(std::ostream& os, const Adjacent& adj)
+{
+  os << "Adjacent : " << adj.getName() << endl;
   os << "Connecting Face: " << adj.getConnectingFace() << endl;
   os << "Link Cost: " << adj.getLinkCost() << endl;
   os << "Status: " << adj.getStatus() << endl;
diff --git a/src/adjacent.hpp b/src/adjacent.hpp
index 22066d1..b8b6695 100644
--- a/src/adjacent.hpp
+++ b/src/adjacent.hpp
@@ -1,7 +1,8 @@
 #include <string>
+#include <boost/cstdint.hpp>
 
-#ifndef ADJACENT_HPP
-#define ADJACENT_HPP
+#ifndef NLSR_ADJACENT_HPP
+#define NLSR_ADJACENT_HPP
 
 namespace nlsr {
 class Adjacent
@@ -26,10 +27,10 @@
     m_name = an;
   }
 
-  Adjacent(const std::string& an, int cf, double lc, int s, int iton);
+  Adjacent(const std::string& an, uint32_t cf, double lc, uint32_t s, uint32_t iton);
 
   std::string
-  getName()
+  getName() const
   {
     return m_name;
   }
@@ -40,20 +41,20 @@
     m_name = an;
   }
 
-  int
-  getConnectingFace()
+  uint32_t
+  getConnectingFace() const
   {
     return m_connectingFace;
   }
 
   void
-  setConnectingFace(int cf)
+  setConnectingFace(uint32_t cf)
   {
     m_connectingFace = cf;
   }
 
   double
-  getLinkCost()
+  getLinkCost() const
   {
     return m_linkCost;
   }
@@ -64,44 +65,47 @@
     m_linkCost = lc;
   }
 
-  int
-  getStatus()
+  uint32_t
+  getStatus() const
   {
     return m_status;
   }
 
   void
-  setStatus(int s)
+  setStatus(uint32_t s)
   {
     m_status = s;
   }
 
-  int
-  getInterestTimedOutNo()
+  uint32_t
+  getInterestTimedOutNo() const
   {
     return m_interestTimedOutNo;
   }
 
   void
-  setInterestTimedOutNo(int iton)
+  setInterestTimedOutNo(uint32_t iton)
   {
     m_interestTimedOutNo = iton;
   }
 
   bool
-  isEqual(Adjacent& adj);
+  operator==(const Adjacent& adjacent) const;
 
+  bool
+  compareName(const Adjacent& adjacent);
+  
 private:
   std::string m_name;
-  int m_connectingFace;
+  uint32_t m_connectingFace;
   double m_linkCost;
-  int m_status;
-  int m_interestTimedOutNo;
+  uint32_t m_status;
+  uint32_t m_interestTimedOutNo;
 };
 
 std::ostream&
-operator<<(std::ostream& os, Adjacent& adj);
+operator<<(std::ostream& os, const Adjacent& adj);
 
 } // namespace nlsr
 
-#endif //ADJACENT_HPP
+#endif //NLSR_ADJACENT_HPP
diff --git a/src/communication/data-manager.cpp b/src/communication/data-manager.cpp
index 8525ce7..3a153a3 100644
--- a/src/communication/data-manager.cpp
+++ b/src/communication/data-manager.cpp
@@ -61,8 +61,7 @@
   string chkString("info");
   string neighbor = nt.getTokenString(0, nt.getTokenPosition(chkString) - 1);
   int oldStatus = m_nlsr.getAdjacencyList().getStatusOfNeighbor(neighbor);
-  int infoIntTimedOutCount = m_nlsr.getAdjacencyList().getTimedOutInterestCount(
-                               neighbor);
+  int infoIntTimedOutCount = m_nlsr.getAdjacencyList().getTimedOutInterestCount(neighbor);
   //debugging purpose start
   std::cout << "Before Updates: " << std::endl;
   std::cout << "Neighbor : " << neighbor << std::endl;
@@ -72,8 +71,7 @@
   m_nlsr.getAdjacencyList().setStatusOfNeighbor(neighbor, 1);
   m_nlsr.getAdjacencyList().setTimedOutInterestCount(neighbor, 0);
   int newStatus = m_nlsr.getAdjacencyList().getStatusOfNeighbor(neighbor);
-  infoIntTimedOutCount = m_nlsr.getAdjacencyList().getTimedOutInterestCount(
-                           neighbor);
+  infoIntTimedOutCount = m_nlsr.getAdjacencyList().getTimedOutInterestCount(neighbor);
   //debugging purpose
   std::cout << "After Updates: " << std::endl;
   std::cout << "Neighbor : " << neighbor << std::endl;
diff --git a/src/communication/data-manager.hpp b/src/communication/data-manager.hpp
index 86c2e42..ce10b88 100644
--- a/src/communication/data-manager.hpp
+++ b/src/communication/data-manager.hpp
@@ -1,5 +1,7 @@
-#ifndef NLSR_DM_HPP
-#define NLSR_DM_HPP
+#ifndef NLSR_DATA_MANAGER_HPP
+#define NLSR_DATA_MANAGER_HPP
+
+#include <boost/cstdint.hpp>
 
 #include <ndn-cxx/face.hpp>
 #include <ndn-cxx/security/key-chain.hpp>
@@ -50,4 +52,4 @@
 
 }//namespace nlsr
 
-#endif //NLSR_DM_HPP
+#endif //NLSR_DATA_MANAGER_HPP
diff --git a/src/communication/interest-manager.cpp b/src/communication/interest-manager.cpp
index edcfec7..23ce579 100644
--- a/src/communication/interest-manager.cpp
+++ b/src/communication/interest-manager.cpp
@@ -1,7 +1,6 @@
 #include <iostream>
 #include <cstdlib>
 
-
 #include <ndn-cxx/security/identity-certificate.hpp>
 #include <ndn-cxx/util/io.hpp>
 
@@ -55,7 +54,7 @@
     // m_nlsr.getKeyManager().signData(data);
     m_keyChain.sign(data);
     cout << ">> D: " << data << endl;
-    m_nlsr.getNlsrFace()->put(data);
+    m_nlsr.getNlsrFace().put(data);
     int status = m_nlsr.getAdjacencyList().getStatusOfNeighbor(neighbor);
     if (status == 0)
     {
@@ -129,7 +128,7 @@
       // m_nlsr.getKeyManager().signData(data);
       m_keyChain.sign(data);
       std::cout << ">> D: " << data << std::endl;
-      m_nlsr.getNlsrFace()->put(data);
+      m_nlsr.getNlsrFace().put(data);
     }
   }
 }
@@ -150,7 +149,7 @@
       // m_nlsr.getKeyManager().signData(data);
       m_keyChain.sign(data);
       std::cout << ">> D: " << data << std::endl;
-      m_nlsr.getNlsrFace()->put(data);
+      m_nlsr.getNlsrFace().put(data);
     }
   }
 }
@@ -171,7 +170,7 @@
       // m_nlsr.getKeyManager().signData(data);
       m_keyChain.sign(data);
       std::cout << ">> D: " << data << std::endl;
-      m_nlsr.getNlsrFace()->put(data);
+      m_nlsr.getNlsrFace().put(data);
     }
   }
 }
@@ -258,8 +257,7 @@
 {
   m_nlsr.getAdjacencyList().incrementTimedOutInterestCount(neighbor);
   int status = m_nlsr.getAdjacencyList().getStatusOfNeighbor(neighbor);
-  int infoIntTimedOutCount = m_nlsr.getAdjacencyList().getTimedOutInterestCount(
-                               neighbor);
+  uint32_t infoIntTimedOutCount = m_nlsr.getAdjacencyList().getTimedOutInterestCount(neighbor);
   std::cout << "Neighbor: " << neighbor << std::endl;
   std::cout << "Status: " << status << std::endl;
   std::cout << "Info Interest Timed out: " << infoIntTimedOutCount << std::endl;
@@ -294,23 +292,23 @@
 
 void
 InterestManager::expressInterest(const string& interestNamePrefix,
-                                 int scope, int seconds)
+                                 int32_t scope, int32_t seconds)
 {
   std::cout << "Expressing Interest :" << interestNamePrefix << std::endl;
   ndn::Interest i((ndn::Name(interestNamePrefix)));
   i.setInterestLifetime(time::seconds(seconds));
   i.setMustBeFresh(true);
-  m_nlsr.getNlsrFace()->expressInterest(i,
-                                        ndn::bind(&DataManager::processContent,
-                                                  &m_nlsr.getDataManager(),
-                                                  _1, _2, boost::ref(*this)),
-                                        ndn::bind(&InterestManager::processInterestTimedOut,
-                                                  this, _1));
+  m_nlsr.getNlsrFace().expressInterest(i,
+                                       ndn::bind(&DataManager::processContent,
+                                                 &m_nlsr.getDataManager(),
+                                                 _1, _2, boost::ref(*this)),
+                                       ndn::bind(&InterestManager::processInterestTimedOut,
+                                                 this, _1));
 }
 
 
 void
-InterestManager::sendScheduledInfoInterest(int seconds)
+InterestManager::sendScheduledInfoInterest(int32_t seconds)
 {
   std::list<Adjacent> adjList = m_nlsr.getAdjacencyList().getAdjList();
   for (std::list<Adjacent>::iterator it = adjList.begin(); it != adjList.end();
@@ -325,7 +323,7 @@
 }
 
 void
-InterestManager::scheduleInfoInterest(int seconds)
+InterestManager::scheduleInfoInterest(int32_t seconds)
 {
   EventId eid = m_nlsr.getScheduler().scheduleEvent(ndn::time::seconds(seconds),
                                                     ndn::bind(&InterestManager::sendScheduledInfoInterest, this,
diff --git a/src/communication/interest-manager.hpp b/src/communication/interest-manager.hpp
index 7fe7655..00c798b 100644
--- a/src/communication/interest-manager.hpp
+++ b/src/communication/interest-manager.hpp
@@ -1,5 +1,7 @@
-#ifndef NLSR_IM_HPP
-#define NLSR_IM_HPP
+#ifndef NLSR_INTEREST_MANAGER_HPP
+#define NLSR_INTEREST_MANAGER_HPP
+
+#include <boost/cstdint.hpp>
 
 #include <ndn-cxx/face.hpp>
 #include <ndn-cxx/security/key-chain.hpp>
@@ -51,13 +53,13 @@
   processInterestTimedOutLsa(const ndn::Interest& interest);
 
   void
-  expressInterest(const std::string& interestNamePrefix, int scope, int seconds);
+  expressInterest(const std::string& interestNamePrefix, int32_t scope, int32_t seconds);
 
   void
-  sendScheduledInfoInterest(int seconds);
+  sendScheduledInfoInterest(int32_t seconds);
 
   void
-  scheduleInfoInterest(int seconds);
+  scheduleInfoInterest(int32_t seconds);
 
 private:
   Nlsr& m_nlsr;
@@ -67,4 +69,4 @@
 
 }//namespace nlsr
 
-#endif //NLSR_IM_HPP
+#endif //NLSR_INTEREST_MANAGER_HPP
diff --git a/src/communication/sync-logic-handler.cpp b/src/communication/sync-logic-handler.cpp
index 51ec319..c8b5ec9 100644
--- a/src/communication/sync-logic-handler.cpp
+++ b/src/communication/sync-logic-handler.cpp
@@ -6,6 +6,9 @@
 
 namespace nlsr {
 
+using namespace ndn;
+using namespace std;
+
 void
 SyncLogicHandler::createSyncSocket(Nlsr& pnlsr)
 {
@@ -24,8 +27,8 @@
                                       Sync::SyncSocket* socket, Nlsr& pnlsr)
 {
   std::cout << "nsyncUpdateCallBack called ...." << std::endl;
-  int n = v.size();
-  for (int i = 0; i < n; i++)
+  int32_t n = v.size();
+  for (int32_t i = 0; i < n; i++)
   {
     std::cout << "Data Name: " << v[i].prefix << " Seq: " << v[i].high.getSeq() <<
               endl;
@@ -40,12 +43,12 @@
 }
 
 void
-SyncLogicHandler::removeRouterFromSyncing(string& routerPrefix)
+SyncLogicHandler::removeRouterFromSyncing(const string& routerPrefix)
 {
 }
 
 void
-SyncLogicHandler::processUpdateFromSync(std::string updateName,
+SyncLogicHandler::processUpdateFromSync(const std::string& updateName,
                                         uint64_t seqNo,  Nlsr& pnlsr)
 {
   Tokenizer nt(updateName, "/");
@@ -66,7 +69,7 @@
 }
 
 void
-SyncLogicHandler::processRoutingUpdateFromSync(std::string routerName,
+SyncLogicHandler::processRoutingUpdateFromSync(const std::string& routerName,
                                                uint64_t seqNo,  Nlsr& pnlsr)
 {
   if (routerName != pnlsr.getConfParameter().getRouterPrefix())
@@ -123,7 +126,7 @@
 
 void
 SyncLogicHandler::publishRoutingUpdate(SequencingManager& sm,
-                                       string updatePrefix)
+                                       const string& updatePrefix)
 {
   sm.writeSeqNoToFile();
   publishSyncUpdate(updatePrefix, sm.getCombinedSeqNo());
@@ -136,13 +139,13 @@
 // }
 
 void
-SyncLogicHandler::publishIdentityUpdate(string identityName)
+SyncLogicHandler::publishIdentityUpdate(const string& identityName)
 {
   publishSyncUpdate(identityName, 0);
 }
 
 void
-SyncLogicHandler::publishSyncUpdate(string updatePrefix, uint64_t seqNo)
+SyncLogicHandler::publishSyncUpdate(const string& updatePrefix, uint64_t seqNo)
 {
   std::cout << "Publishing Sync Update ......" << std::endl;
   std::cout << "Update in prefix: " << updatePrefix << std::endl;
diff --git a/src/communication/sync-logic-handler.hpp b/src/communication/sync-logic-handler.hpp
index 1896484..9f6badd 100644
--- a/src/communication/sync-logic-handler.hpp
+++ b/src/communication/sync-logic-handler.hpp
@@ -1,7 +1,8 @@
-#ifndef NLSR_SLH_HPP
-#define NLSR_SLH_HPP
+#ifndef NLSR_SYNC_LOGIC_HANDLER_HPP
+#define NLSR_SYNC_LOGIC_HANDLER_HPP
 
 #include <iostream>
+#include <boost/cstdint.hpp>
 
 #include <ndn-cxx/face.hpp>
 #include <nsync/sync-socket.h>
@@ -24,7 +25,7 @@
 class SyncLogicHandler
 {
 public:
-  SyncLogicHandler(ndn::shared_ptr<boost::asio::io_service> ioService)
+  SyncLogicHandler(boost::asio::io_service& ioService)
     : m_validator(new ndn::ValidatorNull())
     , m_syncFace(new ndn::Face(ioService))
   {}
@@ -34,26 +35,26 @@
   createSyncSocket(Nlsr& pnlsr);
 
   void
-  nsyncUpdateCallBack(const vector<Sync::MissingDataInfo>& v,
+  nsyncUpdateCallBack(const std::vector<Sync::MissingDataInfo>& v,
                       Sync::SyncSocket* socket, Nlsr& pnlsr);
 
   void
-  nsyncRemoveCallBack(const string& prefix, Nlsr& pnlsr);
+  nsyncRemoveCallBack(const std::string& prefix, Nlsr& pnlsr);
 
   void
-  removeRouterFromSyncing(string& routerPrefix);
+  removeRouterFromSyncing(const std::string& routerPrefix);
 
   void
-  publishRoutingUpdate(SequencingManager& sm, string updatePrefix);
+  publishRoutingUpdate(SequencingManager& sm, const std::string& updatePrefix);
 
   // void
   // publishKeyUpdate(KeyManager& km);
 
   void
-  publishIdentityUpdate(string identityName);
+  publishIdentityUpdate(const std::string& identityName);
 
   void
-  setSyncPrefix(string sp)
+  setSyncPrefix(const std::string& sp)
   {
     m_syncPrefix.clear();
     m_syncPrefix.set(sp);
@@ -61,17 +62,17 @@
 
 private:
   void
-  processUpdateFromSync(std::string updateName, uint64_t seqNo, Nlsr& pnlsr);
+  processUpdateFromSync(const std::string& updateName, uint64_t seqNo, Nlsr& pnlsr);
 
   void
-  processRoutingUpdateFromSync(std::string routerName, uint64_t seqNo,
+  processRoutingUpdateFromSync(const std::string& routerName, uint64_t seqNo,
                                Nlsr& pnlsr);
 
   // void
   // processKeysUpdateFromSync(std::string certName, uint64_t seqNo, Nlsr& pnlsr);
 
   void
-  publishSyncUpdate(string updatePrefix, uint64_t seqNo);
+  publishSyncUpdate(const std::string& updatePrefix, uint64_t seqNo);
 
 private:
   ndn::shared_ptr<ndn::ValidatorNull> m_validator;
@@ -82,4 +83,4 @@
 
 } //namespace nlsr
 
-#endif //NLSR_SLH_HPP
+#endif //NLSR_SYNC_LOGIC_HANDLER_HPP
diff --git a/src/conf-file-processor.hpp b/src/conf-file-processor.hpp
index c4015a3..61265b7 100644
--- a/src/conf-file-processor.hpp
+++ b/src/conf-file-processor.hpp
@@ -1,6 +1,7 @@
-#ifndef CONF_PROCESSOR_HPP
-#define CONF_PROCESSOR_HPP
+#ifndef CONF_FILE_PROCESSOR_HPP
+#define CONF_FILE_PROCESSOR_HPP
 
+#include <boost/cstdint.hpp>
 #include "nlsr.hpp"
 
 namespace nlsr {
@@ -8,7 +9,7 @@
 class ConfFileProcessor
 {
 public:
-  ConfFileProcessor(Nlsr& nlsr, const string& cfile)
+  ConfFileProcessor(Nlsr& nlsr, const std::string& cfile)
     : m_confFileName(cfile)
     , m_nlsr(nlsr)
   {
@@ -18,70 +19,70 @@
 
 private:
   int
-  processConfCommand(string command);
+  processConfCommand(std::string command);
 
   int
-  processConfCommandNetwork(string command);
+  processConfCommandNetwork(std::string command);
 
   int
-  processConfCommandSiteName(string command);
+  processConfCommandSiteName(std::string command);
 
   int
-  processConfCommandRootKeyPrefix(string command);
+  processConfCommandRootKeyPrefix(std::string command);
 
   int
-  processConfCommandRouterName(string command);
+  processConfCommandRouterName(std::string command);
 
   int
-  processConfCommandInterestRetryNumber(string command);
+  processConfCommandInterestRetryNumber(std::string command);
 
   int
-  processConfCommandInterestResendTime(string command);
+  processConfCommandInterestResendTime(std::string command);
 
   int
-  processConfCommandLsaRefreshTime(string command);
+  processConfCommandLsaRefreshTime(std::string command);
 
   int
-  processConfCommandMaxFacesPerPrefix(string command);
+  processConfCommandMaxFacesPerPrefix(std::string command);
 
   int
-  processConfCommandTunnelType(string command);
+  processConfCommandTunnelType(std::string command);
 
   int
-  processConfCommandChronosyncSyncPrefix(string command);
+  processConfCommandChronosyncSyncPrefix(std::string command);
 
   int
-  processConfCommandLogDir(string command);
+  processConfCommandLogDir(std::string command);
 
   int
-  processConfCommandCertDir(string command);
+  processConfCommandCertDir(std::string command);
 
   int
-  processConfCommandDebugging(string command);
+  processConfCommandDebugging(std::string command);
 
   int
-  processConfCommandDetailedLogging(string command);
+  processConfCommandDetailedLogging(std::string command);
 
   int
-  processConfCommandIsHyperbolicCalc(string command);
+  processConfCommandIsHyperbolicCalc(std::string command);
 
   int
-  processConfCommandHyperbolicCordinate(string command);
+  processConfCommandHyperbolicCordinate(std::string command);
 
   int
-  processConfCommandNdnNeighbor(string command);
+  processConfCommandNdnNeighbor(std::string command);
 
   int
-  processConfCommandNdnName(string command);
+  processConfCommandNdnName(std::string command);
 
   int
-  processConfCommandLinkCost(string command);
+  processConfCommandLinkCost(std::string command);
 
 
 private:
-  string m_confFileName;
+  std::string m_confFileName;
   Nlsr& m_nlsr;
 };
 
 } //namespace nlsr
-#endif //CONF_PROCESSOR_HPP
+#endif //CONF_FILE_PROCESSOR_HPP
diff --git a/src/conf-parameter.hpp b/src/conf-parameter.hpp
index 7dc8c76..49a8a4d 100644
--- a/src/conf-parameter.hpp
+++ b/src/conf-parameter.hpp
@@ -1,7 +1,8 @@
-#ifndef CONF_PARAM_HPP
-#define CONF_PARAM_HPP
+#ifndef CONF_PARAMETER_HPP
+#define CONF_PARAMETER_HPP
 
 #include <iostream>
+#include <boost/cstdint.hpp>
 
 namespace nlsr {
 class ConfParameter
@@ -34,7 +35,7 @@
     m_routerName = rn;
   }
 
-  std::string
+  const std::string&
   getRouterName()
   {
     return m_routerName;
@@ -46,7 +47,7 @@
     m_siteName = sn;
   }
 
-  std::string
+  const std::string&
   getSiteName()
   {
     return m_siteName;
@@ -58,7 +59,7 @@
     m_network = nn;
   }
 
-  std::string
+  const std::string&
   getNetwork()
   {
     return m_network;
@@ -70,13 +71,13 @@
     m_routerPrefix = "/" + m_network + "/" + m_siteName + "/" + m_routerName;
   }
 
-  std::string
+  const std::string&
   getRouterPrefix()
   {
     return m_routerPrefix;
   }
 
-  std::string
+  const std::string&
   getRootKeyPrefix()
   {
     return m_rootKeyPrefix;
@@ -89,68 +90,68 @@
   }
 
   void
-  setInterestRetryNumber(int irn)
+  setInterestRetryNumber(uint32_t irn)
   {
     m_interestRetryNumber = irn;
   }
 
-  int
+  uint32_t
   getInterestRetryNumber()
   {
     return m_interestRetryNumber;
   }
 
   void
-  setInterestResendTime(int irt)
+  setInterestResendTime(int32_t irt)
   {
     m_interestResendTime = irt;
   }
 
-  int
+  int32_t
   getInterestResendTime()
   {
     return m_interestResendTime;
   }
 
   void
-  setLsaRefreshTime(int lrt)
+  setLsaRefreshTime(int32_t lrt)
   {
     m_lsaRefreshTime = lrt;
     m_routerDeadInterval = 2 * m_lsaRefreshTime;
   }
 
-  int
+  int32_t
   getLsaRefreshTime()
   {
     return m_lsaRefreshTime;
   }
 
   void
-  setRouterDeadInterval(int rdt)
+  setRouterDeadInterval(int64_t rdt)
   {
     m_routerDeadInterval = rdt;
   }
 
-  long int
+  int64_t
   getRouterDeadInterval()
   {
     return m_routerDeadInterval;
   }
 
   void
-  setMaxFacesPerPrefix(int mfpp)
+  setMaxFacesPerPrefix(int32_t mfpp)
   {
     m_maxFacesPerPrefix = mfpp;
   }
 
-  int
+  int32_t
   getMaxFacesPerPrefix()
   {
     return m_maxFacesPerPrefix;
   }
 
   void
-  setLogDir(std::string ld)
+  setLogDir(const std::string& ld)
   {
     m_logDir = ld;
   }
@@ -162,24 +163,24 @@
   }
 
   void
-  setCertDir(std::string cd)
+  setCertDir(const std::string& cd)
   {
     m_certDir = cd;
   }
 
-  std::string
+  const std::string&
   getCertDir()
   {
     return m_certDir;
   }
 
   void
-  setSeqFileDir(std::string ssfd)
+  setSeqFileDir(const std::string& ssfd)
   {
     m_seqFileDir = ssfd;
   }
 
-  std::string
+  const std::string&
   getSeqFileDir()
   {
     return m_seqFileDir;
@@ -198,24 +199,24 @@
   }
 
   void
-  setDebugging(int d)
+  setDebugging(int32_t d)
   {
     m_debugging = d;
   }
 
-  int
+  int32_t
   getDebugging()
   {
     return m_debugging;
   }
 
   void
-  setIsHyperbolicCalc(int ihc)
+  setIsHyperbolicCalc(int32_t ihc)
   {
     m_isHyperbolicCalc = ihc;
   }
 
-  int
+  int32_t
   getIsHyperbolicCalc()
   {
     return m_isHyperbolicCalc;
@@ -251,7 +252,7 @@
     m_tunnelType = tt;
   }
 
-  int
+  int32_t
   getTunnelType()
   {
     return m_tunnelType;
@@ -263,32 +264,32 @@
     m_chronosyncSyncPrefix = csp;
   }
 
-  std::string
+  const std::string&
   getChronosyncSyncPrefix()
   {
     return m_chronosyncSyncPrefix;
   }
 
   void
-  setChronosyncLsaPrefix(std::string clp)
+  setChronosyncLsaPrefix(const std::string& clp)
   {
     m_chronosyncLsaPrefix = clp;
   }
 
-  std::string
+  const std::string&
   getChronosyncLsaPrefix()
   {
     return m_chronosyncLsaPrefix;
   }
 
-  int
+  int32_t
   getInfoInterestInterval()
   {
     return m_infoInterestInterval;
   }
 
   void
-  setInfoInterestInterval(int iii)
+  setInfoInterestInterval(int32_t iii)
   {
     m_infoInterestInterval = iii;
   }
@@ -305,21 +306,21 @@
   std::string m_chronosyncLsaPrefix;
   std::string m_rootKeyPrefix;
 
-  int m_interestRetryNumber;
-  int m_interestResendTime;
-  int m_infoInterestInterval;
-  int m_lsaRefreshTime;
-  int m_routerDeadInterval;
+  uint32_t m_interestRetryNumber;
+  int32_t m_interestResendTime;
+  int32_t m_infoInterestInterval;
+  int32_t m_lsaRefreshTime;
+  int64_t m_routerDeadInterval;
 
-  int m_maxFacesPerPrefix;
-  int m_tunnelType;
-  int m_detailedLogging;
+  int32_t m_maxFacesPerPrefix;
+  int32_t m_tunnelType;
+  int32_t m_detailedLogging;
 
   std::string m_certDir;
-  int m_debugging;
+  int32_t m_debugging;
   std::string m_seqFileDir;
 
-  int m_isHyperbolicCalc;
+  int32_t m_isHyperbolicCalc;
   double m_corR;
   double m_corTheta;
 
@@ -333,4 +334,4 @@
 
 } // namespace nlsr
 
-#endif //CONF_PARAM_HPP
+#endif //CONF_PARAMETER_HPP
diff --git a/src/lsa.cpp b/src/lsa.cpp
index dac54a2..5f76eda 100644
--- a/src/lsa.cpp
+++ b/src/lsa.cpp
@@ -26,7 +26,7 @@
 }
 
 NameLsa::NameLsa(string origR, uint8_t lst, uint32_t lsn, uint32_t lt,
-                 NamePrefixList npl)
+                 NamePrefixList& npl)
 {
   m_origRouter = origR;
   m_lsType = lst;
@@ -132,7 +132,7 @@
 }
 
 bool
-CoordinateLsa::isEqual(const CoordinateLsa& clsa)
+CoordinateLsa::isEqualContent(const CoordinateLsa& clsa)
 {
   return (std::abs(m_corRad - clsa.getCorRadius()) <
           std::numeric_limits<double>::epsilon()) &&
@@ -192,7 +192,7 @@
 
 
 AdjLsa::AdjLsa(string origR, uint8_t lst, uint32_t lsn, uint32_t lt,
-               uint32_t nl , AdjacencyList adl)
+               uint32_t nl , AdjacencyList& adl)
 {
   m_origRouter = origR;
   m_lsType = lst;
@@ -218,9 +218,9 @@
 }
 
 bool
-AdjLsa::isEqual(AdjLsa& alsa)
+AdjLsa::isEqualContent(AdjLsa& alsa)
 {
-  return m_adl.isEqual(alsa.getAdl());
+  return m_adl == alsa.getAdl();
 }
 
 
@@ -291,7 +291,7 @@
 {
   if (getOrigRouter() != pnlsr.getConfParameter().getRouterPrefix())
   {
-    pnlsr.getNamePrefixTable().addNpteByDestName(getOrigRouter(), getOrigRouter(),
+    pnlsr.getNamePrefixTable().addEntry(getOrigRouter(), getOrigRouter(),
                                                  pnlsr);
   }
 }
@@ -302,7 +302,7 @@
 {
   if (getOrigRouter() != pnlsr.getConfParameter().getRouterPrefix())
   {
-    pnlsr.getNamePrefixTable().removeNpte(getOrigRouter(), getOrigRouter(), pnlsr);
+    pnlsr.getNamePrefixTable().removeEntry(getOrigRouter(), getOrigRouter(), pnlsr);
   }
 }
 
diff --git a/src/lsa.hpp b/src/lsa.hpp
index 1db70d7..3a86c09 100644
--- a/src/lsa.hpp
+++ b/src/lsa.hpp
@@ -1,6 +1,7 @@
 #ifndef NLSR_LSA_HPP
 #define NLSR_LSA_HPP
 
+#include <boost/cstdint.hpp>
 #include <ndn-cxx/util/scheduler.hpp>
 #include "adjacent.hpp"
 #include "name-prefix-list.hpp"
@@ -98,7 +99,7 @@
   }
 
   NameLsa(std::string origR, uint8_t lst, uint32_t lsn, uint32_t lt,
-          NamePrefixList npl);
+          NamePrefixList& npl);
 
   NamePrefixList&
   getNpl()
@@ -149,7 +150,7 @@
   }
 
   AdjLsa(std::string origR, uint8_t lst, uint32_t lsn, uint32_t lt,
-         uint32_t nl , AdjacencyList adl);
+         uint32_t nl , AdjacencyList& adl);
 
   AdjacencyList&
   getAdl()
@@ -179,7 +180,7 @@
   }
 
   bool
-  isEqual(AdjLsa& alsa);
+  isEqualContent(AdjLsa& alsa);
 
   void
   addNptEntries(Nlsr& pnlsr);
@@ -250,7 +251,7 @@
   }
 
   bool
-  isEqual(const CoordinateLsa& clsa);
+  isEqualContent(const CoordinateLsa& clsa);
 
 private:
   double m_corRad;
diff --git a/src/lsdb.cpp b/src/lsdb.cpp
index a96cecb..7cdd4b6 100644
--- a/src/lsdb.cpp
+++ b/src/lsdb.cpp
@@ -8,7 +8,7 @@
 using namespace std;
 
 void
-Lsdb::cancelScheduleLsaExpiringEvent(Nlsr& pnlsr, EventId eid)
+Lsdb::cancelScheduleLsaExpiringEvent(Nlsr& pnlsr, ndn::EventId eid)
 {
   pnlsr.getScheduler().cancelEvent(eid);
 }
@@ -23,13 +23,12 @@
 bool
 Lsdb::buildAndInstallOwnNameLsa(Nlsr& pnlsr)
 {
-  NameLsa nameLsa(pnlsr.getConfParameter().getRouterPrefix()
-                  , 1
-                  , pnlsr.getSequencingManager().getNameLsaSeq() + 1
-                  , pnlsr.getConfParameter().getRouterDeadInterval()
-                  , pnlsr.getNamePrefixList());
-  pnlsr.getSequencingManager().setNameLsaSeq(
-    pnlsr.getSequencingManager().getNameLsaSeq() + 1);
+  NameLsa nameLsa(pnlsr.getConfParameter().getRouterPrefix(),
+                  1,
+                  pnlsr.getSequencingManager().getNameLsaSeq() + 1,
+                  pnlsr.getConfParameter().getRouterDeadInterval(),
+                  pnlsr.getNamePrefixList());
+  pnlsr.getSequencingManager().increaseNameLsaSeq();
   return installNameLsa(pnlsr, nameLsa);
 }
 
@@ -84,17 +83,15 @@
     printNameLsdb();
     if (nlsa.getOrigRouter() != pnlsr.getConfParameter().getRouterPrefix())
     {
-      pnlsr.getNamePrefixTable().addNpteByDestName(nlsa.getOrigRouter(),
-                                                   nlsa.getOrigRouter(),
-                                                   pnlsr);
+      pnlsr.getNamePrefixTable().addEntry(nlsa.getOrigRouter(),
+                                          nlsa.getOrigRouter(), pnlsr);
       std::list<string> nameList = nlsa.getNpl().getNameList();
       for (std::list<string>::iterator it = nameList.begin(); it != nameList.end();
            it++)
       {
         if ((*it) != pnlsr.getConfParameter().getRouterPrefix())
         {
-          pnlsr.getNamePrefixTable().addNpteByDestName((*it), nlsa.getOrigRouter(),
-                                                       pnlsr);
+          pnlsr.getNamePrefixTable().addEntry((*it), nlsa.getOrigRouter(), pnlsr);
         }
       }
     }
@@ -130,8 +127,7 @@
         {
           if ((*it) != pnlsr.getConfParameter().getRouterPrefix())
           {
-            pnlsr.getNamePrefixTable().addNpteByDestName((*it), nlsa.getOrigRouter(),
-                                                         pnlsr);
+            pnlsr.getNamePrefixTable().addEntry((*it), nlsa.getOrigRouter(), pnlsr);
           }
         }
       }
@@ -149,7 +145,7 @@
         {
           if ((*it) != pnlsr.getConfParameter().getRouterPrefix())
           {
-            pnlsr.getNamePrefixTable().removeNpte((*it), nlsa.getOrigRouter(), pnlsr);
+            pnlsr.getNamePrefixTable().removeEntry((*it), nlsa.getOrigRouter(), pnlsr);
           }
         }
       }
@@ -195,14 +191,14 @@
     (*it).writeLog();
     if ((*it).getOrigRouter() != pnlsr.getConfParameter().getRouterPrefix())
     {
-      pnlsr.getNamePrefixTable().removeNpte((*it).getOrigRouter(),
-                                            (*it).getOrigRouter(), pnlsr);
+      pnlsr.getNamePrefixTable().removeEntry((*it).getOrigRouter(),
+                                             (*it).getOrigRouter(), pnlsr);
       for (std::list<string>::iterator nit = (*it).getNpl().getNameList().begin();
            nit != (*it).getNpl().getNameList().end(); ++nit)
       {
         if ((*nit) != pnlsr.getConfParameter().getRouterPrefix())
         {
-          pnlsr.getNamePrefixTable().removeNpte((*nit), (*it).getOrigRouter(), pnlsr);
+          pnlsr.getNamePrefixTable().removeEntry((*nit), (*it).getOrigRouter(), pnlsr);
         }
       }
     }
@@ -248,14 +244,13 @@
 bool
 Lsdb::buildAndInstallOwnCoordinateLsa(Nlsr& pnlsr)
 {
-  CoordinateLsa corLsa(pnlsr.getConfParameter().getRouterPrefix()
-                       , 3
-                       , pnlsr.getSequencingManager().getCorLsaSeq() + 1
-                       , pnlsr.getConfParameter().getRouterDeadInterval()
-                       , pnlsr.getConfParameter().getCorR()
-                       , pnlsr.getConfParameter().getCorTheta());
-  pnlsr.getSequencingManager().setCorLsaSeq(
-    pnlsr.getSequencingManager().getCorLsaSeq() + 1);
+  CoordinateLsa corLsa(pnlsr.getConfParameter().getRouterPrefix(),
+                       3,
+                       pnlsr.getSequencingManager().getCorLsaSeq() + 1,
+                       pnlsr.getConfParameter().getRouterDeadInterval(),
+                       pnlsr.getConfParameter().getCorR(),
+                       pnlsr.getConfParameter().getCorTheta());
+  pnlsr.getSequencingManager().increaseCorLsaSeq();
   installCoordinateLsa(pnlsr, corLsa);
   return true;
 }
@@ -312,9 +307,8 @@
     printCorLsdb(); //debugging purpose
     if (clsa.getOrigRouter() != pnlsr.getConfParameter().getRouterPrefix())
     {
-      pnlsr.getNamePrefixTable().addNpteByDestName(clsa.getOrigRouter(),
-                                                   clsa.getOrigRouter(),
-                                                   pnlsr);
+      pnlsr.getNamePrefixTable().addEntry(clsa.getOrigRouter(),
+                                          clsa.getOrigRouter(), pnlsr);
     }
     if (pnlsr.getConfParameter().getIsHyperbolicCalc() >= 1)
     {
@@ -333,7 +327,7 @@
     {
       chkCorLsa->setLsSeqNo(clsa.getLsSeqNo());
       chkCorLsa->setLifeTime(clsa.getLifeTime());
-      if (!chkCorLsa->isEqual(clsa))
+      if (!chkCorLsa->isEqualContent(clsa))
       {
         chkCorLsa->setCorRadius(clsa.getCorRadius());
         chkCorLsa->setCorTheta(clsa.getCorTheta());
@@ -382,8 +376,8 @@
   {
     if ((*it).getOrigRouter() != pnlsr.getConfParameter().getRouterPrefix())
     {
-      pnlsr.getNamePrefixTable().removeNpte((*it).getOrigRouter(),
-                                            (*it).getOrigRouter(), pnlsr);
+      pnlsr.getNamePrefixTable().removeEntry((*it).getOrigRouter(),
+                                             (*it).getOrigRouter(), pnlsr);
     }
     m_corLsdb.erase(it);
     return true;
@@ -540,10 +534,10 @@
     {
       chkAdjLsa->setLsSeqNo(alsa.getLsSeqNo());
       chkAdjLsa->setLifeTime(alsa.getLifeTime());
-      if (!chkAdjLsa->isEqual(alsa))
+      if (!chkAdjLsa->isEqualContent(alsa))
       {
         chkAdjLsa->getAdl().reset();
-        chkAdjLsa->getAdl().addAdjacentsFromAdl(alsa.getAdl());
+        chkAdjLsa->getAdl().addAdjacents(alsa.getAdl());
         pnlsr.getRoutingTable().scheduleRoutingTableCalculation(pnlsr);
       }
       if (alsa.getOrigRouter() != pnlsr.getConfParameter().getRouterPrefix())
@@ -563,16 +557,15 @@
 bool
 Lsdb::buildAndInstallOwnAdjLsa(Nlsr& pnlsr)
 {
-  AdjLsa adjLsa(pnlsr.getConfParameter().getRouterPrefix()
-                , 2
-                , pnlsr.getSequencingManager().getAdjLsaSeq() + 1
-                , pnlsr.getConfParameter().getRouterDeadInterval()
-                , pnlsr.getAdjacencyList().getNumOfActiveNeighbor()
-                , pnlsr.getAdjacencyList());
-  pnlsr.getSequencingManager().setAdjLsaSeq(
-    pnlsr.getSequencingManager().getAdjLsaSeq() + 1);
-  string lsaPrefix = pnlsr.getConfParameter().getChronosyncLsaPrefix()
-                     + pnlsr.getConfParameter().getRouterPrefix();
+  AdjLsa adjLsa(pnlsr.getConfParameter().getRouterPrefix(),
+                2,
+                pnlsr.getSequencingManager().getAdjLsaSeq() + 1,
+                pnlsr.getConfParameter().getRouterDeadInterval(),
+                pnlsr.getAdjacencyList().getNumOfActiveNeighbor(),
+                pnlsr.getAdjacencyList());
+  pnlsr.getSequencingManager().increaseAdjLsaSeq();
+  string lsaPrefix = pnlsr.getConfParameter().getChronosyncLsaPrefix() +
+                     pnlsr.getConfParameter().getRouterPrefix();
   pnlsr.getSyncLogicHandler().publishRoutingUpdate(pnlsr.getSequencingManager(),
                                                    lsaPrefix);
   return pnlsr.getLsdb().installAdjLsa(pnlsr, adjLsa);
@@ -642,6 +635,11 @@
         chkNameLsa->setLsSeqNo(chkNameLsa->getLsSeqNo() + 1);
         pnlsr.getSequencingManager().setNameLsaSeq(chkNameLsa->getLsSeqNo());
         chkNameLsa->writeLog();
+        // schedule refreshing event again
+        chkNameLsa->setExpiringEventId(scheduleNameLsaExpiration(pnlsr,
+                                                                 chkNameLsa->getKey(),
+                                                                 chkNameLsa->getLsSeqNo(),
+                                                                 m_lsaRefreshTime));
         // publish routing update
         string lsaPrefix = pnlsr.getConfParameter().getChronosyncLsaPrefix()
                            + pnlsr.getConfParameter().getRouterPrefix();
@@ -673,6 +671,11 @@
         cout << "Own Adj LSA, so refreshing Adj LSA" << endl;
         chkAdjLsa->setLsSeqNo(chkAdjLsa->getLsSeqNo() + 1);
         pnlsr.getSequencingManager().setAdjLsaSeq(chkAdjLsa->getLsSeqNo());
+        // schedule refreshing event again
+        chkAdjLsa->setExpiringEventId(scheduleAdjLsaExpiration(pnlsr,
+                                                               chkAdjLsa->getKey(),
+                                                               chkAdjLsa->getLsSeqNo(),
+                                                               m_lsaRefreshTime));
         // publish routing update
         string lsaPrefix = pnlsr.getConfParameter().getChronosyncLsaPrefix()
                            + pnlsr.getConfParameter().getRouterPrefix();
@@ -707,6 +710,11 @@
         cout << "Own Cor LSA, so refreshing Cor LSA" << endl;
         chkCorLsa->setLsSeqNo(chkCorLsa->getLsSeqNo() + 1);
         pnlsr.getSequencingManager().setCorLsaSeq(chkCorLsa->getLsSeqNo());
+        // schedule refreshing event again
+        chkCorLsa->setExpiringEventId(scheduleCoordinateLsaExpiration(pnlsr,
+                                                                      chkCorLsa->getKey(),
+                                                                      chkCorLsa->getLsSeqNo(),
+                                                                      m_lsaRefreshTime));
         // publish routing update
         string lsaPrefix = pnlsr.getConfParameter().getChronosyncLsaPrefix()
                            + pnlsr.getConfParameter().getRouterPrefix();
diff --git a/src/lsdb.hpp b/src/lsdb.hpp
index 9814034..9e8c207 100644
--- a/src/lsdb.hpp
+++ b/src/lsdb.hpp
@@ -2,6 +2,8 @@
 #define NLSR_LSDB_HPP
 
 #include <utility>
+#include <boost/cstdint.hpp>
+
 #include "lsa.hpp"
 
 namespace nlsr {
diff --git a/src/main.cpp b/src/main.cpp
index b6c4b5c..d7657fa 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -17,19 +17,19 @@
  * You should have received a copy of the GNU General Public License along with
  * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
  **/
-
+#include <boost/cstdint.hpp>
 #include "nlsr.hpp"
 #include "conf-file-processor.hpp"
 
 using namespace nlsr;
 
-int
-main(int argc, char** argv)
+int32_t
+main(int32_t argc, char** argv)
 {
   nlsr::Nlsr nlsr;
-  string programName(argv[0]);
+  std::string programName(argv[0]);
   nlsr.setConfFileName("nlsr.conf");
-  int opt;
+  int32_t opt;
   while ((opt = getopt(argc, argv, "df:p:h")) != -1)
   {
     switch (opt)
@@ -42,7 +42,7 @@
         break;
       case 'p':
       {
-        stringstream sst(optarg);
+        std::stringstream sst(optarg);
         int ap;
         sst >> ap;
         nlsr.setApiPort(ap);
@@ -55,7 +55,7 @@
     }
   }
   ConfFileProcessor cfp(nlsr, nlsr.getConfFileName());
-  int res = cfp.processConfFile();
+  int32_t res = cfp.processConfFile();
   if (res < 0)
   {
     std::cerr << "Error in configuration file processing! Exiting from NLSR" <<
@@ -63,13 +63,12 @@
     return EXIT_FAILURE;
   }
   nlsr.initialize();
-  try
-  {
+  try {
     nlsr.startEventLoop();
   }
-  catch (std::exception& e)
-  {
+  catch (std::exception& e){
     std::cerr << "ERROR: " << e.what() << std::endl;
+    nlsr.getFib().clean(nlsr);
   }
   return EXIT_SUCCESS;
 }
diff --git a/src/name-prefix-list.cpp b/src/name-prefix-list.cpp
index 763fc0d..496a0e7 100644
--- a/src/name-prefix-list.cpp
+++ b/src/name-prefix-list.cpp
@@ -23,8 +23,8 @@
   return s1 == s2;
 }
 
-int
-NamePrefixList::insert(string& name)
+int32_t
+NamePrefixList::insert(const string& name)
 {
   std::list<string>::iterator it = std::find_if(m_nameList.begin(),
                                                 m_nameList.end(),
@@ -37,8 +37,8 @@
   return 0;
 }
 
-int
-NamePrefixList::remove(string& name)
+int32_t
+NamePrefixList::remove(const string& name)
 {
   std::list<string>::iterator it = std::find_if(m_nameList.begin(),
                                                 m_nameList.end(),
diff --git a/src/name-prefix-list.hpp b/src/name-prefix-list.hpp
index 9d32dde..dda4508 100644
--- a/src/name-prefix-list.hpp
+++ b/src/name-prefix-list.hpp
@@ -1,8 +1,9 @@
-#ifndef NPL_HPP
-#define NPL_HPP
+#ifndef NLSR_NAME_PREFIX_LIST_HPP
+#define NLSR_NAME_PREFIX_LIST_HPP
 
 #include <list>
 #include <string>
+#include <boost/cstdint.hpp>
 
 
 namespace nlsr {
@@ -14,16 +15,16 @@
 
   ~NamePrefixList();
 
-  int
-  insert(std::string& name);
+  int32_t
+  insert(const std::string& name);
 
-  int
-  remove(std::string& name);
+  int32_t
+  remove(const std::string& name);
 
   void
   sort();
 
-  int
+  int32_t
   getSize()
   {
     return m_nameList.size();
@@ -45,4 +46,4 @@
 
 }//namespace nlsr
 
-#endif //NPL_HPP
+#endif //NLSR_NAME_PREFIX_LIST_HPP
diff --git a/src/nlsr.cpp b/src/nlsr.cpp
index f4616ce..22e7dc8 100644
--- a/src/nlsr.cpp
+++ b/src/nlsr.cpp
@@ -14,17 +14,18 @@
 void
 Nlsr::registrationFailed(const ndn::Name& name)
 {
-  cerr << "ERROR: Failed to register prefix in local hub's daemon" << endl;
-  getNlsrFace()->shutdown();
+  std::cerr << "ERROR: Failed to register prefix in local hub's daemon" << endl;
+  throw Error("Error: Prefix registration failed");
 }
 
 
 void
-Nlsr::setInterestFilterNlsr(const string& name)
+Nlsr::setInterestFilter(const string& name)
 {
-  getNlsrFace()->setInterestFilter(name,
-                                   ndn::bind(&InterestManager::processInterest, &m_interestManager, _1, _2),
-                                   ndn::bind(&Nlsr::registrationFailed, this, _1));
+  getNlsrFace().setInterestFilter(name,
+                                  ndn::bind(&InterestManager::processInterest,
+                                            &m_interestManager, _1, _2),
+                                  ndn::bind(&Nlsr::registrationFailed, this, _1));
 }
 
 void
@@ -47,10 +48,10 @@
   /* debugging purpose end */
   m_nlsrLsdb.buildAndInstallOwnNameLsa(boost::ref(*this));
   m_nlsrLsdb.buildAndInstallOwnCoordinateLsa(boost::ref(*this));
-  setInterestFilterNlsr(m_confParam.getRouterPrefix());
-  setInterestFilterNlsr(m_confParam.getChronosyncLsaPrefix() +
-                        m_confParam.getRouterPrefix());
-  setInterestFilterNlsr(m_confParam.getRootKeyPrefix());
+  setInterestFilter(m_confParam.getRouterPrefix());
+  setInterestFilter(m_confParam.getChronosyncLsaPrefix() +
+                    m_confParam.getRouterPrefix());
+  setInterestFilter(m_confParam.getRootKeyPrefix());
   m_syncLogicHandler.setSyncPrefix(m_confParam.getChronosyncSyncPrefix());
   m_syncLogicHandler.createSyncSocket(boost::ref(*this));
   // m_slh.publishKeyUpdate(m_km);
@@ -60,10 +61,10 @@
 void
 Nlsr::startEventLoop()
 {
-  m_io->run();
+  m_nlsrFace.processEvents();
 }
 
-int
+void
 Nlsr::usage(const string& progname)
 {
   cout << "Usage: " << progname << " [OPTIONS...]" << endl;
@@ -72,7 +73,6 @@
   cout << "       -f, --config_file   Specify configuration file name" << endl;
   cout << "       -p, --api_port      port where api client will connect" << endl;
   cout << "       -h, --help          Display this help message" << endl;
-  exit(EXIT_FAILURE);
 }
 
 
diff --git a/src/nlsr.hpp b/src/nlsr.hpp
index f6e3ba0..0e59adc 100644
--- a/src/nlsr.hpp
+++ b/src/nlsr.hpp
@@ -1,6 +1,9 @@
 #ifndef NLSR_HPP
 #define NLSR_HPP
 
+#include <boost/cstdint.hpp>
+#include <stdexcept>
+
 #include <ndn-cxx/face.hpp>
 #include <ndn-cxx/security/key-chain.hpp>
 #include <ndn-cxx/util/scheduler.hpp>
@@ -21,20 +24,21 @@
 
 namespace nlsr {
 
-inline static void
-NullDeleter(boost::asio::io_service* variable)
-{
-  // do nothing
-}
-
 class Nlsr
 {
+  class Error : public std::runtime_error
+  {
+  public:
+    explicit
+    Error(const std::string& what)
+      : std::runtime_error(what)
+    {
+    }
+  };
+
 public:
   Nlsr()
-    : m_io(new boost::asio::io_service)
-    , m_nlsrFace(new Face(ndn::shared_ptr<boost::asio::io_service>(&*m_io,
-                                                                   &NullDeleter)))
-    , m_scheduler(*m_io)
+    : m_scheduler(m_nlsrFace.getIoService())
     , m_confParam()
     , m_adjacencyList()
     , m_namePrefixList()
@@ -51,30 +55,30 @@
     , m_isRoutingTableCalculating(false)
     , m_routingTable()
     , m_namePrefixTable()
-    , m_fib()
-    , m_syncLogicHandler(m_io)
+    , m_fib(m_nlsrFace)
+    , m_syncLogicHandler(m_nlsrFace.getIoService())
   {}
 
   void
   registrationFailed(const ndn::Name& name);
 
   void
-  setInterestFilterNlsr(const string& name);
+  setInterestFilter(const std::string& name);
 
   void
   startEventLoop();
 
-  int
-  usage(const string& progname);
+  void
+  usage(const std::string& progname);
 
   std::string
-  getConfFileName()
+  getConfFileName() const
   {
     return m_configFileName;
   }
 
   void
-  setConfFileName(const string& fileName)
+  setConfFileName(const std::string& fileName)
   {
     m_configFileName = fileName;
   }
@@ -109,19 +113,13 @@
     return m_namePrefixList;
   }
 
-  ndn::shared_ptr<boost::asio::io_service>&
-  getIo()
-  {
-    return m_io;
-  }
-
   ndn::Scheduler&
   getScheduler()
   {
     return m_scheduler;
   }
 
-  ndn::shared_ptr<ndn::Face>
+  ndn::Face&
   getNlsrFace()
   {
     return m_nlsrFace;
@@ -189,7 +187,7 @@
   }
 
   void
-  setAdjBuildCount(long int abc)
+  setAdjBuildCount(int64_t abc)
   {
     m_adjBuildCount = abc;
   }
@@ -208,12 +206,12 @@
 
 
   void
-  setApiPort(int ap)
+  setApiPort(int32_t ap)
   {
     m_apiPort = ap;
   }
 
-  int
+  int32_t
   getApiPort()
   {
     return m_apiPort;
@@ -253,8 +251,7 @@
   initialize();
 
 private:
-  ndn::shared_ptr<boost::asio::io_service> m_io;
-  ndn::shared_ptr<ndn::Face> m_nlsrFace;
+  ndn::Face m_nlsrFace;
   ndn::Scheduler m_scheduler;
   ConfParameter m_confParam;
   AdjacencyList m_adjacencyList;
@@ -264,25 +261,17 @@
   SequencingManager m_sequencingManager;
   // KeyManager m_km;
   bool m_isDaemonProcess;
-  string m_configFileName;
-
-
+  std::string m_configFileName;
   Lsdb m_nlsrLsdb;
-
-
-  long int m_adjBuildCount;
+  int64_t m_adjBuildCount;
   bool m_isBuildAdjLsaSheduled;
   bool m_isRouteCalculationScheduled;
   bool m_isRoutingTableCalculating;
-
   RoutingTable m_routingTable;
   NamePrefixTable m_namePrefixTable;
   Fib m_fib;
   SyncLogicHandler m_syncLogicHandler;
-
-  int m_apiPort;
-
-
+  int32_t m_apiPort;
 };
 
 } //namespace nlsr
diff --git a/src/route/fib-entry.cpp b/src/route/fib-entry.cpp
index 05bee41..524b04c 100644
--- a/src/route/fib-entry.cpp
+++ b/src/route/fib-entry.cpp
@@ -9,17 +9,17 @@
 bool
 FibEntry::isEqualNextHops(NexthopList& nhlOther)
 {
-  if (m_nhl.getSize() != nhlOther.getSize())
+  if (m_nexthopList.getSize() != nhlOther.getSize())
   {
     return false;
   }
   else
   {
-    int nhCount = 0;
+    uint32_t nhCount = 0;
     std::list<NextHop>::iterator it1, it2;
-    for (it1 = m_nhl.getNextHopList().begin(),
-         it2 = nhlOther.getNextHopList().begin() ;
-         it1 != m_nhl.getNextHopList().end() ; it1++, it2++)
+    for (it1 = m_nexthopList.getNextHops().begin(),
+         it2 = nhlOther.getNextHops().begin() ;
+         it1 != m_nexthopList.getNextHops().end() ; it1++, it2++)
     {
       if (it1->getConnectingFace() == it2->getConnectingFace())
       {
@@ -31,7 +31,7 @@
         break;
       }
     }
-    return nhCount == m_nhl.getSize();
+    return nhCount == m_nexthopList.getSize();
   }
 }
 
@@ -40,7 +40,7 @@
 {
   os << "Name Prefix: " << fe.getName() << endl;
   os << "Time to Refresh: " << fe.getTimeToRefresh() << endl;
-  os << fe.getNhl() << endl;
+  os << fe.getNexthopList() << endl;
   return os;
 }
 
diff --git a/src/route/fib-entry.hpp b/src/route/fib-entry.hpp
index d320c9a..88de53e 100644
--- a/src/route/fib-entry.hpp
+++ b/src/route/fib-entry.hpp
@@ -1,8 +1,10 @@
-#ifndef NLSR_FE_HPP
-#define NLSR_FE_HPP
+#ifndef NLSR_FIB_ENTRY_HPP
+#define NLSR_FIB_ENTRY_HPP
 
 #include <list>
 #include <iostream>
+#include <boost/cstdint.hpp>
+
 #include <ndn-cxx/util/scheduler.hpp>
 
 #include "nexthop.hpp"
@@ -10,8 +12,6 @@
 
 namespace nlsr {
 
-using namespace std;
-
 class FibEntry
 {
 public:
@@ -19,38 +19,38 @@
     : m_name()
     , m_timeToRefresh(0)
     , m_seqNo(0)
-    , m_nhl()
+    , m_nexthopList()
   {
   }
 
-  FibEntry(string n)
+  FibEntry(const std::string& name)
     : m_timeToRefresh(0)
     , m_seqNo(0)
-    , m_nhl()
+    , m_nexthopList()
   {
-    m_name = n;
+    m_name = name;
   }
 
-  std::string
+  const std::string&
   getName() const
   {
     return m_name;
   }
 
   NexthopList&
-  getNhl()
+  getNexthopList()
   {
-    return m_nhl;
+    return m_nexthopList;
   }
 
-  int
+  int32_t
   getTimeToRefresh() const
   {
     return m_timeToRefresh;
   }
 
   void
-  setTimeToRefresh(int ttr)
+  setTimeToRefresh(int32_t ttr)
   {
     m_timeToRefresh = ttr;
   }
@@ -68,12 +68,12 @@
   }
 
   void
-  setSeqNo(int fsn)
+  setSeqNo(int32_t fsn)
   {
     m_seqNo = fsn;
   }
 
-  int
+  int32_t
   getSeqNo()
   {
     return m_seqNo;
@@ -84,10 +84,10 @@
 
 private:
   std::string m_name;
-  int m_timeToRefresh;
+  int32_t m_timeToRefresh;
   ndn::EventId m_expiringEventId;
-  int m_seqNo;
-  NexthopList m_nhl;
+  int32_t m_seqNo;
+  NexthopList m_nexthopList;
 };
 
 std::ostream&
@@ -95,4 +95,4 @@
 
 } //namespace nlsr
 
-#endif //NLSR_FE_HPP
+#endif //NLSR_FIB_ENTRY_HPP
diff --git a/src/route/fib.cpp b/src/route/fib.cpp
index 1d7582b..1272ab1 100644
--- a/src/route/fib.cpp
+++ b/src/route/fib.cpp
@@ -1,9 +1,10 @@
 #include <list>
+#include <cmath>
 
 #include "nlsr.hpp"
-#include "fib-entry.hpp"
-#include "fib.hpp"
 #include "nexthop-list.hpp"
+#include "fib.hpp"
+
 
 
 
@@ -13,9 +14,9 @@
 using namespace ndn;
 
 static bool
-fibEntryNameCompare(FibEntry& fe, string name)
+fibEntryNameCompare(const FibEntry& fibEntry, const string& name)
 {
-  return fe.getName() == name ;
+  return fibEntry.getName() == name ;
 }
 
 void
@@ -26,32 +27,78 @@
 
 
 ndn::EventId
-Fib::scheduleEntryRefreshing(Nlsr& pnlsr, string name, int feSeqNum,
-                             int refreshTime)
+Fib::scheduleEntryRefreshing(Nlsr& pnlsr, const string& name, int32_t feSeqNum,
+                             int32_t refreshTime)
 {
+  std::cout << "Fib::scheduleEntryRefreshing Called" << std::endl;
+  std::cout << "Name: " << name << " Seq Num: " << feSeqNum << std::endl;
   return pnlsr.getScheduler().scheduleEvent(ndn::time::seconds(refreshTime),
-                                            ndn::bind(&Fib::refreshEntry, this, name, feSeqNum));
+                                            ndn::bind(&Fib::refreshEntry, this,
+                                                      boost::ref(pnlsr), 
+                                                      name, feSeqNum));
 }
 
 void
-Fib::refreshEntry(string name, int feSeqNum)
+Fib::refreshEntry(Nlsr& nlsr, const string& name, int32_t feSeqNum)
 {
+  std::cout << "Fib::refreshEntry Called" << std::endl;
+  std::cout << "Name: " << name << " Seq Num: " << feSeqNum << std::endl;
+  std::list<FibEntry>::iterator it = std::find_if(m_table.begin(),
+                                                  m_table.end(),
+                                                  bind(&fibEntryNameCompare, _1, name));
+  if (it != m_table.end())
+  {
+    std::cout << "Entry found with Seq Num: " << feSeqNum << std::endl;
+    if (it->getSeqNo() == feSeqNum)
+    {
+      std::cout << "Refreshing the FIB entry" << std::endl;
+      for (std::list<NextHop>::iterator nhit =
+           (*it).getNexthopList().getNextHops().begin();
+         nhit != (*it).getNexthopList().getNextHops().end(); nhit++)
+      {
+        // add entry to NDN-FIB
+        registerPrefixInNfd(it->getName(), nhit->getConnectingFace(), std::ceil(nhit->getRouteCost()));
+      }
+      
+      // increase sequence number and schedule refresh again
+      it->setSeqNo(feSeqNum + 1);
+      it->setExpiringEventId(scheduleEntryRefreshing(nlsr,
+                                                     it->getName() ,
+                                                     it->getSeqNo(), 
+                                                     m_refreshTime));
+      
+    }
+  }
 }
 
 void
-Fib::remove(Nlsr& pnlsr, string name)
+Fib::remove(Nlsr& pnlsr, const std::string& name)
 {
   std::list<FibEntry>::iterator it = std::find_if(m_table.begin(),
-                                                  m_table.end(), 
+                                                  m_table.end(),
                                                   bind(&fibEntryNameCompare, _1, name));
   if (it != m_table.end())
   {
     for (std::list<NextHop>::iterator nhit =
-           (*it).getNhl().getNextHopList().begin();
-         nhit != (*it).getNhl().getNextHopList().begin(); nhit++)
+           (*it).getNexthopList().getNextHops().begin();
+         nhit != (*it).getNexthopList().getNextHops().end(); nhit++)
     {
       //remove entry from NDN-FIB
+      if (!pnlsr.getAdjacencyList().isNeighbor(it->getName()))
+      {
+        unregisterPrefixFromNfd(it->getName(), nhit->getConnectingFace());
+      }
+      else
+      {
+        if(pnlsr.getAdjacencyList().getAdjacent(it->getName()).getConnectingFace() != 
+           nhit->getConnectingFace())
+        {
+          unregisterPrefixFromNfd(it->getName(), nhit->getConnectingFace());
+        }
+      }
     }
+    std::cout << "Cancellling Scheduled event" << std::endl;
+    std::cout << "Name: " << name << "Seq num: " << it->getSeqNo() << std::endl;
     cancelScheduledExpiringEvent(pnlsr, (*it).getExpiringEventId());
     m_table.erase(it);
   }
@@ -59,7 +106,7 @@
 
 
 void
-Fib::update(Nlsr& pnlsr, string name, NexthopList& nextHopList)
+Fib::update(Nlsr& pnlsr, const string& name, NexthopList& nextHopList)
 {
   std::cout << "Fib::updateFib Called" << std::endl;
   int startFace = 0;
@@ -74,14 +121,15 @@
     {
       nextHopList.sort();
       FibEntry newEntry(name);
-      std::list<NextHop> nhl = nextHopList.getNextHopList();
+      std::list<NextHop> nhl = nextHopList.getNextHops();
       std::list<NextHop>::iterator nhit = nhl.begin();
       for (int i = startFace; i < endFace && nhit != nhl.end(); ++nhit, i++)
       {
-        newEntry.getNhl().addNextHop((*nhit));
+        newEntry.getNexthopList().addNextHop((*nhit));
         //Add entry to NDN-FIB
+        registerPrefixInNfd(name, nhit->getConnectingFace(), std::ceil(nhit->getRouteCost()));
       }
-      newEntry.getNhl().sort();
+      newEntry.getNexthopList().sort();
       newEntry.setTimeToRefresh(m_refreshTime);
       newEntry.setSeqNo(1);
       newEntry.setExpiringEventId(scheduleEntryRefreshing(pnlsr,
@@ -97,21 +145,25 @@
       nextHopList.sort();
       if (!it->isEqualNextHops(nextHopList))
       {
-        std::list<NextHop> nhl = nextHopList.getNextHopList();
+        std::list<NextHop> nhl = nextHopList.getNextHops();
         std::list<NextHop>::iterator nhit = nhl.begin();
         // Add first Entry to NDN-FIB
-        removeHop(pnlsr, it->getNhl(), nhit->getConnectingFace());
-        it->getNhl().reset();
-        it->getNhl().addNextHop((*nhit));
+        registerPrefixInNfd(name, nhit->getConnectingFace(), std::ceil(nhit->getRouteCost()));
+        removeHop(pnlsr, it->getNexthopList(), nhit->getConnectingFace(), name);
+        it->getNexthopList().reset();
+        it->getNexthopList().addNextHop((*nhit));
         ++startFace;
         ++nhit;
         for (int i = startFace; i < endFace && nhit != nhl.end(); ++nhit, i++)
         {
-          it->getNhl().addNextHop((*nhit));
+          it->getNexthopList().addNextHop((*nhit));
           //Add Entry to NDN_FIB
+          registerPrefixInNfd(name, nhit->getConnectingFace(), std::ceil(nhit->getRouteCost()));
         }
       }
       it->setTimeToRefresh(m_refreshTime);
+      std::cout << "Cancellling Scheduled event" << std::endl;
+      std::cout << "Name: " << name << "Seq num: " << it->getSeqNo() << std::endl;
       cancelScheduledExpiringEvent(pnlsr, it->getExpiringEventId());
       it->setSeqNo(it->getSeqNo() + 1);
       (*it).setExpiringEventId(scheduleEntryRefreshing(pnlsr,
@@ -133,12 +185,26 @@
   for (std::list<FibEntry>::iterator it = m_table.begin(); it != m_table.end();
        ++it)
   {
+    std::cout << "Cancellling Scheduled event" << std::endl;
+    std::cout << "Name: " << it->getName() << "Seq num: " << it->getSeqNo() << std::endl;
+    cancelScheduledExpiringEvent(pnlsr, (*it).getExpiringEventId());
     for (std::list<NextHop>::iterator nhit =
-           (*it).getNhl().getNextHopList().begin();
-         nhit != (*it).getNhl().getNextHopList().begin(); nhit++)
+           (*it).getNexthopList().getNextHops().begin();
+         nhit != (*it).getNexthopList().getNextHops().end(); nhit++)
     {
-      cancelScheduledExpiringEvent(pnlsr, (*it).getExpiringEventId());
       //Remove entry from NDN-FIB
+      if (!pnlsr.getAdjacencyList().isNeighbor(it->getName()))
+      {
+        unregisterPrefixFromNfd(it->getName(), nhit->getConnectingFace());
+      }
+      else
+      {
+        if(pnlsr.getAdjacencyList().getAdjacent(it->getName()).getConnectingFace() != 
+           nhit->getConnectingFace())
+        {
+          unregisterPrefixFromNfd(it->getName(), nhit->getConnectingFace());
+        }
+      }
     }
   }
   if (m_table.size() > 0)
@@ -148,7 +214,7 @@
 }
 
 int
-Fib::getNumberOfFacesForName(NexthopList& nextHopList, int maxFacesPerPrefix)
+Fib::getNumberOfFacesForName(NexthopList& nextHopList, uint32_t maxFacesPerPrefix)
 {
   int endFace = 0;
   if ((maxFacesPerPrefix == 0) || (nextHopList.getSize() <= maxFacesPerPrefix))
@@ -163,19 +229,79 @@
 }
 
 void
-Fib::removeHop(Nlsr& pnlsr, NexthopList& nl, int doNotRemoveHopFaceId)
+Fib::removeHop(Nlsr& pnlsr, NexthopList& nl, uint32_t doNotRemoveHopFaceId,
+               const std::string& name)
 {
-  for (std::list<NextHop>::iterator it = nl.getNextHopList().begin();
-       it != nl.getNextHopList().end();   ++it)
+  for (std::list<NextHop>::iterator it = nl.getNextHops().begin();
+       it != nl.getNextHops().end();   ++it)
   {
     if (it->getConnectingFace() != doNotRemoveHopFaceId)
     {
       //Remove FIB Entry from NDN-FIB
+      if (!pnlsr.getAdjacencyList().isNeighbor(name))
+      {
+        unregisterPrefixFromNfd(name, it->getConnectingFace());
+      }
+      else
+      {
+        if(pnlsr.getAdjacencyList().getAdjacent(name).getConnectingFace() != 
+           it->getConnectingFace())
+        {
+          unregisterPrefixFromNfd(name, it->getConnectingFace());
+        }
+      }
     }
   }
 }
 
 void
+Fib::registerPrefixInNfd(const std::string& namePrefix, uint64_t faceId, uint64_t faceCost)
+{
+  ndn::nfd::ControlParameters controlParameters;
+  controlParameters
+    .setName(namePrefix)
+    .setCost(faceCost)
+    .setFaceId(faceId)
+    .setExpirationPeriod(ndn::time::milliseconds(m_refreshTime*1000))
+    .setOrigin(128);
+
+  m_controller.start<ndn::nfd::RibRegisterCommand>(controlParameters,
+                                                   ndn::bind(&Fib::onSuccess, this, _1,
+                                                             "Successful in name registration"),
+                                                   ndn::bind(&Fib::onFailure, this, _1, _2,
+                                                             "Failed in name registration"));
+}
+  
+void
+Fib::unregisterPrefixFromNfd(const std::string& namePrefix, uint64_t faceId)
+{
+  ndn::nfd::ControlParameters controlParameters;
+  controlParameters
+    .setName(namePrefix)
+    .setFaceId(faceId)
+    .setOrigin(128);
+
+  m_controller.start<ndn::nfd::RibUnregisterCommand>(controlParameters,
+                                                     ndn::bind(&Fib::onSuccess, this, _1,
+                                                               "Successful in unregistering name"),
+                                                     ndn::bind(&Fib::onFailure, this, _1, _2,
+                                                               "Failed in unregistering name"));
+}
+
+void
+Fib::onSuccess(const ndn::nfd::ControlParameters& commandSuccessResult, const std::string& message)
+{
+  std::cout << message << ": " << commandSuccessResult << std::endl;
+}
+
+void
+Fib::onFailure(uint32_t code, const std::string& error, const std::string& message)
+{
+  std::cout << message << ": " << error << " (code: " << code << ")";
+}
+
+
+void
 Fib::print()
 {
   cout << "-------------------FIB-----------------------------" << endl;
diff --git a/src/route/fib.hpp b/src/route/fib.hpp
index 4a80c48..2a90fc1 100644
--- a/src/route/fib.hpp
+++ b/src/route/fib.hpp
@@ -2,35 +2,41 @@
 #define NLSR_FIB_HPP
 
 #include <list>
+#include <boost/cstdint.hpp>
+
+#include <ndn-cxx/management/nfd-controller.hpp>
+
 #include "fib-entry.hpp"
 
 namespace nlsr {
 
 class Nlsr;
 
-using namespace std;
-using namespace ndn;
 
 class Fib
 {
 public:
-  Fib()
+  Fib(ndn::Face& face)
     : m_table()
     , m_refreshTime(0)
+    , m_controller(face)
+  {
+  }
+  ~Fib()
   {
   }
 
   void
-  remove(Nlsr& pnlsr, string name);
+  remove(Nlsr& pnlsr, const std::string& name);
 
   void
-  update(Nlsr& pnlsr, string name, NexthopList& nextHopList);
+  update(Nlsr& pnlsr, const std::string& name, NexthopList& nextHopList);
 
   void
   clean(Nlsr& pnlsr);
 
   void
-  setEntryRefreshTime(int fert)
+  setEntryRefreshTime(int32_t fert)
   {
     m_refreshTime = fert;
   }
@@ -40,23 +46,38 @@
 
 private:
   void
-  removeHop(Nlsr& pnlsr, NexthopList& nl, int doNotRemoveHopFaceId);
+  removeHop(Nlsr& pnlsr, NexthopList& nl, uint32_t doNotRemoveHopFaceId,
+            const std::string& name);
 
   int
-  getNumberOfFacesForName(NexthopList& nextHopList, int maxFacesPerPrefix);
+  getNumberOfFacesForName(NexthopList& nextHopList, uint32_t maxFacesPerPrefix);
 
   ndn::EventId
-  scheduleEntryRefreshing(Nlsr& pnlsr, string name, int feSeqNum,
-                          int refreshTime);
-  void
-  cancelScheduledExpiringEvent(Nlsr& pnlsr, EventId eid);
+  scheduleEntryRefreshing(Nlsr& pnlsr, const std::string& name, int32_t feSeqNum,
+                          int32_t refreshTime);
 
   void
-  refreshEntry(string name, int feSeqNum);
+  cancelScheduledExpiringEvent(Nlsr& pnlsr, ndn::EventId eid);
+
+  void
+  refreshEntry(Nlsr& nlsr, const std::string& name, int32_t feSeqNum);
+
+  void
+  registerPrefixInNfd(const std::string& namePrefix, uint64_t faceId, uint64_t faceCost);
+
+  void
+  unregisterPrefixFromNfd(const std::string& namePrefix, uint64_t faceId);
+  
+  void
+  onSuccess(const ndn::nfd::ControlParameters& commandSuccessResult, const std::string& message);
+
+  void
+  onFailure(uint32_t code, const std::string& error, const std::string& message);
 
 private:
   std::list<FibEntry> m_table;
-  int m_refreshTime;
+  int32_t m_refreshTime;
+  ndn::nfd::Controller m_controller;
 };
 
 }//namespace nlsr
diff --git a/src/route/map-entry.hpp b/src/route/map-entry.hpp
new file mode 100644
index 0000000..9174345
--- /dev/null
+++ b/src/route/map-entry.hpp
@@ -0,0 +1,54 @@
+#ifndef NLSR_MAP_ENTRY_HPP
+#define NLSR_MAP_ENTRY_HPP
+
+#include <boost/cstdint.hpp>
+
+namespace nlsr{
+
+class MapEntry
+{
+public:
+  MapEntry()
+    : m_router()
+    , m_mappingNumber(-1)
+  {
+  }
+
+  ~MapEntry()
+  {
+  }
+
+  MapEntry(const std::string& rtr, int32_t mn)
+  {
+    m_router = rtr;
+    m_mappingNumber = mn;
+  }
+
+  const std::string&
+  getRouter() const
+  {
+    return m_router;
+  }
+
+  int32_t
+  getMappingNumber() const
+  {
+    return m_mappingNumber;
+  }
+
+private:
+  std::string m_router;
+  int32_t m_mappingNumber;
+};
+
+inline std::ostream&
+operator<<(std::ostream& os, const MapEntry& mpe)
+{
+  os << "MapEntry: ( Router: " << mpe.getRouter() << " Mapping No: ";
+  os << mpe.getMappingNumber() << " )" << std::endl;
+  return os;
+}
+
+} // namespace nlsr
+
+#endif // NLSR_MAP_ENTRY_HPP
diff --git a/src/route/map.cpp b/src/route/map.cpp
index e7ab979..4701a05 100644
--- a/src/route/map.cpp
+++ b/src/route/map.cpp
@@ -11,38 +11,30 @@
 
 using namespace std;
 
-ostream&
-operator<< (ostream& os, MapEntry& mpe)
-{
-  os << "MapEntry: ( Router: " << mpe.getRouter() << " Mapping No: ";
-  os << mpe.getMappingNumber() << " )" << endl;
-  return os;
-}
-
 static bool
-mapEntryCompareByRouter(MapEntry& mpe1, string& rtrName)
+mapEntryCompareByRouter(MapEntry& mpe1, const string& rtrName)
 {
   return mpe1.getRouter() == rtrName;
 }
 
 static bool
-mapEntryCompareByMappingNo(MapEntry& mpe1, int mappingNo)
+mapEntryCompareByMappingNo(MapEntry& mpe1, int32_t mappingNo)
 {
   return mpe1.getMappingNumber() == mappingNo;
 }
 
 void
-Map::addElement(string& rtrName)
+Map::addEntry(const string& rtrName)
 {
   MapEntry me(rtrName, m_mappingIndex);
-  if (addElement(me))
+  if (addEntry(me))
   {
     m_mappingIndex++;
   }
 }
 
 bool
-Map::addElement(MapEntry& mpe)
+Map::addEntry(MapEntry& mpe)
 {
   //cout << mpe;
   std::list<MapEntry>::iterator it = std::find_if(m_table.begin(),
@@ -57,7 +49,7 @@
 }
 
 string
-Map::getRouterNameByMappingNo(int mn)
+Map::getRouterNameByMappingNo(int32_t mn)
 {
   std::list<MapEntry>::iterator it = std::find_if(m_table.begin(),
                                                   m_table.end(),
@@ -70,7 +62,7 @@
   return "";
 }
 
-int
+int32_t
 Map::getMappingNoByRouterName(string& rName)
 {
   std::list<MapEntry>::iterator it = std::find_if(m_table.begin(),
@@ -92,13 +84,13 @@
        it != adjLsdb.end() ; it++)
   {
     string linkStartRouter = (*it).getOrigRouter();
-    addElement(linkStartRouter);
+    addEntry(linkStartRouter);
     std::list<Adjacent> adl = (*it).getAdl().getAdjList();
     for (std::list<Adjacent>::iterator itAdl = adl.begin();
          itAdl != adl.end() ; itAdl++)
     {
       string linkEndRouter = (*itAdl).getName();
-      addElement(linkEndRouter);
+      addEntry(linkEndRouter);
     }
   }
 }
diff --git a/src/route/map.hpp b/src/route/map.hpp
index bdacd4d..cc08771 100644
--- a/src/route/map.hpp
+++ b/src/route/map.hpp
@@ -3,52 +3,16 @@
 
 #include <iostream>
 #include <list>
+#include <boost/cstdint.hpp>
 
-#include <ndn-cxx/face.hpp>
+#include <ndn-cxx/common.hpp>
+
+#include "map-entry.hpp"
 
 namespace nlsr {
 
 class Nlsr;
 
-class MapEntry
-{
-public:
-  MapEntry()
-    : m_router()
-    , m_mappingNumber(-1)
-  {
-  }
-
-  ~MapEntry()
-  {
-  }
-
-  MapEntry(std::string rtr, int mn)
-  {
-    m_router = rtr;
-    m_mappingNumber = mn;
-  }
-
-  std::string
-  getRouter() const
-  {
-    return m_router;
-  }
-
-  int
-  getMappingNumber() const
-  {
-    return m_mappingNumber;
-  }
-
-private:
-  std::string m_router;
-  int m_mappingNumber;
-};
-
-std::ostream&
-operator<<(std::ostream& os, MapEntry& mpe);
-
 class Map
 {
 public:
@@ -59,15 +23,15 @@
 
 
   void
-  addElement(std::string& rtrName);
+  addEntry(const std::string& rtrName);
 
   void
   createFromAdjLsdb(Nlsr& pnlsr);
 
   std::string
-  getRouterNameByMappingNo(int mn);
+  getRouterNameByMappingNo(int32_t mn);
 
-  int
+  int32_t
   getMappingNoByRouterName(std::string& rName);
 
   void
@@ -88,9 +52,9 @@
 
 private:
   bool
-  addElement(MapEntry& mpe);
+  addEntry(MapEntry& mpe);
 
-  int m_mappingIndex;
+  int32_t m_mappingIndex;
   std::list<MapEntry> m_table;
 };
 
diff --git a/src/route/name-prefix-table-entry.cpp b/src/route/name-prefix-table-entry.cpp
index 4389373..01eea0d 100644
--- a/src/route/name-prefix-table-entry.cpp
+++ b/src/route/name-prefix-table-entry.cpp
@@ -11,15 +11,15 @@
 void
 NamePrefixTableEntry::generateNhlfromRteList()
 {
-  m_nhl.reset();
+  m_nexthopList.reset();
   for (std::list<RoutingTableEntry>::iterator it = m_rteList.begin();
        it != m_rteList.end(); ++it)
   {
     for (std::list<NextHop>::iterator nhit =
-           (*it).getNhl().getNextHopList().begin();
-         nhit != (*it).getNhl().getNextHopList().end(); ++nhit)
+           (*it).getNexthopList().getNextHops().begin();
+         nhit != (*it).getNexthopList().getNextHops().end(); ++nhit)
     {
-      m_nhl.addNextHop((*nhit));
+      m_nexthopList.addNextHop((*nhit));
     }
   }
 }
@@ -56,11 +56,11 @@
   }
   else
   {
-    (*it).getNhl().reset(); // reseting existing routing table's next hop
-    for (std::list<NextHop>::iterator nhit = rte.getNhl().getNextHopList().begin();
-         nhit != rte.getNhl().getNextHopList().end(); ++nhit)
+    (*it).getNexthopList().reset(); // reseting existing routing table's next hop
+    for (std::list<NextHop>::iterator nhit = rte.getNexthopList().getNextHops().begin();
+         nhit != rte.getNexthopList().getNextHops().end(); ++nhit)
     {
-      (*it).getNhl().addNextHop((*nhit));
+      (*it).getNexthopList().addNextHop((*nhit));
     }
   }
 }
@@ -76,7 +76,7 @@
   {
     cout << (*it);
   }
-  os << npte.getNhl();
+  os << npte.getNexthopList();
   return os;
 }
 
diff --git a/src/route/name-prefix-table-entry.hpp b/src/route/name-prefix-table-entry.hpp
index 7f4f83a..0ee28fa 100644
--- a/src/route/name-prefix-table-entry.hpp
+++ b/src/route/name-prefix-table-entry.hpp
@@ -1,31 +1,29 @@
-#ifndef NLSR_NPTE_HPP
-#define NLSR_NPTE_HPP
+#ifndef NLSR_NAME_PREFIX_TABLE_ENTRY_HPP
+#define NLSR_NAME_PREFIX_TABLE_ENTRY_HPP
 
 #include <list>
 #include <utility>
+#include <boost/cstdint.hpp>
+
 #include "routing-table-entry.hpp"
 
 namespace nlsr {
 
-using namespace std;
-
 class NamePrefixTableEntry
 {
 public:
   NamePrefixTableEntry()
-    : m_namePrefix()
-    , m_nhl()
   {
   }
 
-  NamePrefixTableEntry(string np)
-    : m_nhl()
+  NamePrefixTableEntry(const std::string& namePrefix)
+    : m_nexthopList()
   {
-    m_namePrefix = np;
+    m_namePrefix = namePrefix;
   }
 
-  std::string
-  getNamePrefix()
+  const std::string&
+  getNamePrefix() const
   {
     return m_namePrefix;
   }
@@ -44,21 +42,21 @@
       for (std::list<RoutingTableEntry>::iterator it = m_rteList.begin();
            it != m_rteList.end(); ++it)
       {
-        (*it).getNhl().reset();
+        (*it).getNexthopList().reset();
       }
     }
   }
 
-  int
+  size_t
   getRteListSize()
   {
     return m_rteList.size();
   }
 
   NexthopList&
-  getNhl()
+  getNexthopList()
   {
-    return m_nhl;
+    return m_nexthopList;
   }
 
   void
@@ -73,7 +71,7 @@
 private:
   std::string m_namePrefix;
   std::list<RoutingTableEntry> m_rteList;
-  NexthopList m_nhl;
+  NexthopList m_nexthopList;
 };
 
 std::ostream&
@@ -81,4 +79,4 @@
 
 }//namespace nlsr
 
-#endif //NLSR_NPTE_HPP
+#endif //NLSR_NAME_PREFIX_TABLE_ENTRY_HPP
diff --git a/src/route/name-prefix-table.cpp b/src/route/name-prefix-table.cpp
index e37751b..e6a7ccf 100644
--- a/src/route/name-prefix-table.cpp
+++ b/src/route/name-prefix-table.cpp
@@ -13,7 +13,7 @@
 using namespace std;
 
 static bool
-npteCompare(NamePrefixTableEntry& npte, string& name)
+npteCompare(NamePrefixTableEntry& npte, const string& name)
 {
   return npte.getNamePrefix() == name;
 }
@@ -21,46 +21,46 @@
 
 
 void
-NamePrefixTable::addNpte(string name, RoutingTableEntry& rte, Nlsr& pnlsr)
+NamePrefixTable::addEntry(const string& name, RoutingTableEntry& rte, Nlsr& pnlsr)
 {
-  std::list<NamePrefixTableEntry>::iterator it = std::find_if(m_npteList.begin(),
-                                                              m_npteList.end(), bind(&npteCompare, _1, name));
-  if (it == m_npteList.end())
+  std::list<NamePrefixTableEntry>::iterator it = std::find_if(m_table.begin(),
+                                                              m_table.end(), bind(&npteCompare, _1, name));
+  if (it == m_table.end())
   {
     NamePrefixTableEntry newEntry(name);
     newEntry.addRoutingTableEntry(rte);
     newEntry.generateNhlfromRteList();
-    newEntry.getNhl().sort();
-    m_npteList.push_back(newEntry);
-    if (rte.getNhl().getSize() > 0)
+    newEntry.getNexthopList().sort();
+    m_table.push_back(newEntry);
+    if (rte.getNexthopList().getSize() > 0)
     {
-      pnlsr.getFib().update(pnlsr, name, newEntry.getNhl());
+      pnlsr.getFib().update(pnlsr, name, newEntry.getNexthopList());
     }
   }
   else
   {
-    if (rte.getNhl().getSize() > 0)
+    if (rte.getNexthopList().getSize() > 0)
     {
       (*it).addRoutingTableEntry(rte);
       (*it).generateNhlfromRteList();
-      (*it).getNhl().sort();
-      pnlsr.getFib().update(pnlsr, name, (*it).getNhl());
+      (*it).getNexthopList().sort();
+      pnlsr.getFib().update(pnlsr, name, (*it).getNexthopList());
     }
     else
     {
       (*it).resetRteListNextHop();
-      (*it).getNhl().reset();
+      (*it).getNexthopList().reset();
       pnlsr.getFib().remove(pnlsr, name);
     }
   }
 }
 
 void
-NamePrefixTable::removeNpte(string name, RoutingTableEntry& rte, Nlsr& pnlsr)
+NamePrefixTable::removeEntry(const string& name, RoutingTableEntry& rte, Nlsr& pnlsr)
 {
-  std::list<NamePrefixTableEntry>::iterator it = std::find_if(m_npteList.begin(),
-                                                              m_npteList.end(), bind(&npteCompare, _1, name));
-  if (it != m_npteList.end())
+  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();
     (*it).removeRoutingTableEntry(rte);
@@ -69,56 +69,55 @@
         (!pnlsr.getLsdb().doesLsaExist(destRouter + "/2", 2)) &&
         (!pnlsr.getLsdb().doesLsaExist(destRouter + "/3", 3)))
     {
-      m_npteList.erase(it);
+      m_table.erase(it);
       pnlsr.getFib().remove(pnlsr, name);
     }
     else
     {
       (*it).generateNhlfromRteList();
-      pnlsr.getFib().update(pnlsr, name, (*it).getNhl());
+      pnlsr.getFib().update(pnlsr, name, (*it).getNexthopList());
     }
   }
 }
 
 
 void
-NamePrefixTable::addNpteByDestName(string name, string destRouter, Nlsr& pnlsr)
+NamePrefixTable::addEntry(const string& name, const string& destRouter, Nlsr& pnlsr)
 {
   RoutingTableEntry* rteCheck =
     pnlsr.getRoutingTable().findRoutingTableEntry(destRouter);
   if (rteCheck != 0)
   {
-    addNpte(name, *(rteCheck) , pnlsr);
+    addEntry(name, *(rteCheck) , pnlsr);
   }
   else
   {
     RoutingTableEntry rte(destRouter);
-    addNpte(name, rte, pnlsr);
+    addEntry(name, rte, pnlsr);
   }
 }
 
 void
-NamePrefixTable::removeNpte(string name, string destRouter, Nlsr& pnlsr)
+NamePrefixTable::removeEntry(const string& name, const string& destRouter, Nlsr& pnlsr)
 {
   RoutingTableEntry* rteCheck =
     pnlsr.getRoutingTable().findRoutingTableEntry(destRouter);
   if (rteCheck != 0)
   {
-    removeNpte(name, *(rteCheck), pnlsr);
+    removeEntry(name, *(rteCheck), pnlsr);
   }
   else
   {
     RoutingTableEntry rte(destRouter);
-    removeNpte(name, rte, pnlsr);
+    removeEntry(name, rte, pnlsr);
   }
 }
 
 void
 NamePrefixTable::updateWithNewRoute(Nlsr& pnlsr)
 {
-  for (std::list<NamePrefixTableEntry>::iterator it = m_npteList.begin();
-       it != m_npteList.end();
-       ++it)
+  for (std::list<NamePrefixTableEntry>::iterator it = m_table.begin();
+       it != m_table.end(); ++it)
   {
     std::list<RoutingTableEntry> rteList = (*it).getRteList();
     for (std::list<RoutingTableEntry>::iterator rteit = rteList.begin();
@@ -128,12 +127,12 @@
         pnlsr.getRoutingTable().findRoutingTableEntry((*rteit).getDestination());
       if (rteCheck != 0)
       {
-        addNpte((*it).getNamePrefix(), *(rteCheck), pnlsr);
+        addEntry((*it).getNamePrefix(), *(rteCheck), pnlsr);
       }
       else
       {
         RoutingTableEntry rte((*rteit).getDestination());
-        addNpte((*it).getNamePrefix(), rte, pnlsr);
+        addEntry((*it).getNamePrefix(), rte, pnlsr);
       }
     }
   }
@@ -143,8 +142,8 @@
 NamePrefixTable::print()
 {
   std::cout << "----------------NPT----------------------" << std::endl;
-  for (std::list<NamePrefixTableEntry>::iterator it = m_npteList.begin();
-       it != m_npteList.end();
+  for (std::list<NamePrefixTableEntry>::iterator it = m_table.begin();
+       it != m_table.end();
        ++it)
   {
     cout << (*it) << endl;
diff --git a/src/route/name-prefix-table.hpp b/src/route/name-prefix-table.hpp
index 1a59af2..4f7fbb4 100644
--- a/src/route/name-prefix-table.hpp
+++ b/src/route/name-prefix-table.hpp
@@ -1,7 +1,9 @@
-#ifndef NLSR_NPT_HPP
-#define NLSR_NPT_HPP
+#ifndef NLSR_NAME_PREFIX_TABLE_HPP
+#define NLSR_NAME_PREFIX_TABLE_HPP
 
 #include <list>
+#include <boost/cstdint.hpp>
+
 #include "name-prefix-table-entry.hpp"
 #include "routing-table-entry.hpp"
 
@@ -14,11 +16,12 @@
   NamePrefixTable()
   {
   }
-  void
-  addNpteByDestName(std::string name, std::string destRouter, Nlsr& pnlsr);
 
   void
-  removeNpte(std::string name, std::string destRouter, Nlsr& pnlsr);
+  addEntry(const std::string& name, const std::string& destRouter, Nlsr& pnlsr);
+
+  void
+  removeEntry(const std::string& name, const std::string& destRouter, Nlsr& pnlsr);
 
   void
   updateWithNewRoute(Nlsr& pnlsr);
@@ -28,15 +31,15 @@
 
 private:
   void
-  addNpte(std::string name, RoutingTableEntry& rte, Nlsr& pnlsr);
+  addEntry(const std::string& name, RoutingTableEntry& rte, Nlsr& pnlsr);
 
   void
-  removeNpte(std::string name, RoutingTableEntry& rte, Nlsr& pnlsr);
+  removeEntry(const std::string& name, RoutingTableEntry& rte, Nlsr& pnlsr);
 
 private:
-  std::list<NamePrefixTableEntry> m_npteList;
+  std::list<NamePrefixTableEntry> m_table;
 };
 
 }//namespace nlsr
 
-#endif //NLSR_NPT_HPP
+#endif //NLSR_NAME_PREFIX_TABLE_HPP
diff --git a/src/route/nexthop-list.cpp b/src/route/nexthop-list.cpp
index 7edb96e..5468b40 100644
--- a/src/route/nexthop-list.cpp
+++ b/src/route/nexthop-list.cpp
@@ -75,7 +75,7 @@
 ostream&
 operator<<(ostream& os, NexthopList& nhl)
 {
-  std::list<NextHop> nexthopList = nhl.getNextHopList();
+  std::list<NextHop> nexthopList = nhl.getNextHops();
   int i = 1;
   for (std::list<NextHop>::iterator it = nexthopList.begin();
        it != nexthopList.end() ; it++, i++)
diff --git a/src/route/nexthop-list.hpp b/src/route/nexthop-list.hpp
index a8ebe7b..2607218 100644
--- a/src/route/nexthop-list.hpp
+++ b/src/route/nexthop-list.hpp
@@ -1,9 +1,11 @@
-#ifndef NLSR_NHL_HPP
-#define NLSR_NHL_HPP
+#ifndef NLSR_NEXTHOP_LIST_HPP
+#define NLSR_NEXTHOP_LIST_HPP
 
-#include <ndn-cxx/face.hpp>
 #include <list>
 #include <iostream>
+#include <boost/cstdint.hpp>
+
+#include <ndn-cxx/face.hpp>
 
 #include "nexthop.hpp"
 #include "adjacent.hpp"
@@ -14,13 +16,13 @@
 {
 public:
   NexthopList()
-    : m_nexthopList()
   {
   }
 
   ~NexthopList()
   {
   }
+
   void
   addNextHop(NextHop& nh);
 
@@ -30,7 +32,7 @@
   void
   sort();
 
-  int
+  size_t
   getSize()
   {
     return m_nexthopList.size();
@@ -39,14 +41,11 @@
   void
   reset()
   {
-    if (m_nexthopList.size() > 0)
-    {
-      m_nexthopList.clear();
-    }
+    m_nexthopList.clear();
   }
 
   std::list<NextHop>&
-  getNextHopList()
+  getNextHops()
   {
     return m_nexthopList;
   }
@@ -60,4 +59,4 @@
 
 }//namespace nlsr
 
-#endif //NLSR_NLH_HPP
+#endif //NLSR_NEXTHOP_LIST_HPP
diff --git a/src/route/nexthop.hpp b/src/route/nexthop.hpp
index 7153e0f..ed8d319 100644
--- a/src/route/nexthop.hpp
+++ b/src/route/nexthop.hpp
@@ -2,6 +2,7 @@
 #define NLSR_NEXTHOP_HPP
 
 #include <iostream>
+#include <boost/cstdint.hpp>
 
 namespace nlsr {
 class NextHop
@@ -13,20 +14,20 @@
   {
   }
 
-  NextHop(int cf, double rc)
+  NextHop(uint32_t cf, double rc)
   {
     m_connectingFace = cf;
     m_routeCost = rc;
   }
 
-  int
+  uint32_t
   getConnectingFace() const
   {
     return m_connectingFace;
   }
 
   void
-  setConnectingFace(int cf)
+  setConnectingFace(uint32_t cf)
   {
     m_connectingFace = cf;
   }
@@ -44,7 +45,7 @@
   }
 
 private:
-  int m_connectingFace;
+  uint32_t m_connectingFace;
   double m_routeCost;
 };
 
diff --git a/src/route/routing-table-calculator.hpp b/src/route/routing-table-calculator.hpp
index b248b15..544896c 100644
--- a/src/route/routing-table-calculator.hpp
+++ b/src/route/routing-table-calculator.hpp
@@ -1,8 +1,9 @@
-#ifndef NLSR_RTC_HPP
-#define NLSR_RTC_HPP
+#ifndef NLSR_ROUTING_TABLE_CALCULATOR_HPP
+#define NLSR_ROUTING_TABLE_CALCULATOR_HPP
 
 #include <list>
 #include <iostream>
+#include <boost/cstdint.hpp>
 
 namespace nlsr {
 
@@ -198,4 +199,4 @@
 
 }//namespace nlsr
 
-#endif //NLSR_RTC_HPP
+#endif //NLSR_ROUTING_TABLE_CALCULATOR_HPP
diff --git a/src/route/routing-table-entry.cpp b/src/route/routing-table-entry.cpp
deleted file mode 100644
index 5222cb9..0000000
--- a/src/route/routing-table-entry.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-#include <iostream>
-#include <string>
-
-#include "routing-table-entry.hpp"
-
-namespace nlsr {
-
-using namespace std;
-
-ostream&
-operator<<(ostream& os, RoutingTableEntry& rte)
-{
-  os << "Destination: " << rte.getDestination() << endl;
-  os << "Nexthops: " << endl;
-  int i = 1;
-  std::list<NextHop> nhl = rte.getNhl().getNextHopList();
-  for (std::list<NextHop>::iterator it = nhl.begin();
-       it != nhl.end() ; it++, i++)
-  {
-    os << "  Nexthop " << i << ": " << (*it) << endl;
-  }
-  return os;
-}
-
-}//namespace nlsr
diff --git a/src/route/routing-table-entry.hpp b/src/route/routing-table-entry.hpp
index 8877275..0d0b662 100644
--- a/src/route/routing-table-entry.hpp
+++ b/src/route/routing-table-entry.hpp
@@ -1,5 +1,5 @@
-#ifndef NLSR_RTE_HPP
-#define NLSR_RTE_HPP
+#ifndef NLSR_ROUTING_TABLE_ENTRY_HPP
+#define NLSR_ROUTING_TABLE_ENTRY_HPP
 
 #include <iostream>
 
@@ -11,8 +11,6 @@
 {
 public:
   RoutingTableEntry()
-    : m_destination()
-    , m_nhl()
   {
   }
 
@@ -20,8 +18,7 @@
   {
   }
 
-  RoutingTableEntry(std::string dest)
-    : m_nhl()
+  RoutingTableEntry(const std::string& dest)
   {
     m_destination = dest;
   }
@@ -33,19 +30,31 @@
   }
 
   NexthopList&
-  getNhl()
+  getNexthopList()
   {
-    return m_nhl;
+    return m_nexthopList;
   }
 
 private:
   std::string m_destination;
-  NexthopList m_nhl;
+  NexthopList m_nexthopList;
 };
 
-std::ostream&
-operator<<(std::ostream& os, RoutingTableEntry& rte);
+inline std::ostream&
+operator<<(std::ostream& os, RoutingTableEntry& rte)
+{
+  os << "Destination: " << rte.getDestination() << std::endl;
+  os << "Nexthops: " << std::endl;
+  int32_t i = 1;
+  std::list<NextHop> nhl = rte.getNexthopList().getNextHops();
+  for (std::list<NextHop>::iterator it = nhl.begin();
+       it != nhl.end() ; it++, i++)
+  {
+    os << "  Nexthop " << i << ": " << (*it) << std::endl;
+  }
+  return os;
+}
 
 } //namespace nlsr
 
-#endif //NLSR_RTE_HPP
+#endif //NLSR_ROUTING_TABLE_ENTRY_HPP
diff --git a/src/route/routing-table.cpp b/src/route/routing-table.cpp
index 2bc827c..bb7d3fa 100644
--- a/src/route/routing-table.cpp
+++ b/src/route/routing-table.cpp
@@ -144,12 +144,12 @@
   if (rteChk == 0)
   {
     RoutingTableEntry rte(destRouter);
-    rte.getNhl().addNextHop(nh);
+    rte.getNexthopList().addNextHop(nh);
     m_rTable.push_back(rte);
   }
   else
   {
-    rteChk->getNhl().addNextHop(nh);
+    rteChk->getNexthopList().addNextHop(nh);
   }
 }
 
@@ -188,12 +188,12 @@
   if (it == m_dryTable.end())
   {
     RoutingTableEntry rte(destRouter);
-    rte.getNhl().addNextHop(nh);
+    rte.getNexthopList().addNextHop(nh);
     m_dryTable.push_back(rte);
   }
   else
   {
-    (*it).getNhl().addNextHop(nh);
+    (*it).getNexthopList().addNextHop(nh);
   }
 }
 
diff --git a/src/route/routing-table.hpp b/src/route/routing-table.hpp
index 8518b12..35f563e 100644
--- a/src/route/routing-table.hpp
+++ b/src/route/routing-table.hpp
@@ -1,9 +1,10 @@
-#ifndef NLSR_RT_HPP
-#define NLSR_RT_HPP
+#ifndef NLSR_ROUTING_TABLE_HPP
+#define NLSR_ROUTING_TABLE_HPP
 
 #include <iostream>
 #include <utility>
 #include <string>
+#include <boost/cstdint.hpp>
 
 #include "routing-table-entry.hpp"
 
@@ -70,4 +71,4 @@
 
 }//namespace nlsr
 
-#endif //NLSR_RT_HPP
+#endif //NLSR_ROUTING_TABLE_HPP
diff --git a/src/sequencing-manager.hpp b/src/sequencing-manager.hpp
index e933567..8bc009a 100644
--- a/src/sequencing-manager.hpp
+++ b/src/sequencing-manager.hpp
@@ -1,8 +1,10 @@
-#ifndef NLSR_SM_HPP
-#define NLSR_SM_HPP
+#ifndef NLSR_SEQUENCING_MANAGER_HPP
+#define NLSR_SEQUENCING_MANAGER_HPP
 
 #include <list>
 #include <string>
+#include <boost/cstdint.hpp>
+
 #include <ndn-cxx/face.hpp>
 
 namespace nlsr {
@@ -70,6 +72,27 @@
     combineSequenceNo();
   }
 
+  void
+  increaseNameLsaSeq()
+  {
+    m_nameLsaSeq++;
+    combineSequenceNo();
+  }
+
+  void
+  increaseAdjLsaSeq()
+  {
+    m_adjLsaSeq++;
+    combineSequenceNo();
+  }
+
+  void
+  increaseCorLsaSeq()
+  {
+    m_corLsaSeq++;
+    combineSequenceNo();
+  }
+
   uint64_t
   getCombinedSeqNo() const
   {
@@ -95,7 +118,6 @@
   void
   combineSequenceNo();
 
-
 private:
   uint64_t m_nameLsaSeq;
   uint64_t m_adjLsaSeq;
@@ -109,4 +131,4 @@
 operator<<(std::ostream& os, const SequencingManager& sm);
 
 }//namespace nlsr
-#endif //NLSR_SM_HPP
+#endif //NLSR_SEQUENCING_MANAGER_HPP
diff --git a/src/utility/boost-log.hpp b/src/utility/boost-log.hpp
deleted file mode 100644
index 53743ae..0000000
--- a/src/utility/boost-log.hpp
+++ /dev/null
@@ -1,23 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014 University of Memphis,
- *                    Regents of the University of California
- *
- * See COPYING for copyright and distribution information.
- */
-
-#ifndef NLSR_UTIL_BOOST_LOG_HPP
-#define NLSR_UTIL_BOOST_LOG_HPP
-
-// suppress boost::log warnings
-#pragma GCC system_header
-#pragma clang system_header
-
-#include <boost/log/common.hpp>
-#include <boost/log/expressions.hpp>
-#include <boost/log/attributes.hpp>
-#include <boost/log/sources/logger.hpp>
-#include <boost/log/sinks/sync_frontend.hpp>
-#include <boost/log/sinks/text_file_backend.hpp>
-
-#endif // NLSR_UTIL_BOOST_LOG_HPP
diff --git a/src/utility/logger.cpp b/src/utility/logger.cpp
deleted file mode 100644
index 3d9a804..0000000
--- a/src/utility/logger.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-#include "logger.hpp"
-
-namespace nlsr {
-
-string
-Logger::getEpochTime()
-{
-  std::stringstream ss;
-  boost::posix_time::ptime time_t_epoch(boost::gregorian::date(1970, 1, 1));
-  boost::posix_time::ptime now = boost::posix_time::microsec_clock::local_time();
-  boost::posix_time::time_duration diff = now - time_t_epoch;
-  ss << diff.total_seconds() << "." << boost::format("%06i") %
-     (diff.total_microseconds()
-      % 1000000);
-  return ss.str();
-}
-
-string
-Logger::getUserHomeDirectory()
-{
-  string homeDirPath(getpwuid(getuid())->pw_dir);
-  if (homeDirPath.empty())
-  {
-    homeDirPath = getenv("HOME");
-  }
-  return homeDirPath;
-}
-
-void
-Logger::initialize(std::string dirPath)
-{
-  string logDirPath(dirPath);
-  if (dirPath.empty())
-  {
-    logDirPath = getUserHomeDirectory() + "/nlsrLog";
-  }
-  cout << "Log Dir Path: " << logDirPath << endl;
-  typedef sinks::synchronous_sink<sinks::text_file_backend> file_sink;
-  shared_ptr<file_sink> sink(new file_sink(
-                               keywords::file_name = logDirPath
-                                                     + "/NLSR%Y%m%d%H%M%S_%3N.log",
-                               keywords::rotation_size = 16 * 1024 * 1024,
-                               keywords::time_based_rotation = sinks::file::rotation_at_time_point(12, 0, 0),
-                               keywords::auto_flush = true
-                             ));
-  sink->locked_backend()->set_file_collector(sinks::file::make_collector(
-                                               keywords::target = logDirPath,
-                                               //keywords::max_size =  512 * 1024 * 1024,
-                                               keywords::min_free_space = 64 * 1024 * 1024
-                                             ));
-  sink->set_formatter(
-    expr::format("%1% %2%")
-    % getEpochTime()
-    % expr::smessage
-  );
-  logging::core::get()->add_sink(sink);
-}
-
-}//namespace nlsr
diff --git a/src/utility/logger.hpp b/src/utility/logger.hpp
deleted file mode 100644
index 97b8df4..0000000
--- a/src/utility/logger.hpp
+++ /dev/null
@@ -1,64 +0,0 @@
-#ifndef NLSR_LOGGER_HPP
-#define NLSR_LOGGER_HPP
-
-#define BOOST_LOG_DYN_LINK 1
-#include "boost-log.hpp"
-
-#include <stdexcept>
-#include <string>
-#include <iostream>
-#include <sstream>
-#include <pwd.h>
-#include <cstdlib>
-#include <string>
-#include <unistd.h>
-#include <boost/format.hpp>
-#include <boost/smart_ptr/shared_ptr.hpp>
-#include <boost/date_time/posix_time/posix_time.hpp>
-#include <boost/date_time/local_time/local_time.hpp>
-
-
-
-
-namespace nlsr {
-
-namespace logging = boost::log;
-namespace attrs = boost::log::attributes;
-namespace src = boost::log::sources;
-namespace sinks = boost::log::sinks;
-namespace expr = boost::log::expressions;
-namespace keywords = boost::log::keywords;
-
-using boost::shared_ptr;
-using namespace std;
-
-
-class Logger
-{
-public:
-  Logger()
-  {
-  }
-
-  void
-  initialize(std::string dirPath);
-
-  src::logger&
-  getLogger()
-  {
-    return m_Logger;
-  }
-
-private:
-  string
-  getEpochTime();
-
-  string
-  getUserHomeDirectory();
-
-private:
-  src::logger m_Logger;
-};
-
-}//namespace nlsr
-#endif //NLSR_LOGGER_HPP
diff --git a/src/utility/tokenizer.cpp b/src/utility/tokenizer.cpp
index 52473b2..095e55d 100644
--- a/src/utility/tokenizer.cpp
+++ b/src/utility/tokenizer.cpp
@@ -42,8 +42,8 @@
 uint32_t
 Tokenizer::getTokenPosition(string& token)
 {
-  int pos = -1;
-  int i = 0;
+  uint32_t pos = -1;
+  uint32_t i = 0;
   for (std::list<string>::iterator it = m_tokenList.begin();
        it != m_tokenList.end(); it++)
   {
@@ -67,7 +67,7 @@
   if ((to < m_tokenList.size()) &&
       (to >= from && to < m_tokenList.size()))
   {
-    for (int i = from; i <= to; i++)
+    for (uint32_t i = from; i <= to; i++)
     {
       returnString += m_seps;
       returnString += m_vTokenList[i];
diff --git a/tests/test-adjacency-list.cpp b/tests/test-adjacency-list.cpp
index 757c145..f4c0f27 100644
--- a/tests/test-adjacency-list.cpp
+++ b/tests/test-adjacency-list.cpp
@@ -33,17 +33,17 @@
   adjacentList1.insert(adjacent1);
   adjacentList2.insert(adjacent2);
 
-  BOOST_CHECK_EQUAL(adjacentList1.getSize(), 1);
-  BOOST_CHECK_EQUAL(adjacentList1.isEqual(adjacentList2), false);
+  BOOST_CHECK_EQUAL(adjacentList1.getSize(), (uint32_t)1);
+  BOOST_CHECK_EQUAL(adjacentList1 == adjacentList2, false);
 
   BOOST_CHECK(adjacentList1.isNeighbor("testname"));
   BOOST_CHECK_EQUAL(adjacentList1.isNeighbor("adjacent"), false);
 
   string n1 = "testname";
-  BOOST_CHECK_EQUAL(adjacentList1.getStatusOfNeighbor(n1), 0);
+  BOOST_CHECK_EQUAL(adjacentList1.getStatusOfNeighbor(n1), (uint32_t)0);
 
   adjacentList1.setStatusOfNeighbor(n1, 1);
-  BOOST_CHECK_EQUAL(adjacentList1.getStatusOfNeighbor(n1), 1);
+  BOOST_CHECK_EQUAL(adjacentList1.getStatusOfNeighbor(n1), (uint32_t)1);
 }
 
 BOOST_AUTO_TEST_SUITE_END()
diff --git a/tests/test-adjacent.cpp b/tests/test-adjacent.cpp
index 90be869..e10e30b 100644
--- a/tests/test-adjacent.cpp
+++ b/tests/test-adjacent.cpp
@@ -21,7 +21,7 @@
 
   Adjacent adjacent1(ADJ_NAME_1);
   Adjacent adjacent2(ADJ_NAME_2);
-  BOOST_CHECK(adjacent1.isEqual(adjacent2));
+  BOOST_CHECK(adjacent1 == adjacent2);
 
   adjacent1.setLinkCost(10.5);
   BOOST_CHECK_CLOSE(adjacent1.getLinkCost(), 10.5, 0.0001);
diff --git a/tests/test-conf-file-processor.cpp b/tests/test-conf-file-processor.cpp
index 7b87fac..8ec3a4e 100644
--- a/tests/test-conf-file-processor.cpp
+++ b/tests/test-conf-file-processor.cpp
@@ -29,12 +29,12 @@
     "ndnname /ndn/memphis.edu/cs/macbook/name2\n\n\n"
     ;
 
-  ofstream config;
+  std::ofstream config;
   config.open("unit-test-nlsr.conf");
   config << CONFIG;
   config.close();
 
-  const string CONFIG_FILE = "unit-test-nlsr.conf";
+  const std::string CONFIG_FILE = "unit-test-nlsr.conf";
 
   ConfFileProcessor cfp1(nlsr1, CONFIG_FILE);
 
diff --git a/tests/test-conf-parameter.cpp b/tests/test-conf-parameter.cpp
index e376084..95ae19e 100644
--- a/tests/test-conf-parameter.cpp
+++ b/tests/test-conf-parameter.cpp
@@ -77,7 +77,7 @@
 
   BOOST_CHECK_EQUAL(cp1.getRootKeyPrefix(), "adminRootKey");
 
-  BOOST_CHECK_EQUAL(cp1.getInterestRetryNumber(), 2);
+  BOOST_CHECK_EQUAL(cp1.getInterestRetryNumber(), (uint32_t)2);
 
   BOOST_CHECK_EQUAL(cp1.getInterestResendTime(), 1000);
 
diff --git a/tests/test-lsa.cpp b/tests/test-lsa.cpp
index 715d19e..e7326b4 100644
--- a/tests/test-lsa.cpp
+++ b/tests/test-lsa.cpp
@@ -27,7 +27,7 @@
   NameLsa nlsa1("router1", 1, 12, 1800, npl1);
   NameLsa nlsa2("router2", 1, 12, 1500, npl1);
 
-  BOOST_CHECK_EQUAL(nlsa1.getLsType(), 1);
+  BOOST_CHECK_EQUAL(nlsa1.getLsType(), (uint8_t)1);
 
   BOOST_CHECK(nlsa1.getLifeTime() != nlsa2.getLifeTime());
 
@@ -47,12 +47,12 @@
   AdjLsa alsa1("router1", 2, 12, 1800, 1, adjList);
   AdjLsa alsa2("router1", 2, 12, 1800, 1, adjList);
 
-  BOOST_CHECK_EQUAL(alsa1.getLsType(), 2);
-  BOOST_CHECK_EQUAL(alsa1.getLsSeqNo(), 12);
-  BOOST_CHECK_EQUAL(alsa1.getLifeTime(), 1800);
-  BOOST_CHECK_EQUAL(alsa1.getNoLink(), 1);
+  BOOST_CHECK_EQUAL(alsa1.getLsType(), (uint8_t)2);
+  BOOST_CHECK_EQUAL(alsa1.getLsSeqNo(), (uint32_t)12);
+  BOOST_CHECK_EQUAL(alsa1.getLifeTime(), (uint32_t)1800);
+  BOOST_CHECK_EQUAL(alsa1.getNoLink(), (uint32_t)1);
 
-  BOOST_CHECK(alsa1.isEqual(alsa2));
+  BOOST_CHECK(alsa1.isEqualContent(alsa2));
 
   alsa1.addAdjacent(adj2);
 
@@ -69,7 +69,7 @@
   BOOST_CHECK_CLOSE(clsa1.getCorRadius(), 2.5, 0.0001);
   BOOST_CHECK_CLOSE(clsa1.getCorTheta(), 30.0, 0.0001);
 
-  BOOST_CHECK(clsa1.isEqual(clsa2));
+  BOOST_CHECK(clsa1.isEqualContent(clsa2));
 
   BOOST_CHECK_EQUAL(clsa1.getData(), clsa2.getData());
 }
diff --git a/tests/test-lsdb.cpp b/tests/test-lsdb.cpp
index efc6f4a..7511fdb 100644
--- a/tests/test-lsdb.cpp
+++ b/tests/test-lsdb.cpp
@@ -21,9 +21,9 @@
 
   NamePrefixList npl1;
 
-  string s1 = "name1";
-  string s2 = "name2";
-  string router1 = "router1/1";
+  std::string s1 = "name1";
+  std::string s2 = "name2";
+  std::string router1 = "router1/1";
 
   npl1.insert(s1);
   npl1.insert(s2);
diff --git a/tests/test-map.cpp b/tests/test-map.cpp
index ebbfb15..1d5d4d2 100644
--- a/tests/test-map.cpp
+++ b/tests/test-map.cpp
@@ -19,8 +19,8 @@
   std::string router1 = "r1";
   std::string router2 = "r2";
 
-  map1.addElement(router1);
-  map1.addElement(router2);
+  map1.addEntry(router1);
+  map1.addEntry(router2);
 
   BOOST_CHECK_EQUAL(map1.getMapSize(), 2);
 }
diff --git a/tests/test-nexthop-list.cpp b/tests/test-nexthop-list.cpp
index 10222e8..cdf0c3e 100644
--- a/tests/test-nexthop-list.cpp
+++ b/tests/test-nexthop-list.cpp
@@ -20,10 +20,10 @@
   NexthopList nhl1;
 
   nhl1.addNextHop(np1);
-  BOOST_CHECK_EQUAL(nhl1.getSize(), 1);
+  BOOST_CHECK_EQUAL(nhl1.getSize(), (uint32_t)1);
 
   nhl1.removeNextHop(np1);
-  BOOST_CHECK_EQUAL(nhl1.getSize(), 0);
+  BOOST_CHECK_EQUAL(nhl1.getSize(), (uint32_t)0);
 }
 
 BOOST_AUTO_TEST_SUITE_END()
diff --git a/tests/test-nexthop.cpp b/tests/test-nexthop.cpp
index b0bb90d..0cdf23c 100644
--- a/tests/test-nexthop.cpp
+++ b/tests/test-nexthop.cpp
@@ -20,7 +20,7 @@
 
   np1.setRouteCost(10.5);
 
-  BOOST_CHECK_EQUAL(np1.getConnectingFace(), 1);
+  BOOST_CHECK_EQUAL(np1.getConnectingFace(), (uint32_t)1);
   BOOST_CHECK_CLOSE(np1.getRouteCost(), 10.5, 0.0001);
 }
 
diff --git a/tests/test-sequencing-manager.cpp b/tests/test-sequencing-manager.cpp
index 9ae9d55..bdf19b2 100644
--- a/tests/test-sequencing-manager.cpp
+++ b/tests/test-sequencing-manager.cpp
@@ -18,11 +18,11 @@
 
   SequencingManager sm2(sm1.getCombinedSeqNo());
 
-  BOOST_CHECK_EQUAL(sm2.getNameLsaSeq(), 120);
+  BOOST_CHECK_EQUAL(sm2.getNameLsaSeq(), (uint32_t)120);
 
-  BOOST_CHECK_EQUAL(sm2.getAdjLsaSeq(), 121);
+  BOOST_CHECK_EQUAL(sm2.getAdjLsaSeq(), (uint32_t)121);
 
-  BOOST_CHECK_EQUAL(sm2.getCorLsaSeq(), 122);
+  BOOST_CHECK_EQUAL(sm2.getCorLsaSeq(), (uint32_t)122);
 }
 
 BOOST_AUTO_TEST_SUITE_END()
diff --git a/wscript b/wscript
index 43159f4..146b5e8 100644
--- a/wscript
+++ b/wscript
@@ -46,7 +46,7 @@
     conf.check_cfg(package='libndn-cxx', args=['--cflags', '--libs'],
                    uselib_store='NDN_CPP', mandatory=True)
 
-    boost_libs = 'system chrono program_options log iostreams thread'
+    boost_libs = 'system chrono program_options iostreams thread'
     if conf.options.with_tests:
         conf.env['WITH_TESTS'] = 1
         conf.define('WITH_TESTS', 1);
@@ -55,7 +55,7 @@
     conf.check_boost(lib=boost_libs)
 
     if conf.env.BOOST_VERSION_NUMBER < 104800:
-        Logs.error("Minimum required boost version is 1.54.0")
+        Logs.error("Minimum required boost version is 1.48.0")
         Logs.error("Please upgrade your distribution or install custom boost libraries")
         return
 
