diff --git a/src/adjacent.cpp b/src/adjacent.cpp
index 9e85d4a..fae92d5 100644
--- a/src/adjacent.cpp
+++ b/src/adjacent.cpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California
  *
@@ -16,11 +16,11 @@
  *
  * 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 "adjacent.hpp"
 #include "logger.hpp"
-#include "tlv/tlv-nlsr.hpp"
+#include "tlv-nlsr.hpp"
 
 namespace nlsr {
 
diff --git a/src/adjacent.hpp b/src/adjacent.hpp
index 178ae78..a540a5c 100644
--- a/src/adjacent.hpp
+++ b/src/adjacent.hpp
@@ -1,7 +1,8 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
  * Copyright (c) 2014-2020,  The University of Memphis,
- *                           Regents of the University of California
+ *                           Regents of the University of California,
+ *                           Arizona Board of Regents.
  *
  * This file is part of NLSR (Named-data Link State Routing).
  * See AUTHORS.md for complete list of NLSR authors and contributors.
diff --git a/src/communication/sync-logic-handler.cpp b/src/communication/sync-logic-handler.cpp
index 9dd2659..99bdeac 100644
--- a/src/communication/sync-logic-handler.cpp
+++ b/src/communication/sync-logic-handler.cpp
@@ -17,7 +17,7 @@
  *
  * 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 "sync-logic-handler.hpp"
 #include "common.hpp"
@@ -28,9 +28,6 @@
 
 namespace nlsr {
 
-const std::string NLSR_COMPONENT = "nlsr";
-const std::string LSA_COMPONENT = "LSA";
-
 INIT_LOGGER(SyncLogicHandler);
 
 SyncLogicHandler::SyncLogicHandler(ndn::Face& face, const IsLsaNew& isLsaNew,
@@ -49,12 +46,11 @@
   m_coorLsaUserPrefix = ndn::Name(m_confParam.getSyncUserPrefix())
                          .append(boost::lexical_cast<std::string>(Lsa::Type::COORDINATE));
 
-  if (m_confParam.getHyperbolicState() == HYPERBOLIC_STATE_OFF ||
-      m_confParam.getHyperbolicState() == HYPERBOLIC_STATE_DRY_RUN) {
+  if (m_confParam.getHyperbolicState() != HYPERBOLIC_STATE_ON) {
     m_syncLogic.addUserNode(m_adjLsaUserPrefix);
   }
-  else if (m_confParam.getHyperbolicState() == HYPERBOLIC_STATE_ON ||
-           m_confParam.getHyperbolicState() == HYPERBOLIC_STATE_DRY_RUN) {
+
+  if (m_confParam.getHyperbolicState() != HYPERBOLIC_STATE_OFF) {
     m_syncLogic.addUserNode(m_coorLsaUserPrefix);
   }
 }
@@ -64,8 +60,8 @@
 {
   NLSR_LOG_DEBUG("Update Name: " << updateName << " Seq no: " << highSeq);
 
-  int32_t nlsrPosition = util::getNameComponentPosition(updateName, nlsr::NLSR_COMPONENT);
-  int32_t lsaPosition = util::getNameComponentPosition(updateName, nlsr::LSA_COMPONENT);
+  int32_t nlsrPosition = util::getNameComponentPosition(updateName, NLSR_COMPONENT);
+  int32_t lsaPosition = util::getNameComponentPosition(updateName, LSA_COMPONENT);
 
   if (nlsrPosition < 0 || lsaPosition < 0) {
     NLSR_LOG_WARN("Received malformed sync update");
diff --git a/src/communication/sync-logic-handler.hpp b/src/communication/sync-logic-handler.hpp
index 47f6c9a..7deb06a 100644
--- a/src/communication/sync-logic-handler.hpp
+++ b/src/communication/sync-logic-handler.hpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California,
  *                           Arizona Board of Regents.
@@ -17,7 +17,7 @@
  *
  * 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/>.
- **/
+ */
 
 #ifndef NLSR_SYNC_LOGIC_HANDLER_HPP
 #define NLSR_SYNC_LOGIC_HANDLER_HPP
@@ -114,8 +114,8 @@
   SyncProtocolAdapter m_syncLogic;
 
 private:
-  static const std::string NLSR_COMPONENT;
-  static const std::string LSA_COMPONENT;
+  const std::string NLSR_COMPONENT = "nlsr";
+  const std::string LSA_COMPONENT = "LSA";
 };
 
 } // namespace nlsr
diff --git a/src/conf-file-processor.hpp b/src/conf-file-processor.hpp
index e33b50b..f7270ba 100644
--- a/src/conf-file-processor.hpp
+++ b/src/conf-file-processor.hpp
@@ -1,7 +1,8 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2019,  The University of Memphis,
- *                           Regents of the University of California
+/*
+ * Copyright (c) 2014-2020,  The University of Memphis,
+ *                           Regents of the University of California,
+ *                           Arizona Board of Regents.
  *
  * This file is part of NLSR (Named-data Link State Routing).
  * See AUTHORS.md for complete list of NLSR authors and contributors.
@@ -16,7 +17,7 @@
  *
  * 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/>.
- **/
+ */
 
 #ifndef NLSR_CONF_FILE_PROCESSOR_HPP
 #define NLSR_CONF_FILE_PROCESSOR_HPP
@@ -39,12 +40,7 @@
  * set all the parameters in NLSR to the received values. There are
  * defaults for any unconfigured settings.
  *
- * This is currently called by the wrapper class NlsrRunner to
- * populate the NLSR object with its configuration before NLSR is
- * started.
- *
  * \sa nlsr::ConfParameter
- * \sa NlsrRunner::run
  */
 class ConfFileProcessor
 {
diff --git a/src/lsa/adj-lsa.cpp b/src/lsa/adj-lsa.cpp
index e2d0a2b..e7dbf95 100644
--- a/src/lsa/adj-lsa.cpp
+++ b/src/lsa/adj-lsa.cpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California,
  *                           Arizona Board of Regents.
@@ -17,10 +17,10 @@
  *
  * 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 "adj-lsa.hpp"
-#include "tlv/tlv-nlsr.hpp"
+#include "tlv-nlsr.hpp"
 
 namespace nlsr {
 
@@ -141,4 +141,4 @@
   return os;
 }
 
-} // namespace nlsr
\ No newline at end of file
+} // namespace nlsr
diff --git a/src/lsa/coordinate-lsa.cpp b/src/lsa/coordinate-lsa.cpp
index a73ab76..b195e39 100644
--- a/src/lsa/coordinate-lsa.cpp
+++ b/src/lsa/coordinate-lsa.cpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California,
  *                           Arizona Board of Regents.
@@ -17,10 +17,10 @@
  *
  * 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 "coordinate-lsa.hpp"
-#include "tlv/tlv-nlsr.hpp"
+#include "tlv-nlsr.hpp"
 
 #include <boost/lexical_cast.hpp>
 
@@ -156,4 +156,4 @@
   return os;
 }
 
-} // namespace nlsr
\ No newline at end of file
+} // namespace nlsr
diff --git a/src/lsa/lsa.cpp b/src/lsa/lsa.cpp
index c0d6435..73ddbe7 100644
--- a/src/lsa/lsa.cpp
+++ b/src/lsa/lsa.cpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California,
  *                           Arizona Board of Regents.
@@ -17,13 +17,13 @@
  *
  * 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 "lsa.hpp"
 #include "nlsr.hpp"
 #include "name-prefix-list.hpp"
 #include "adjacent.hpp"
-#include "tlv/tlv-nlsr.hpp"
+#include "tlv-nlsr.hpp"
 
 namespace nlsr {
 
diff --git a/src/lsa/name-lsa.cpp b/src/lsa/name-lsa.cpp
index 37b7408..f73014b 100644
--- a/src/lsa/name-lsa.cpp
+++ b/src/lsa/name-lsa.cpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California,
  *                           Arizona Board of Regents.
@@ -17,10 +17,10 @@
  *
  * 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 "name-lsa.hpp"
-#include "tlv/tlv-nlsr.hpp"
+#include "tlv-nlsr.hpp"
 
 namespace nlsr {
 
diff --git a/src/lsdb.cpp b/src/lsdb.cpp
index e3fe9d3..9913751 100644
--- a/src/lsdb.cpp
+++ b/src/lsdb.cpp
@@ -17,7 +17,7 @@
  *
  * 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 "lsdb.hpp"
 
@@ -368,9 +368,9 @@
 void
 Lsdb::writeNameLsdbLog()
 {
-  NLSR_LOG_DEBUG("---------------Name LSDB-------------------");
+  NLSR_LOG_TRACE("---------------Name LSDB-------------------");
   for (const auto& nlsa : m_nameLsdb) {
-    NLSR_LOG_DEBUG(nlsa);
+    NLSR_LOG_TRACE(nlsa);
   }
 }
 
@@ -1247,9 +1247,9 @@
     return;
   }
 
-  NLSR_LOG_DEBUG("---------------Adj LSDB-------------------");
+  NLSR_LOG_TRACE("---------------Adj LSDB-------------------");
   for (const auto& adj : m_adjLsdb) {
-    NLSR_LOG_DEBUG(adj);
+    NLSR_LOG_TRACE(adj);
   }
 }
 
diff --git a/src/nlsr.cpp b/src/nlsr.cpp
index 73a1ac5..b2c6118 100644
--- a/src/nlsr.cpp
+++ b/src/nlsr.cpp
@@ -42,16 +42,14 @@
 Nlsr::Nlsr(ndn::Face& face, ndn::KeyChain& keyChain, ConfParameter& confParam)
   : m_face(face)
   , m_scheduler(face.getIoService())
-  , m_keyChain(keyChain)
   , m_confParam(confParam)
   , m_adjacencyList(confParam.getAdjacencyList())
   , m_namePrefixList(confParam.getNamePrefixList())
-  , m_validator(m_confParam.getValidator())
-  , m_fib(m_face, m_scheduler, m_adjacencyList, m_confParam, m_keyChain)
+  , m_fib(m_face, m_scheduler, m_adjacencyList, m_confParam, keyChain)
   , m_routingTable(m_scheduler, m_fib, m_lsdb, m_namePrefixTable, m_confParam)
   , m_namePrefixTable(m_fib, m_routingTable, m_routingTable.afterRoutingChange)
-  , m_lsdb(m_face, m_keyChain, m_confParam, m_namePrefixTable, m_routingTable)
-  , m_helloProtocol(m_face, m_keyChain, confParam, m_routingTable, m_lsdb)
+  , m_lsdb(m_face, keyChain, m_confParam, m_namePrefixTable, m_routingTable)
+  , m_helloProtocol(m_face, keyChain, confParam, m_routingTable, m_lsdb)
   , m_onNewLsaConnection(m_lsdb.getSync().onNewLsa->connect(
       [this] (const ndn::Name& updateName, uint64_t sequenceNumber,
               const ndn::Name& originRouter) {
@@ -69,10 +67,10 @@
                                ndn::time::milliseconds::max(), ndn::nfd::ROUTE_FLAG_CAPTURE, 0);
         }
       }))
-  , m_dispatcher(m_face, m_keyChain)
+  , m_dispatcher(m_face, keyChain)
   , m_datasetHandler(m_dispatcher, m_lsdb, m_routingTable)
-  , m_controller(m_face, m_keyChain)
-  , m_faceDatasetController(m_face, m_keyChain)
+  , m_controller(m_face, keyChain)
+  , m_faceDatasetController(m_face, keyChain)
   , m_prefixUpdateProcessor(m_dispatcher,
       m_confParam.getPrefixUpdateValidator(),
       m_namePrefixList,
diff --git a/src/nlsr.hpp b/src/nlsr.hpp
index 02e3625..9d7f032 100644
--- a/src/nlsr.hpp
+++ b/src/nlsr.hpp
@@ -61,8 +61,6 @@
 
 namespace nlsr {
 
-static ndn::Name DEFAULT_BROADCAST_PREFIX("/ndn/broadcast");
-
 class Nlsr
 {
 public:
@@ -208,12 +206,9 @@
 private:
   ndn::Face& m_face;
   ndn::Scheduler m_scheduler;
-  ndn::security::KeyChain& m_keyChain;
   ConfParameter& m_confParam;
   AdjacencyList& m_adjacencyList;
   NamePrefixList& m_namePrefixList;
-  bool m_isDaemonProcess;
-  ndn::security::ValidatorConfig& m_validator;
   std::vector<ndn::Name> m_strategySetOnRouters;
 
 PUBLIC_WITH_TESTS_ELSE_PRIVATE:
@@ -248,8 +243,6 @@
 
 private:
   ndn::nfd::FaceMonitor m_faceMonitor;
-
-  friend class NlsrRunner;
 };
 
 } // namespace nlsr
diff --git a/src/publisher/dataset-interest-handler.cpp b/src/publisher/dataset-interest-handler.cpp
index a574622..24c6e1a 100644
--- a/src/publisher/dataset-interest-handler.cpp
+++ b/src/publisher/dataset-interest-handler.cpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California,
  *                           Arizona Board of Regents.
@@ -17,7 +17,7 @@
  *
  * 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 "dataset-interest-handler.hpp"
 #include "nlsr.hpp"
@@ -40,8 +40,7 @@
                                                const RoutingTable& rt)
   : m_dispatcher(dispatcher)
   , m_lsdb(lsdb)
-  , m_routingTableEntries(rt.getRoutingTableEntry())
-  , m_dryRoutingTableEntries(rt.getDryRoutingTableEntry())
+  , m_routingTable(rt)
 {
   setDispatcher(m_dispatcher);
 }
@@ -93,51 +92,12 @@
   context.end();
 }
 
-
-std::vector<tlv::RoutingTable>
-DatasetInterestHandler::getTlvRTEntries()
-{
-  std::vector<tlv::RoutingTable> rtable;
-  for (const auto& rte : m_routingTableEntries) {
-    tlv::RoutingTable tlvRoutingTable;
-    std::shared_ptr<tlv::Destination> tlvDes = tlv::makeDes(rte);
-    tlvRoutingTable.setDestination(*tlvDes);
-    for (const auto& nh : rte.getNexthopList().getNextHops()) {
-      tlv::NextHop tlvNexthop;
-      tlvNexthop.setUri(nh.getConnectingFaceUri());
-      tlvNexthop.setCost(nh.getRouteCost());
-      tlvRoutingTable.addNexthops(tlvNexthop);
-    }
-    rtable.push_back(tlvRoutingTable);
-  }
-  if (!m_dryRoutingTableEntries.empty()) {
-    for (const auto& dryRte : m_dryRoutingTableEntries) {
-      tlv::RoutingTable tlvRoutingTable;
-      std::shared_ptr<tlv::Destination> tlvDes = tlv::makeDes(dryRte);
-      tlvRoutingTable.setDestination(*tlvDes);
-      for (const auto& nh : dryRte.getNexthopList().getNextHops()) {
-        tlv::NextHop tlvNexthop;
-        tlvNexthop.setUri(nh.getConnectingFaceUri());
-        tlvNexthop.setCost(nh.getRouteCost());
-        tlvRoutingTable.addNexthops(tlvNexthop);
-      }
-      rtable.push_back(tlvRoutingTable);
-    }
-  }
-  return rtable;
-}
-
 void
 DatasetInterestHandler::publishRtStatus(const ndn::Name& topPrefix, const ndn::Interest& interest,
                                         ndn::mgmt::StatusDatasetContext& context)
 {
-  NLSR_LOG_DEBUG("Received interest:  " << interest);
-  tlv::RoutingTableStatus rtStatus;
-  for (const tlv::RoutingTable& rt : getTlvRTEntries()) {
-    rtStatus.addRoutingTable(rt);
-  }
-  const ndn::Block& wire = rtStatus.wireEncode();
-  context.append(wire);
+  NLSR_LOG_DEBUG("Received interest: " << interest);
+  context.append(m_routingTable.wireEncode());
   context.end();
 }
 
diff --git a/src/publisher/dataset-interest-handler.hpp b/src/publisher/dataset-interest-handler.hpp
index 28a6c4c..b39ac25 100644
--- a/src/publisher/dataset-interest-handler.hpp
+++ b/src/publisher/dataset-interest-handler.hpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California,
  *                           Arizona Board of Regents.
@@ -17,7 +17,7 @@
  *
  * 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/>.
- **/
+ */
 
  /*! \file dataset-interest-handler.hpp
 
@@ -37,9 +37,6 @@
 #include "lsdb.hpp"
 #include "logger.hpp"
 
-#include "tlv/routing-table-status.hpp"
-#include "tlv/routing-table-entry.hpp"
-
 #include <ndn-cxx/mgmt/dispatcher.hpp>
 #include <ndn-cxx/face.hpp>
 #include <boost/noncopyable.hpp>
@@ -79,11 +76,6 @@
   void
   setDispatcher(ndn::mgmt::Dispatcher& dispatcher);
 
-  /*! \brief generate a TLV-format of routing table entry
-   */
-  std::vector<tlv::RoutingTable>
-  getTlvRTEntries();
-
   /*! \brief provide routing-table dataset
   */
   void
@@ -111,9 +103,7 @@
 private:
   ndn::mgmt::Dispatcher& m_dispatcher;
   const Lsdb& m_lsdb;
-
-  const std::list<RoutingTableEntry>& m_routingTableEntries;
-  const std::list<RoutingTableEntry>& m_dryRoutingTableEntries;
+  const RoutingTable& m_routingTable;
 };
 
 } // namespace nlsr
diff --git a/src/route/fib-entry.cpp b/src/route/fib-entry.cpp
index 0091245..bc11634 100644
--- a/src/route/fib-entry.cpp
+++ b/src/route/fib-entry.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2018,  The University of Memphis,
+/*
+ * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California
  *
  * This file is part of NLSR (Named-data Link State Routing).
@@ -16,7 +16,7 @@
  *
  * 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 "fib-entry.hpp"
 #include "logger.hpp"
@@ -30,7 +30,7 @@
 {
   NLSR_LOG_DEBUG("Name Prefix: " << m_name);
   NLSR_LOG_DEBUG("Seq No: " << m_seqNo);
-  m_nexthopList.writeLog();
+  NLSR_LOG_DEBUG(m_nexthopList);
 }
 
 } // namespace nlsr
diff --git a/src/route/fib.hpp b/src/route/fib.hpp
index 3e4ef68..27891eb 100644
--- a/src/route/fib.hpp
+++ b/src/route/fib.hpp
@@ -87,9 +87,6 @@
    * strictly necessary, because eventually those prefix registrations
    * will expire, but cleaning up after ourselves improves
    * performance.
-   *
-   * \sa NlsrRunner::run
-   *
    */
   void
   clean();
@@ -212,8 +209,6 @@
    * an entry is removed. Typically this happens when NLSR is
    * terminated or crashes, and we don't want the scheduler to crash
    * because it's referencing memory that has no valid function.
-   *
-   * \sa NlsrRunner::run
    */
   void
   cancelEntryRefresh(const FibEntry& entry);
diff --git a/src/route/map-entry.hpp b/src/route/map-entry.hpp
deleted file mode 100644
index e4c998c..0000000
--- a/src/route/map-entry.hpp
+++ /dev/null
@@ -1,71 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017,  The University of Memphis,
- *                           Regents of the University of California
- *
- * This file is part of NLSR (Named-data Link State Routing).
- * See AUTHORS.md for complete list of NLSR authors and contributors.
- *
- * NLSR is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NLSR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * 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/>.
- *
- **/
-
-#ifndef NLSR_MAP_ENTRY_HPP
-#define NLSR_MAP_ENTRY_HPP
-
-#include <boost/cstdint.hpp>
-#include <ndn-cxx/name.hpp>
-
-namespace nlsr {
-
-class MapEntry
-{
-public:
-  MapEntry()
-    : m_router()
-    , m_mappingNumber(-1)
-  {
-  }
-
-  ~MapEntry()
-  {
-  }
-
-  MapEntry(const ndn::Name& rtr, int32_t mn)
-  {
-    m_router = rtr;
-    m_mappingNumber = mn;
-  }
-
-  const ndn::Name&
-  getRouter() const
-  {
-    return m_router;
-  }
-
-  int32_t
-  getMappingNumber() const
-  {
-    return m_mappingNumber;
-  }
-
-  void
-  reset();
-
-private:
-  ndn::Name m_router;
-  int32_t m_mappingNumber;
-};
-
-} // namespace nlsr
-
-#endif // NLSR_MAP_ENTRY_HPP
diff --git a/src/route/map.cpp b/src/route/map.cpp
index 3f6513c..0aab84f 100644
--- a/src/route/map.cpp
+++ b/src/route/map.cpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California
  *
@@ -16,7 +16,7 @@
  *
  * 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 "map.hpp"
 #include "nlsr.hpp"
@@ -32,7 +32,7 @@
 void
 Map::addEntry(const ndn::Name& rtrName)
 {
-  MapEntry me(rtrName, m_mappingIndex);
+  MapEntry me {rtrName, m_mappingIndex};
   if (addEntry(me)) {
     m_mappingIndex++;
   }
@@ -48,43 +48,25 @@
 Map::getRouterNameByMappingNo(int32_t mn) const
 {
   auto&& mappingNumberView = m_entries.get<detail::byMappingNumber>();
-  auto iterator = mappingNumberView.find(mn);
-  if (iterator == mappingNumberView.end()) {
-    return {};
-  }
-  else {
-    return {iterator->getRouter()};
-  }
+  auto it = mappingNumberView.find(mn);
+  return it == mappingNumberView.end() ? ndn::nullopt : ndn::optional<ndn::Name>(it->router);
 }
 
 ndn::optional<int32_t>
 Map::getMappingNoByRouterName(const ndn::Name& rName)
 {
   auto&& routerNameView = m_entries.get<detail::byRouterName>();
-  auto iterator = routerNameView.find(rName);
-  if (iterator == routerNameView.end()) {
-    return {};
-  }
-  else {
-    return {iterator->getMappingNumber()};
-  }
-}
-
-void
-Map::reset()
-{
-  m_entries = detail::entryContainer{};
-  m_mappingIndex = 0;
+  auto it = routerNameView.find(rName);
+  return it == routerNameView.end() ? ndn::nullopt : ndn::optional<int32_t>(it->mappingNumber);
 }
 
 void
 Map::writeLog()
 {
   NLSR_LOG_DEBUG("---------------Map----------------------");
-  auto&& routerNameView = m_entries.get<detail::byRouterName>();
-  for (auto entry = routerNameView.begin(); entry != routerNameView.end(); entry++) {
-    NLSR_LOG_DEBUG("MapEntry: ( Router: " << entry->getRouter() << " Mapping No: "
-               << entry->getMappingNumber() << " )");
+  for (const auto& entry : m_entries.get<detail::byRouterName>()) {
+    NLSR_LOG_DEBUG("MapEntry: ( Router: " << entry.router << " Mapping No: " <<
+                    entry.mappingNumber << " )");
   }
 }
 
diff --git a/src/route/map.hpp b/src/route/map.hpp
index c9511bf..ae92d25 100644
--- a/src/route/map.hpp
+++ b/src/route/map.hpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California
  *
@@ -16,24 +16,25 @@
  *
  * 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/>.
- **/
+ */
 
 #ifndef NLSR_MAP_HPP
 #define NLSR_MAP_HPP
 
 #include "common.hpp"
-#include "map-entry.hpp"
-
-#include <list>
-#include <boost/cstdint.hpp>
 
 #include <boost/multi_index_container.hpp>
 #include <boost/multi_index/hashed_index.hpp>
-#include <boost/multi_index/mem_fun.hpp>
+#include <boost/multi_index/member.hpp>
 #include <boost/multi_index/tag.hpp>
 
 namespace nlsr {
 
+struct MapEntry {
+  ndn::Name router;
+  int32_t mappingNumber = -1;
+};
+
 namespace detail {
 
   using namespace boost::multi_index;
@@ -44,10 +45,10 @@
     MapEntry,
     indexed_by<
       hashed_unique<tag<byRouterName>,
-                    const_mem_fun<MapEntry, const ndn::Name&, &MapEntry::getRouter>,
+                    member<MapEntry, ndn::Name, &MapEntry::router>,
                     std::hash<ndn::Name>>,
       hashed_unique<tag<byMappingNumber>,
-                    const_mem_fun<MapEntry, int32_t, &MapEntry::getMappingNumber>>
+                    member<MapEntry, int32_t, &MapEntry::mappingNumber>>
       >
     >;
 
@@ -107,9 +108,6 @@
   ndn::optional<int32_t>
   getMappingNoByRouterName(const ndn::Name& rName);
 
-  void
-  reset();
-
   size_t
   getMapSize() const
   {
diff --git a/src/route/name-prefix-table-entry.cpp b/src/route/name-prefix-table-entry.cpp
index 9890101..368cc08 100644
--- a/src/route/name-prefix-table-entry.cpp
+++ b/src/route/name-prefix-table-entry.cpp
@@ -17,7 +17,7 @@
  *
  * 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 "name-prefix-table-entry.hpp"
 
@@ -32,7 +32,7 @@
 void
 NamePrefixTableEntry::generateNhlfromRteList()
 {
-  m_nexthopList.reset();
+  m_nexthopList.clear();
   for (auto iterator = m_rteList.begin(); iterator != m_rteList.end(); ++iterator) {
     for (auto nhItr = (*iterator)->getNexthopList().getNextHops().begin();
          nhItr != (*iterator)->getNexthopList().getNextHops().end();
@@ -76,18 +76,6 @@
   // be updated there.
 }
 
-void
-NamePrefixTableEntry::writeLog()
-{
-  NLSR_LOG_DEBUG("Name: " << m_namePrefix);
-  for (auto it = m_rteList.begin(); it != m_rteList.end(); ++it) {
-    NLSR_LOG_DEBUG("Destination: " << (*it)->getDestination());
-    NLSR_LOG_DEBUG("Nexthops: ");
-    (*it)->getNexthopList().writeLog();
-  }
-  m_nexthopList.writeLog();
-}
-
 bool
 operator==(const NamePrefixTableEntry& lhs, const NamePrefixTableEntry& rhs)
 {
@@ -104,8 +92,10 @@
 operator<<(std::ostream& os, const NamePrefixTableEntry& entry)
 {
   os << "Name: " << entry.getNamePrefix() << "\n";
+
   for (const auto& entryPtr : entry.getRteList()) {
-    os << "Destination: " << entryPtr->getDestination() << "\n";
+    os << "  Destination: " << entryPtr->getDestination() << "\n";
+    os << entryPtr->getNexthopList();
   }
   return os;
 }
diff --git a/src/route/name-prefix-table-entry.hpp b/src/route/name-prefix-table-entry.hpp
index 828d64a..c298e97 100644
--- a/src/route/name-prefix-table-entry.hpp
+++ b/src/route/name-prefix-table-entry.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2018,  The University of Memphis,
+/*
+ * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California,
  *                           Arizona Board of Regents.
  *
@@ -17,13 +17,12 @@
  *
  * 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/>.
- **/
+ */
 
 #ifndef NLSR_NAME_PREFIX_TABLE_ENTRY_HPP
 #define NLSR_NAME_PREFIX_TABLE_ENTRY_HPP
 
 #include "routing-table-pool-entry.hpp"
-
 #include "test-access-control.hpp"
 
 #include <list>
@@ -64,7 +63,7 @@
   {
     if (m_rteList.size() > 0) {
       for (auto it = m_rteList.begin(); it != m_rteList.end(); ++it) {
-        (*it)->getNexthopList().reset();
+        (*it)->getNexthopList().clear();
       }
     }
   }
@@ -112,7 +111,6 @@
 PUBLIC_WITH_TESTS_ELSE_PRIVATE:
   std::list<std::shared_ptr<RoutingTablePoolEntry>> m_rteList;
   NexthopList m_nexthopList;
-
 };
 
 bool
diff --git a/src/route/name-prefix-table.cpp b/src/route/name-prefix-table.cpp
index b38bbea..55f0c54 100644
--- a/src/route/name-prefix-table.cpp
+++ b/src/route/name-prefix-table.cpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California,
  *                           Arizona Board of Regents.
@@ -17,7 +17,7 @@
  *
  * 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 "name-prefix-table.hpp"
 
@@ -228,7 +228,7 @@
     }
     else if (sourceEntry == entries.end()) {
       NLSR_LOG_DEBUG("Routing entry: " << poolEntry->getDestination() << " now has no next-hops.");
-      poolEntry->getNexthopList().reset();
+      poolEntry->getNexthopList().clear();
       for (const auto& nameEntry : poolEntry->namePrefixTableEntries) {
         auto nameEntryFullPtr = nameEntry.second.lock();
         addEntry(nameEntryFullPtr->getNamePrefix(), poolEntry->getDestination());
diff --git a/src/route/nexthop-list.cpp b/src/route/nexthop-list.cpp
index 8b9366e..7ab1352 100644
--- a/src/route/nexthop-list.cpp
+++ b/src/route/nexthop-list.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2018,  The University of Memphis,
+/*
+ * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California,
  *                           Arizona Board of Regents.
  *
@@ -17,17 +17,16 @@
  *
  * 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 "nexthop-list.hpp"
 #include "common.hpp"
 #include "nexthop.hpp"
-#include "logger.hpp"
+
+#include <ndn-cxx/util/ostream-joiner.hpp>
 
 namespace nlsr {
 
-INIT_LOGGER(route.NexthopList);
-
 static bool
 nexthopAddCompare(const NextHop& nh1, const NextHop& nh2)
 {
@@ -71,21 +70,16 @@
 std::ostream&
 operator<<(std::ostream& os, const NexthopList& nhl)
 {
-  NexthopList& ucnhl = const_cast<NexthopList&>(nhl);
-  os << "NexthopList(\nNext hops: ";
-  for (auto&& nh : ucnhl.getNextHops()) {
-    os << nh;
-  }
-  os << ")";
+  os << "    ";
+  std::copy(nhl.cbegin(), nhl.cend(), ndn::make_ostream_joiner(os, "\n    "));
   return os;
 }
 
 void
 NexthopList::addNextHop(const NextHop& nh)
 {
-  std::set<NextHop, NextHopComparator>::iterator it = std::find_if(m_nexthopList.begin(),
-                                                 m_nexthopList.end(),
-                                                 std::bind(&nexthopAddCompare, _1, nh));
+  auto it = std::find_if(m_nexthopList.begin(), m_nexthopList.end(),
+                         std::bind(&nexthopAddCompare, _1, nh));
   if (it == m_nexthopList.end()) {
     m_nexthopList.insert(nh);
   }
@@ -98,23 +92,11 @@
 void
 NexthopList::removeNextHop(const NextHop& nh)
 {
-  std::set<NextHop, NextHopComparator>::iterator it = std::find_if(m_nexthopList.begin(),
-                                                 m_nexthopList.end(),
-                                                 std::bind(&nexthopRemoveCompare, _1, nh));
+  auto it = std::find_if(m_nexthopList.begin(), m_nexthopList.end(),
+                         std::bind(&nexthopRemoveCompare, _1, nh));
   if (it != m_nexthopList.end()) {
     m_nexthopList.erase(it);
   }
 }
 
-void
-NexthopList::writeLog() const
-{
-  int i = 1;
-
-  for (const auto& nexthop : m_nexthopList) {
-    NLSR_LOG_DEBUG("Nexthop " << i++ << ": " << nexthop.getConnectingFaceUri() <<
-                   " Route Cost: " << nexthop.getRouteCost());
-  }
-}
-
 } // namespace nlsr
diff --git a/src/route/nexthop-list.hpp b/src/route/nexthop-list.hpp
index e405889..537448e 100644
--- a/src/route/nexthop-list.hpp
+++ b/src/route/nexthop-list.hpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California
  *
@@ -16,7 +16,7 @@
  *
  * 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/>.
- **/
+ */
 
 #ifndef NLSR_NEXTHOP_LIST_HPP
 #define NLSR_NEXTHOP_LIST_HPP
@@ -47,13 +47,7 @@
 class NexthopList
 {
 public:
-  NexthopList()
-  {
-  }
-
-  ~NexthopList()
-  {
-  }
+  NexthopList() = default;
 
   /*! \brief Adds a next hop to the list.
     \param nh The next hop.
@@ -80,7 +74,7 @@
   }
 
   void
-  reset()
+  clear()
   {
     m_nexthopList.clear();
   }
@@ -93,6 +87,7 @@
 
   typedef std::set<NextHop, NextHopComparator>::iterator iterator;
   typedef std::set<NextHop, NextHopComparator>::const_iterator const_iterator;
+  typedef std::set<NextHop, NextHopComparator>::reverse_iterator reverse_iterator;
 
   iterator
   begin()
@@ -118,8 +113,17 @@
     return m_nexthopList.end();
   }
 
-  void
-  writeLog() const;
+  reverse_iterator
+  rbegin() const
+  {
+    return m_nexthopList.rbegin();
+  }
+
+  reverse_iterator
+  rend() const
+  {
+    return m_nexthopList.rend();
+  }
 
 private:
   std::set<NextHop, NextHopComparator> m_nexthopList;
diff --git a/src/route/nexthop.cpp b/src/route/nexthop.cpp
index 14bfb43..11399aa 100644
--- a/src/route/nexthop.cpp
+++ b/src/route/nexthop.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017,  The University of Memphis,
+/*
+ * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California
  *
  * This file is part of NLSR (Named-data Link State Routing).
@@ -16,29 +16,91 @@
  *
  * 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 "nexthop.hpp"
+#include "tlv-nlsr.hpp"
+
+#include <ndn-cxx/encoding/block-helpers.hpp>
 
 namespace nlsr {
 
+template<ndn::encoding::Tag TAG>
+size_t
+NextHop::wireEncode(ndn::EncodingImpl<TAG>& block) const
+{
+  size_t totalLength = 0;
+
+  totalLength += ndn::encoding::prependDoubleBlock(block, ndn::tlv::nlsr::CostDouble, m_routeCost);
+  totalLength += ndn::encoding::prependStringBlock(block, ndn::tlv::nlsr::Uri, m_connectingFaceUri);
+
+  totalLength += block.prependVarNumber(totalLength);
+  totalLength += block.prependVarNumber(ndn::tlv::nlsr::NextHop);
+
+  return totalLength;
+}
+
+NDN_CXX_DEFINE_WIRE_ENCODE_INSTANTIATIONS(NextHop);
+
+const ndn::Block&
+NextHop::wireEncode() const
+{
+  if (m_wire.hasWire()) {
+    return m_wire;
+  }
+
+  ndn::EncodingEstimator estimator;
+  size_t estimatedSize = wireEncode(estimator);
+
+  ndn::EncodingBuffer buffer(estimatedSize, 0);
+  wireEncode(buffer);
+
+  m_wire = buffer.block();
+
+  return m_wire;
+}
+
+void
+NextHop::wireDecode(const ndn::Block& wire)
+{
+  m_connectingFaceUri = "";
+  m_routeCost = 0;
+
+  m_wire = wire;
+
+  if (m_wire.type() != ndn::tlv::nlsr::NextHop) {
+    std::stringstream error;
+    error << "Expected NextHop Block, but Block is of a different type: #"
+          << m_wire.type();
+    BOOST_THROW_EXCEPTION(Error(error.str()));
+  }
+
+  m_wire.parse();
+
+  ndn::Block::element_const_iterator val = m_wire.elements_begin();
+
+  if (val != m_wire.elements_end() && val->type() == ndn::tlv::nlsr::Uri) {
+    m_connectingFaceUri.assign(reinterpret_cast<const char*>(val->value()), val->value_size());
+    ++val;
+  }
+  else {
+    BOOST_THROW_EXCEPTION(Error("Missing required Uri field"));
+  }
+
+  m_routeCost = ndn::encoding::readDouble(*val);
+}
+
 bool
 operator==(const NextHop& lhs, const NextHop& rhs)
 {
-  return ((lhs.getRouteCostAsAdjustedInteger() == rhs.getRouteCostAsAdjustedInteger())
-          &&
-          (lhs.getConnectingFaceUri() == rhs.getConnectingFaceUri()));
+  return (lhs.getRouteCostAsAdjustedInteger() == rhs.getRouteCostAsAdjustedInteger()) &&
+         (lhs.getConnectingFaceUri() == rhs.getConnectingFaceUri());
 }
 
 std::ostream&
 operator<<(std::ostream& os, const NextHop& hop)
 {
-  os << "Nexthop("
-     << "face-uri: " << hop.getConnectingFaceUri()
-     << ", cost: " << hop.getRouteCost() << ")";
-
+  os << "NextHop(Uri: " << hop.getConnectingFaceUri() << ", Cost: " << hop.getRouteCost() << ")";
   return os;
 }
 
diff --git a/src/route/nexthop.hpp b/src/route/nexthop.hpp
index e24df7b..7f91cfe 100644
--- a/src/route/nexthop.hpp
+++ b/src/route/nexthop.hpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California
  *
@@ -16,22 +16,36 @@
  *
  * 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/>.
- **/
+ */
 
 #ifndef NLSR_ROUTE_NEXTHOP_HPP
 #define NLSR_ROUTE_NEXTHOP_HPP
 
 #include "test-access-control.hpp"
 
+#include <ndn-cxx/encoding/block.hpp>
+#include <ndn-cxx/encoding/encoding-buffer.hpp>
+#include <ndn-cxx/encoding/tlv.hpp>
+
 #include <iostream>
 #include <cmath>
 #include <boost/cstdint.hpp>
 
 namespace nlsr {
 
+/*! \brief Data abstraction for Nexthop
+ *
+ *   NextHop := NEXTHOP-TYPE TLV-LENGTH
+ *                Uri
+ *                Cost
+ *
+ * \sa https://redmine.named-data.net/projects/nlsr/wiki/Routing_Table_Dataset
+ */
 class NextHop
 {
 public:
+  using Error = ndn::tlv::Error;
+
   NextHop()
     : m_connectingFaceUri()
     , m_routeCost(0)
@@ -40,10 +54,15 @@
   }
 
   NextHop(const std::string& cfu, double rc)
-    : m_isHyperbolic(false)
+    : m_connectingFaceUri(cfu)
+    , m_routeCost(rc)
+    , m_isHyperbolic(false)
   {
-    m_connectingFaceUri = cfu;
-    m_routeCost = rc;
+  }
+
+  NextHop(const ndn::Block& block)
+  {
+    wireDecode(block);
   }
 
   const std::string&
@@ -96,11 +115,23 @@
     return m_isHyperbolic;
   }
 
+  template<ndn::encoding::Tag TAG>
+  size_t
+  wireEncode(ndn::EncodingImpl<TAG>& block) const;
+
+  const ndn::Block&
+  wireEncode() const;
+
+  void
+  wireDecode(const ndn::Block& wire);
+
 private:
   std::string m_connectingFaceUri;
   double m_routeCost;
   bool m_isHyperbolic;
 
+  mutable ndn::Block m_wire;
+
 PUBLIC_WITH_TESTS_ELSE_PRIVATE:
   /*! \brief Used to adjust floating point route costs to integers
       Since NFD uses integer route costs in the FIB, hyperbolic paths with similar route costs
@@ -115,6 +146,8 @@
   static const uint64_t HYPERBOLIC_COST_ADJUSTMENT_FACTOR = 1000;
 };
 
+NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS(NextHop);
+
 bool
 operator==(const NextHop& lhs, const NextHop& rhs);
 
diff --git a/src/route/routing-table-entry.cpp b/src/route/routing-table-entry.cpp
index 750dc79..7320d91 100644
--- a/src/route/routing-table-entry.cpp
+++ b/src/route/routing-table-entry.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017,  The University of Memphis,
+/*
+ * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California
  *
  * This file is part of NLSR (Named-data Link State Routing).
@@ -16,19 +16,96 @@
  *
  * 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 "routing-table-entry.hpp"
 #include "nexthop-list.hpp"
+#include "tlv-nlsr.hpp"
 
 namespace nlsr {
 
+template<ndn::encoding::Tag TAG>
+size_t
+RoutingTableEntry::wireEncode(ndn::EncodingImpl<TAG>& block) const
+{
+  size_t totalLength = 0;
+
+  for (auto it = m_nexthopList.rbegin(); it != m_nexthopList.rend(); ++it) {
+    totalLength += it->wireEncode(block);
+  }
+
+  totalLength += m_destination.wireEncode(block);
+
+  totalLength += block.prependVarNumber(totalLength);
+  totalLength += block.prependVarNumber(ndn::tlv::nlsr::RoutingTableEntry);
+
+  return totalLength;
+}
+
+NDN_CXX_DEFINE_WIRE_ENCODE_INSTANTIATIONS(RoutingTableEntry);
+
+const ndn::Block&
+RoutingTableEntry::wireEncode() const
+{
+  if (m_wire.hasWire()) {
+    return m_wire;
+  }
+
+  ndn::EncodingEstimator estimator;
+  size_t estimatedSize = wireEncode(estimator);
+
+  ndn::EncodingBuffer buffer(estimatedSize, 0);
+  wireEncode(buffer);
+
+  m_wire = buffer.block();
+
+  return m_wire;
+}
+
+void
+RoutingTableEntry::wireDecode(const ndn::Block& wire)
+{
+  m_nexthopList.clear();
+
+  m_wire = wire;
+
+  if (m_wire.type() != ndn::tlv::nlsr::RoutingTableEntry) {
+    std::stringstream error;
+    error << "Expected RoutingTable Block, but Block is of a different type: #"
+          << m_wire.type();
+    BOOST_THROW_EXCEPTION(Error(error.str()));
+  }
+
+  m_wire.parse();
+
+  auto val = m_wire.elements_begin();
+
+  if (val != m_wire.elements_end() && val->type() == ndn::tlv::Name) {
+    m_destination.wireDecode(*val);
+    ++val;
+  }
+  else {
+    BOOST_THROW_EXCEPTION(Error("Missing required destination field"));
+  }
+
+  for (; val != m_wire.elements_end(); ++val) {
+    if (val->type() == ndn::tlv::nlsr::NextHop) {
+      m_nexthopList.addNextHop(NextHop(*val));
+    }
+    else {
+      std::stringstream error;
+      error << "Expected NextHop Block, but Block is of a different type: #"
+            << m_wire.type();
+      BOOST_THROW_EXCEPTION(Error(error.str()));
+    }
+  }
+}
+
 std::ostream&
 operator<<(std::ostream& os, const RoutingTableEntry& rte)
 {
-  os << "RoutingTableEntry("
-     << "Destination: " << rte.getDestination()
-     << "Next hop list: " << rte.getNexthopList() << ")";
+  os << "  Destination: " << rte.getDestination() << "\n"
+     << rte.getNexthopList() << "\n";
 
   return os;
 }
diff --git a/src/route/routing-table-entry.hpp b/src/route/routing-table-entry.hpp
index 83731b9..ffbbfac 100644
--- a/src/route/routing-table-entry.hpp
+++ b/src/route/routing-table-entry.hpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California
  *
@@ -16,27 +16,38 @@
  *
  * 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/>.
- *
- **/
+ */
 
 #ifndef NLSR_ROUTING_TABLE_ENTRY_HPP
 #define NLSR_ROUTING_TABLE_ENTRY_HPP
 
 #include "nexthop-list.hpp"
 
+#include <ndn-cxx/encoding/block.hpp>
+#include <ndn-cxx/encoding/encoding-buffer.hpp>
+#include <ndn-cxx/encoding/tlv.hpp>
 #include <ndn-cxx/name.hpp>
 
 namespace nlsr {
 
+/*! \brief Data abstraction for RouteTableInfo
+ *
+ *   RoutingTableEntry := ROUTINGTABLEENTRY-TYPE TLV-LENGTH
+ *                          Name
+ *                          NexthopList*
+ *
+ * \sa https://redmine.named-data.net/projects/nlsr/wiki/Routing_Table_DataSet
+ */
 class RoutingTableEntry
 {
 public:
-  RoutingTableEntry()
-  {
-  }
+  using Error = ndn::tlv::Error;
 
-  ~RoutingTableEntry()
+  RoutingTableEntry() = default;
+
+  RoutingTableEntry(const ndn::Block& block)
   {
+    wireDecode(block);
   }
 
   RoutingTableEntry(const ndn::Name& dest)
@@ -65,15 +76,29 @@
   inline bool
   operator==(RoutingTableEntry& rhs)
   {
-    return ((*this).getDestination() == rhs.getDestination() &&
-            (*this).getNexthopList() == rhs.getNexthopList());
+    return m_destination == rhs.getDestination() &&
+           m_nexthopList == rhs.getNexthopList();
   }
 
+  template<ndn::encoding::Tag TAG>
+  size_t
+  wireEncode(ndn::EncodingImpl<TAG>& block) const;
+
+  const ndn::Block&
+  wireEncode() const;
+
+  void
+  wireDecode(const ndn::Block& wire);
+
 protected:
   ndn::Name m_destination;
   NexthopList m_nexthopList;
+
+  mutable ndn::Block m_wire;
 };
 
+NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS(RoutingTableEntry);
+
 std::ostream&
 operator<<(std::ostream& os, const RoutingTableEntry& rte);
 
diff --git a/src/route/routing-table.cpp b/src/route/routing-table.cpp
index 3fcd654..a2ec12b 100644
--- a/src/route/routing-table.cpp
+++ b/src/route/routing-table.cpp
@@ -16,7 +16,7 @@
  *
  * 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 "routing-table.hpp"
 #include "nlsr.hpp"
@@ -26,6 +26,7 @@
 #include "routing-table-entry.hpp"
 #include "name-prefix-table.hpp"
 #include "logger.hpp"
+#include "tlv-nlsr.hpp"
 
 #include <list>
 #include <string>
@@ -94,24 +95,22 @@
         // Inform the NPT that updates have been made
         NLSR_LOG_DEBUG("Calling Update NPT With new Route");
         (*afterRoutingChange)(m_rTable);
-        writeLog();
+        NLSR_LOG_DEBUG(*this);
         m_namePrefixTable.writeLog();
         m_fib.writeLog();
       }
       else {
-        NLSR_LOG_DEBUG("Adjacency building is scheduled, so"
-                   " routing table can not be calculated :(");
+        NLSR_LOG_DEBUG("Adjacency building is scheduled, so routing table can not be calculated :(");
       }
     }
     else {
-      NLSR_LOG_DEBUG("No Adj LSA of router itself,"
-                 " so Routing table can not be calculated :(");
+      NLSR_LOG_DEBUG("No Adj LSA of router itself, so Routing table can not be calculated :(");
       clearRoutingTable();
       clearDryRoutingTable(); // for dry run options
       // need to update NPT here
       NLSR_LOG_DEBUG("Calling Update NPT With new Route");
       (*afterRoutingChange)(m_rTable);
-      writeLog();
+      NLSR_LOG_DEBUG(*this);
       m_namePrefixTable.writeLog();
       m_fib.writeLog();
       // debugging purpose end
@@ -199,26 +198,6 @@
 }
 
 void
-RoutingTable::writeLog()
-{
-  NLSR_LOG_DEBUG("---------------Routing Table------------------");
-  for (const auto& rte : m_rTable) {
-    NLSR_LOG_DEBUG("Destination: " << rte.getDestination());
-    NLSR_LOG_DEBUG("Nexthops: ");
-    rte.getNexthopList().writeLog();
-  }
-
-  if (m_confParam.getHyperbolicState() == HYPERBOLIC_STATE_DRY_RUN) {
-    NLSR_LOG_DEBUG("--------Hyperbolic Routing Table(Dry)---------");
-    for (const auto& rte : m_dryTable) {
-      NLSR_LOG_DEBUG("Destination: " << rte.getDestination());
-      NLSR_LOG_DEBUG("Nexthops: ");
-      rte.getNexthopList().writeLog();
-    }
-  }
-}
-
-void
 RoutingTable::addNextHopToDryTable(const ndn::Name& destRouter, NextHop& nh)
 {
   NLSR_LOG_DEBUG("Adding " << nh << " to dry table for destination: " << destRouter);
@@ -251,4 +230,100 @@
   }
 }
 
+template<ndn::encoding::Tag TAG>
+size_t
+RoutingTableStatus::wireEncode(ndn::EncodingImpl<TAG>& block) const
+{
+  size_t totalLength = 0;
+
+  for (auto it = m_dryTable.rbegin(); it != m_dryTable.rend(); ++it) {
+    totalLength += it->wireEncode(block);
+  }
+
+  for (auto it = m_rTable.rbegin(); it != m_rTable.rend(); ++it) {
+    totalLength += it->wireEncode(block);
+  }
+
+  totalLength += block.prependVarNumber(totalLength);
+  totalLength += block.prependVarNumber(ndn::tlv::nlsr::RoutingTable);
+
+  return totalLength;
+}
+
+NDN_CXX_DEFINE_WIRE_ENCODE_INSTANTIATIONS(RoutingTableStatus);
+
+const ndn::Block&
+RoutingTableStatus::wireEncode() const
+{
+  if (m_wire.hasWire()) {
+    return m_wire;
+  }
+
+  ndn::EncodingEstimator estimator;
+  size_t estimatedSize = wireEncode(estimator);
+
+  ndn::EncodingBuffer buffer(estimatedSize, 0);
+  wireEncode(buffer);
+
+  m_wire = buffer.block();
+
+  return m_wire;
+}
+
+void
+RoutingTableStatus::wireDecode(const ndn::Block& wire)
+{
+  m_rTable.clear();
+
+  m_wire = wire;
+
+  if (m_wire.type() != ndn::tlv::nlsr::RoutingTable) {
+    std::stringstream error;
+    error << "Expected RoutingTableStatus Block, but Block is of a different type: #"
+          << m_wire.type();
+    BOOST_THROW_EXCEPTION(Error(error.str()));
+  }
+
+  m_wire.parse();
+
+  auto val = m_wire.elements_begin();
+
+  std::set<ndn::Name> destinations;
+  for (; val != m_wire.elements_end() && val->type() == ndn::tlv::nlsr::RoutingTableEntry; ++val) {
+    auto entry = RoutingTableEntry(*val);
+
+    if (destinations.emplace(entry.getDestination()).second) {
+      m_rTable.push_back(entry);
+    }
+    else {
+      // If destination already exists then this is the start of dry HR table
+      m_dryTable.push_back(entry);
+    }
+  }
+
+  if (val != m_wire.elements_end()) {
+    std::stringstream error;
+    error << "Expected the end of elements, but Block is of a different type: #"
+          << val->type();
+    BOOST_THROW_EXCEPTION(Error(error.str()));
+  }
+}
+
+std::ostream&
+operator<<(std::ostream& os, const RoutingTableStatus& rts)
+{
+  os << "Routing Table:\n";
+  for (const auto& rte : rts.getRoutingTableEntry()) {
+    os << rte;
+  }
+
+  if (!rts.getDryRoutingTableEntry().empty()) {
+    os << "Dry-Run Hyperbolic Routing Table:\n";
+    for (const auto& rte : rts.getDryRoutingTableEntry()) {
+      os << rte;
+    }
+  }
+  return os;
+}
+
 } // namespace nlsr
diff --git a/src/route/routing-table.hpp b/src/route/routing-table.hpp
index af2ba93..8f9309b 100644
--- a/src/route/routing-table.hpp
+++ b/src/route/routing-table.hpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California
  *
@@ -16,8 +16,7 @@
  *
  * 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/>.
- *
- **/
+ */
 
 #ifndef NLSR_ROUTING_TABLE_HPP
 #define NLSR_ROUTING_TABLE_HPP
@@ -35,7 +34,58 @@
 
 class NextHop;
 
-class RoutingTable : boost::noncopyable
+/*! \brief Data abstraction for routing table status
+ *
+ * RtStatus := RT-STATUS-TYPE TLV-LENGTH
+ *              RouteTableEntry*
+ *
+ * \sa https://redmine.named-data.net/projects/nlsr/wiki/Routing_Table_Dataset
+ */
+class RoutingTableStatus
+{
+public:
+  using Error = ndn::tlv::Error;
+
+  RoutingTableStatus() = default;
+
+  RoutingTableStatus(const ndn::Block& block)
+  {
+    wireDecode(block);
+  }
+
+  const std::list<RoutingTableEntry>&
+  getRoutingTableEntry() const
+  {
+    return m_rTable;
+  }
+
+  const std::list<RoutingTableEntry>&
+  getDryRoutingTableEntry() const
+  {
+    return m_dryTable;
+  }
+
+  const ndn::Block&
+  wireEncode() const;
+
+private:
+  void
+  wireDecode(const ndn::Block& wire);
+
+  template<ndn::encoding::Tag TAG>
+  size_t
+  wireEncode(ndn::EncodingImpl<TAG>& block) const;
+
+PUBLIC_WITH_TESTS_ELSE_PROTECTED:
+  std::list<RoutingTableEntry> m_dryTable;
+  std::list<RoutingTableEntry> m_rTable;
+  mutable ndn::Block m_wire;
+};
+
+std::ostream&
+operator<<(std::ostream& os, const RoutingTableStatus& rts);
+
+class RoutingTable : public RoutingTableStatus
 {
 public:
   explicit
@@ -84,18 +134,6 @@
     return m_routingCalcInterval;
   }
 
-  const std::list<RoutingTableEntry>&
-  getRoutingTableEntry() const
-  {
-    return m_rTable;
-  }
-
-  const std::list<RoutingTableEntry>&
-  getDryRoutingTableEntry() const
-  {
-    return m_dryTable;
-  }
-
   uint64_t
   getRtSize()
   {
@@ -117,23 +155,15 @@
   void
   clearDryRoutingTable();
 
-  void
-  writeLog();
-
 public:
   std::unique_ptr<AfterRoutingChange> afterRoutingChange;
 
-PUBLIC_WITH_TESTS_ELSE_PRIVATE:
-  std::list<RoutingTableEntry> m_rTable;
-
 private:
   ndn::Scheduler& m_scheduler;
   Fib& m_fib;
   Lsdb& m_lsdb;
   NamePrefixTable& m_namePrefixTable;
 
-  std::list<RoutingTableEntry> m_dryTable;
-
   ndn::time::seconds m_routingCalcInterval;
 
   bool m_isRoutingTableCalculating;
diff --git a/src/tlv/tlv-nlsr.hpp b/src/tlv-nlsr.hpp
similarity index 97%
rename from src/tlv/tlv-nlsr.hpp
rename to src/tlv-nlsr.hpp
index e7d2253..93cfd2d 100644
--- a/src/tlv/tlv-nlsr.hpp
+++ b/src/tlv-nlsr.hpp
@@ -17,7 +17,7 @@
  *
  * 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/>.
- **/
+ */
 
 #ifndef NLSR_TLV_NLSR_HPP
 #define NLSR_TLV_NLSR_HPP
@@ -47,7 +47,6 @@
   ExpirationTime              = 139,
   Cost                        = 140,
   Uri                         = 141,
-  Destination                 = 142,
   NextHop                     = 143,
   RoutingTable                = 144,
   RoutingTableEntry           = 145
diff --git a/src/tlv/destination.cpp b/src/tlv/destination.cpp
deleted file mode 100644
index a1ea06f..0000000
--- a/src/tlv/destination.cpp
+++ /dev/null
@@ -1,122 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2018,  The University of Memphis,
- *                           Regents of the University of California,
- *                           Arizona Board of Regents.
- *
- * This file is part of NLSR (Named-data Link State Routing).
- * See AUTHORS.md for complete list of NLSR authors and contributors.
- *
- * NLSR is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NLSR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * 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 "destination.hpp"
-#include "tlv-nlsr.hpp"
-
-#include <ndn-cxx/util/concepts.hpp>
-#include <ndn-cxx/encoding/block-helpers.hpp>
-
-namespace nlsr {
-namespace tlv {
-
-BOOST_CONCEPT_ASSERT((ndn::WireEncodable<Destination>));
-BOOST_CONCEPT_ASSERT((ndn::WireDecodable<Destination>));
-static_assert(std::is_base_of<ndn::tlv::Error, Destination::Error>::value,
-              "Destination::Error must inherit from tlv::Error");
-
-Destination::Destination() = default;
-
-Destination::Destination(const ndn::Block& block)
-{
-  wireDecode(block);
-}
-
-template<ndn::encoding::Tag TAG>
-size_t
-Destination::wireEncode(ndn::EncodingImpl<TAG>& encoder) const
-{
-  size_t totalLength = 0;
-
-  totalLength += m_name.wireEncode(encoder);
-
-  totalLength += encoder.prependVarNumber(totalLength);
-  totalLength += encoder.prependVarNumber(ndn::tlv::nlsr::Destination);
-
-  return totalLength;
-}
-
-NDN_CXX_DEFINE_WIRE_ENCODE_INSTANTIATIONS(Destination);
-
-const ndn::Block&
-Destination::wireEncode() const
-{
-  if (m_wire.hasWire()) {
-    return m_wire;
-  }
-
-  ndn::EncodingEstimator estimator;
-  size_t estimatedSize = wireEncode(estimator);
-
-  ndn::EncodingBuffer buffer(estimatedSize, 0);
-  wireEncode(buffer);
-
-  m_wire = buffer.block();
-
-  return m_wire;
-}
-
-void
-Destination::wireDecode(const ndn::Block& wire)
-{
-  m_name.clear();
-
-  m_wire = wire;
-
-  if (m_wire.type() != ndn::tlv::nlsr::Destination) {
-    std::stringstream error;
-    error << "Expected Destination Block, but Block is of a different type: #"
-          << m_wire.type();
-    BOOST_THROW_EXCEPTION(Error(error.str()));
-  }
-
-  m_wire.parse();
-
-  ndn::Block::element_const_iterator val = m_wire.elements_begin();
-
-  if (val != m_wire.elements_end() && val->type() == ndn::tlv::Name) {
-    m_name.wireDecode(*val);
-    ++val;
-  }
-  else {
-    BOOST_THROW_EXCEPTION(Error("Missing required Name field"));
-  }
-}
-
-std::ostream&
-operator<<(std::ostream& os, const Destination& Destination)
-{
-  os << "Destination: " << Destination.getName();
-  return os;
-}
-
-std::shared_ptr<Destination>
-makeDes(const RoutingTableEntry& rte)
-{
-  std::shared_ptr<Destination> desInfo = std::make_shared<Destination>();
-
-  desInfo->setName(rte.getDestination());
-
-  return desInfo;
-}
-
-} // namespace tlv
-} // namespace nlsr
diff --git a/src/tlv/destination.hpp b/src/tlv/destination.hpp
deleted file mode 100644
index 859c8a8..0000000
--- a/src/tlv/destination.hpp
+++ /dev/null
@@ -1,105 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2018,  The University of Memphis,
- *                           Regents of the University of California,
- *                           Arizona Board of Regents.
- *
- * This file is part of NLSR (Named-data Link State Routing).
- * See AUTHORS.md for complete list of NLSR authors and contributors.
- *
- * NLSR is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NLSR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * 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/>.
- **/
-
-#ifndef NLSR_TLV_DESTINATION_HPP
-#define NLSR_TLV_DESTINATION_HPP
-
-#include "route/routing-table-entry.hpp"
-
-#include <ndn-cxx/util/time.hpp>
-#include <ndn-cxx/encoding/block.hpp>
-#include <ndn-cxx/encoding/encoding-buffer.hpp>
-#include <ndn-cxx/encoding/tlv.hpp>
-#include <ndn-cxx/name.hpp>
-#include <boost/throw_exception.hpp>
-
-#include <list>
-
-namespace nlsr {
-namespace tlv {
-
-/*! \brief Data abstraction for Destination
- *
- *    Destination := DESTINATION-TYPE TLV-LENGTH
- *                     Name
- *
- * \sa https://redmine.named-data.net/projects/nlsr/wiki/Routing_Table_DataSet
- */
-class Destination
-{
-public:
-  class Error : public ndn::tlv::Error
-  {
-  public:
-    explicit
-    Error(const std::string& what)
-      : ndn::tlv::Error(what)
-    {
-    }
-  };
-
-  Destination();
-
-  explicit
-  Destination(const ndn::Block& block);
-
-  const ndn::Name&
-  getName() const
-  {
-    return m_name;
-  }
-
-  Destination&
-  setName(const ndn::Name& name)
-  {
-    m_name = name;
-    m_wire.reset();
-    return *this;
-  }
-
-  template<ndn::encoding::Tag TAG>
-  size_t
-  wireEncode(ndn::EncodingImpl<TAG>& block) const;
-
-  const ndn::Block&
-  wireEncode() const;
-
-  void
-  wireDecode(const ndn::Block& wire);
-
-private:
-  ndn::Name m_name;
-
-  mutable ndn::Block m_wire;
-};
-
-NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS(Destination);
-
-std::ostream&
-operator<<(std::ostream& os, const Destination& destination);
-
-std::shared_ptr<Destination>
-makeDes(const RoutingTableEntry& rte);
-
-} // namespace tlv
-} // namespace nlsr
-
-#endif // NLSR_TLV_DESTINATION_HPP
diff --git a/src/tlv/nexthop.cpp b/src/tlv/nexthop.cpp
deleted file mode 100644
index 508bf1a..0000000
--- a/src/tlv/nexthop.cpp
+++ /dev/null
@@ -1,123 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2014-2020,  The University of Memphis,
- *                           Regents of the University of California,
- *                           Arizona Board of Regents.
- *
- * This file is part of NLSR (Named-data Link State Routing).
- * See AUTHORS.md for complete list of NLSR authors and contributors.
- *
- * NLSR is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NLSR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * 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 "nexthop.hpp"
-#include "tlv-nlsr.hpp"
-
-#include <ndn-cxx/util/concepts.hpp>
-#include <ndn-cxx/encoding/block-helpers.hpp>
-
-namespace nlsr {
-namespace tlv {
-
-BOOST_CONCEPT_ASSERT((ndn::WireEncodable<NextHop>));
-BOOST_CONCEPT_ASSERT((ndn::WireDecodable<NextHop>));
-static_assert(std::is_base_of<ndn::tlv::Error, NextHop::Error>::value,
-              "NextHop::Error must inherit from tlv::Error");
-
-NextHop::NextHop()
-  : m_cost(0)
-{
-}
-
-NextHop::NextHop(const ndn::Block& block)
-{
-  wireDecode(block);
-}
-
-template<ndn::encoding::Tag TAG>
-size_t
-NextHop::wireEncode(ndn::EncodingImpl<TAG>& block) const
-{
-  size_t totalLength = 0;
-
-  totalLength += ndn::encoding::prependDoubleBlock(block, ndn::tlv::nlsr::CostDouble, m_cost);
-
-  totalLength += block.prependByteArrayBlock(
-    ndn::tlv::nlsr::Uri, reinterpret_cast<const uint8_t*>(m_uri.c_str()), m_uri.size());
-
-  totalLength += block.prependVarNumber(totalLength);
-  totalLength += block.prependVarNumber(ndn::tlv::nlsr::NextHop);
-
-  return totalLength;
-}
-
-NDN_CXX_DEFINE_WIRE_ENCODE_INSTANTIATIONS(NextHop);
-
-const ndn::Block&
-NextHop::wireEncode() const
-{
-  if (m_wire.hasWire()) {
-    return m_wire;
-  }
-
-  ndn::EncodingEstimator estimator;
-  size_t estimatedSize = wireEncode(estimator);
-
-  ndn::EncodingBuffer buffer(estimatedSize, 0);
-  wireEncode(buffer);
-
-  m_wire = buffer.block();
-
-  return m_wire;
-}
-
-void
-NextHop::wireDecode(const ndn::Block& wire)
-{
-  m_uri = "";
-  m_cost = 0;
-
-  m_wire = wire;
-
-  if (m_wire.type() != ndn::tlv::nlsr::NextHop) {
-    std::stringstream error;
-    error << "Expected NextHop Block, but Block is of a different type: #"
-          << m_wire.type();
-    BOOST_THROW_EXCEPTION(Error(error.str()));
-  }
-
-  m_wire.parse();
-
-  ndn::Block::element_const_iterator val = m_wire.elements_begin();
-
-  if (val != m_wire.elements_end() && val->type() == ndn::tlv::nlsr::Uri) {
-    m_uri.assign(reinterpret_cast<const char*>(val->value()), val->value_size());
-    ++val;
-  }
-  else {
-    BOOST_THROW_EXCEPTION(Error("Missing required Uri field"));
-  }
-
-  m_cost = ndn::encoding::readDouble(*val);
-}
-
-std::ostream&
-operator<<(std::ostream& os, const NextHop& nexthop)
-{
-  os << "NextHop("
-     << "Uri: " << nexthop.getUri() << ", "<< "Cost: " << nexthop.getCost() << ")" << std::endl;
-
-  return os;
-}
-
-} // namespace tlv
-} // namespace nlsr
diff --git a/src/tlv/nexthop.hpp b/src/tlv/nexthop.hpp
deleted file mode 100644
index 9b0f72c..0000000
--- a/src/tlv/nexthop.hpp
+++ /dev/null
@@ -1,114 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2018,  The University of Memphis,
- *                           Regents of the University of California,
- *                           Arizona Board of Regents.
- *
- * This file is part of NLSR (Named-data Link State Routing).
- * See AUTHORS.md for complete list of NLSR authors and contributors.
- *
- * NLSR is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NLSR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * 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/>.
- **/
-
-#ifndef NLSR_TLV_NEXTHOP_HPP
-#define NLSR_TLV_NEXTHOP_HPP
-
-#include <ndn-cxx/util/time.hpp>
-#include <ndn-cxx/encoding/block.hpp>
-#include <ndn-cxx/encoding/encoding-buffer.hpp>
-#include <ndn-cxx/encoding/tlv.hpp>
-#include <ndn-cxx/name.hpp>
-#include <boost/throw_exception.hpp>
-
-namespace nlsr {
-namespace tlv {
-
-/*! \brief Data abstraction for Nexthop
- *
- *   NextHop := NEXTHOP-TYPE TLV-LENGTH
- *                Uri
- *                Cost
- *
- * \sa https://redmine.named-data.net/projects/nlsr/wiki/Routing_Table_Dataset
- */
-class NextHop
-{
-public:
-  class Error : public ndn::tlv::Error
-  {
-  public:
-    explicit
-    Error(const std::string& what)
-      : ndn::tlv::Error(what)
-    {
-    }
-  };
-
-  NextHop();
-
-  explicit
-  NextHop(const ndn::Block& block);
-
-  const std::string&
-  getUri() const
-  {
-    return m_uri;
-  }
-
-  NextHop&
-  setUri(const std::string& uri)
-  {
-    m_uri = uri;
-    m_wire.reset();
-    return *this;
-  }
-
-  double
-  getCost() const
-  {
-    return m_cost;
-  }
-
-  NextHop&
-  setCost(double cost)
-  {
-    m_cost = cost;
-    m_wire.reset();
-    return *this;
-  }
-
-  template<ndn::encoding::Tag TAG>
-  size_t
-  wireEncode(ndn::EncodingImpl<TAG>& block) const;
-
-  const ndn::Block&
-  wireEncode() const;
-
-  void
-  wireDecode(const ndn::Block& wire);
-
-private:
-  std::string m_uri;
-  double m_cost;
-
-  mutable ndn::Block m_wire;
-};
-
-NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS(NextHop);
-
-std::ostream&
-operator<<(std::ostream& os, const NextHop& nexthop);
-
-} // namespace tlv
-} // namespace nlsr
-
-#endif // NLSR_TLV_NEXTHOP_HPP
diff --git a/src/tlv/routing-table-entry.cpp b/src/tlv/routing-table-entry.cpp
deleted file mode 100644
index 255d418..0000000
--- a/src/tlv/routing-table-entry.cpp
+++ /dev/null
@@ -1,164 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2020,  The University of Memphis,
- *                           Regents of the University of California,
- *                           Arizona Board of Regents.
- *
- * This file is part of NLSR (Named-data Link State Routing).
- * See AUTHORS.md for complete list of NLSR authors and contributors.
- *
- * NLSR is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NLSR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * 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 "routing-table-entry.hpp"
-#include "tlv-nlsr.hpp"
-
-#include <ndn-cxx/util/concepts.hpp>
-#include <ndn-cxx/encoding/block-helpers.hpp>
-
-namespace nlsr {
-namespace tlv {
-
-BOOST_CONCEPT_ASSERT((ndn::WireEncodable<RoutingTable>));
-BOOST_CONCEPT_ASSERT((ndn::WireDecodable<RoutingTable>));
-static_assert(std::is_base_of<ndn::tlv::Error, RoutingTable::Error>::value,
-              "RoutingTable::Error must inherit from tlv::Error");
-
-RoutingTable::RoutingTable()
-  : m_hasNexthops(false)
-{
-}
-
-RoutingTable::RoutingTable(const ndn::Block& block)
-{
-  wireDecode(block);
-}
-
-bool
-RoutingTable::hasNexthops() const
-{
-  return m_hasNexthops;
-}
-
-RoutingTable&
-RoutingTable::addNexthops(const NextHop& nexthop)
-{
-  m_nexthops.push_back(nexthop);
-  m_wire.reset();
-  m_hasNexthops = true;
-  return *this;
-}
-
-RoutingTable&
-RoutingTable::clearNexthops()
-{
-  m_nexthops.clear();
-  m_hasNexthops = false;
-  return *this;
-}
-
-template<ndn::encoding::Tag TAG>
-size_t
-RoutingTable::wireEncode(ndn::EncodingImpl<TAG>& block) const
-{
-  size_t totalLength = 0;
-
-  for (std::list<NextHop>::const_reverse_iterator it = m_nexthops.rbegin();
-       it != m_nexthops.rend(); ++it) {
-    totalLength += it->wireEncode(block);
-  }
-
-  totalLength += m_des.wireEncode(block);
-
-  totalLength += block.prependVarNumber(totalLength);
-  totalLength += block.prependVarNumber(ndn::tlv::nlsr::RoutingTableEntry);
-
-  return totalLength;
-}
-
-NDN_CXX_DEFINE_WIRE_ENCODE_INSTANTIATIONS(RoutingTable);
-
-const ndn::Block&
-RoutingTable::wireEncode() const
-{
-  if (m_wire.hasWire()) {
-    return m_wire;
-  }
-
-  ndn::EncodingEstimator estimator;
-  size_t estimatedSize = wireEncode(estimator);
-
-  ndn::EncodingBuffer buffer(estimatedSize, 0);
-  wireEncode(buffer);
-
-  m_wire = buffer.block();
-
-  return m_wire;
-}
-
-void
-RoutingTable::wireDecode(const ndn::Block& wire)
-{
-  m_hasNexthops = false;
-  m_nexthops.clear();
-
-  m_wire = wire;
-
-  if (m_wire.type() != ndn::tlv::nlsr::RoutingTableEntry) {
-    std::stringstream error;
-    error << "Expected RoutingTable Block, but Block is of a different type: #"
-          << m_wire.type();
-    BOOST_THROW_EXCEPTION(Error(error.str()));
-  }
-
-  m_wire.parse();
-
-  ndn::Block::element_const_iterator val = m_wire.elements_begin();
-
-  if (val != m_wire.elements_end() && val->type() == ndn::tlv::nlsr::Destination) {
-    m_des.wireDecode(*val);
-    ++val;
-  }
-  else {
-    BOOST_THROW_EXCEPTION(Error("Missing required destination field"));
-  }
-
-  for (; val != m_wire.elements_end(); ++val) {
-    if (val->type() == ndn::tlv::nlsr::NextHop) {
-      m_nexthops.push_back(NextHop(*val));
-      m_hasNexthops = true;
-    }
-    else {
-      std::stringstream error;
-      error << "Expected NextHop Block, but Block is of a different type: #"
-            << m_wire.type();
-      BOOST_THROW_EXCEPTION(Error(error.str()));
-    }
-  }
-}
-
-std::ostream&
-operator<<(std::ostream& os, const RoutingTable& routingtable)
-{
-  os << routingtable.getDestination() << std::endl;
-  os << "NexthopList(" << std::endl;
-
-  for (const auto& rtentry : routingtable) {
-    os << rtentry;
-  }
-
-  os << ")";
-  return os;
-}
-
-} // namespace tlv
-} // namespace nlsr
diff --git a/src/tlv/routing-table-entry.hpp b/src/tlv/routing-table-entry.hpp
deleted file mode 100644
index 167f63a..0000000
--- a/src/tlv/routing-table-entry.hpp
+++ /dev/null
@@ -1,156 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2018,  The University of Memphis,
- *                           Regents of the University of California,
- *                           Arizona Board of Regents.
- *
- * This file is part of NLSR (Named-data Link State Routing).
- * See AUTHORS.md for complete list of NLSR authors and contributors.
- *
- * NLSR is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NLSR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * 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/>.
- **/
-
-#ifndef NLSR_TLV_ROUTING_TABLE_ENTRY_HPP
-#define NLSR_TLV_ROUTING_TABLE_ENTRY_HPP
-
-#include "destination.hpp"
-#include "nexthop.hpp"
-
-#include <ndn-cxx/util/time.hpp>
-#include <ndn-cxx/encoding/block.hpp>
-#include <ndn-cxx/encoding/encoding-buffer.hpp>
-#include <ndn-cxx/encoding/tlv.hpp>
-#include <ndn-cxx/name.hpp>
-
-#include <list>
-
-namespace nlsr {
-namespace tlv {
-
-/*! \brief Data abstraction for RouteTableInfo
- *
- *   RouteTableInfo := ROUTINGTABLE-TYPE TLV-LENGTH
- *                       Destination
- *                       NexthopList*
- *
- * \sa https://redmine.named-data.net/projects/nlsr/wiki/Routing_Table_DataSet
- */
-class RoutingTable
-{
-public:
-  class Error : public ndn::tlv::Error
-  {
-  public:
-    explicit
-    Error(const std::string& what)
-      : ndn::tlv::Error(what)
-    {
-    }
-  };
-
-  typedef std::list<NextHop> HopList;
-  typedef HopList::const_iterator const_iterator;
-
-  RoutingTable();
-
-  explicit
-  RoutingTable(const ndn::Block& block);
-
-  const Destination&
-  getDestination() const
-  {
-    return m_des;
-  }
-
-  RoutingTable&
-  setDestination(const Destination& des)
-  {
-    m_des = des;
-    m_wire.reset();
-    return *this;
-  }
-
-  uint64_t
-  getRtSize() const
-  {
-    return m_size;
-  }
-
-  RoutingTable&
-  setRtSize(uint64_t size)
-  {
-    m_size = size;
-    m_wire.reset();
-    return *this;
-  }
-
-  bool
-  hasNexthops() const;
-
-  const std::list<NextHop>&
-  getNextHops() const
-  {
-    return m_nexthops;
-  }
-
-  RoutingTable&
-  addNexthops(const NextHop& nexthop);
-
-  RoutingTable&
-  clearNexthops();
-
-  template<ndn::encoding::Tag TAG>
-  size_t
-  wireEncode(ndn::EncodingImpl<TAG>& block) const;
-
-  const ndn::Block&
-  wireEncode() const;
-
-  void
-  wireDecode(const ndn::Block& wire);
-
-  const_iterator
-  begin() const;
-
-  const_iterator
-  end() const;
-
-private:
-  Destination m_des;
-  uint64_t m_size;
-  bool m_hasNexthops;
-  HopList m_nexthops;
-
-  mutable ndn::Block m_wire;
-};
-
-NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS(RoutingTable);
-
-inline RoutingTable::const_iterator
-RoutingTable::begin() const
-{
-  return m_nexthops.begin();
-}
-
-inline RoutingTable::const_iterator
-RoutingTable::end() const
-{
-  return m_nexthops.end();
-}
-
-std::ostream&
-operator<<(std::ostream& os, const RoutingTable& routetable);
-
-} // namespace tlv
-} // namespace nlsr
-
-#endif // NLSR_TLV_ROUTING_TABLE_ENTRY_HPP
diff --git a/src/tlv/routing-table-status.cpp b/src/tlv/routing-table-status.cpp
deleted file mode 100644
index 00d2c78..0000000
--- a/src/tlv/routing-table-status.cpp
+++ /dev/null
@@ -1,161 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2020,  The University of Memphis,
- *                           Regents of the University of California,
- *                           Arizona Board of Regents.
- *
- * This file is part of NLSR (Named-data Link State Routing).
- * See AUTHORS.md for complete list of NLSR authors and contributors.
- *
- * NLSR is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NLSR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * 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 "routing-table-status.hpp"
-#include "tlv-nlsr.hpp"
-
-#include <ndn-cxx/util/concepts.hpp>
-#include <ndn-cxx/encoding/block-helpers.hpp>
-
-namespace nlsr {
-namespace tlv {
-
-BOOST_CONCEPT_ASSERT((ndn::WireEncodable<RoutingTableStatus>));
-BOOST_CONCEPT_ASSERT((ndn::WireDecodable<RoutingTableStatus>));
-static_assert(std::is_base_of<ndn::tlv::Error, RoutingTableStatus::Error>::value,
-              "RoutingTableStatus::Error must inherit from tlv::Error");
-
-RoutingTableStatus::RoutingTableStatus()
-  : m_hasRoutingtable(false)
-{
-}
-
-RoutingTableStatus::RoutingTableStatus(const ndn::Block& block)
-{
-  wireDecode(block);
-}
-
-RoutingTableStatus&
-RoutingTableStatus::addRoutingTable(const RoutingTable& routetable)
-{
-  m_routingtables.push_back(routetable);
-  m_wire.reset();
-  m_hasRoutingtable = true;
-  return *this;
-}
-
-RoutingTableStatus&
-RoutingTableStatus::clearRoutingTable()
-{
-  m_routingtables.clear();
-  m_hasRoutingtable = false;
-  return *this;
-}
-
-bool
-RoutingTableStatus::hasRoutingTable()
-{
-  return m_hasRoutingtable;
-}
-
-template<ndn::encoding::Tag TAG>
-size_t
-RoutingTableStatus::wireEncode(ndn::EncodingImpl<TAG>& block) const
-{
-  size_t totalLength = 0;
-
-  for (std::list<RoutingTable>::const_reverse_iterator it = m_routingtables.rbegin();
-       it != m_routingtables.rend(); ++it) {
-    totalLength += it->wireEncode(block);
-  }
-
-  totalLength += block.prependVarNumber(totalLength);
-  totalLength += block.prependVarNumber(ndn::tlv::nlsr::RoutingTable);
-
-  return totalLength;
-}
-
-NDN_CXX_DEFINE_WIRE_ENCODE_INSTANTIATIONS(RoutingTableStatus);
-
-const ndn::Block&
-RoutingTableStatus::wireEncode() const
-{
-  if (m_wire.hasWire()) {
-    return m_wire;
-  }
-
-  ndn::EncodingEstimator estimator;
-  size_t estimatedSize = wireEncode(estimator);
-
-  ndn::EncodingBuffer buffer(estimatedSize, 0);
-  wireEncode(buffer);
-
-  m_wire = buffer.block();
-
-  return m_wire;
-}
-
-void
-RoutingTableStatus::wireDecode(const ndn::Block& wire)
-{
-  m_routingtables.clear();
-
-  m_hasRoutingtable = false;
-
-  m_wire = wire;
-
-  if (m_wire.type() != ndn::tlv::nlsr::RoutingTable) {
-    std::stringstream error;
-    error << "Expected RoutingTableStatus Block, but Block is of a different type: #"
-          << m_wire.type();
-    BOOST_THROW_EXCEPTION(Error(error.str()));
-  }
-
-  m_wire.parse();
-
-  ndn::Block::element_const_iterator val = m_wire.elements_begin();
-
-  for (; val != m_wire.elements_end() && val->type() == ndn::tlv::nlsr::RoutingTableEntry; ++val) {
-    m_routingtables.push_back(RoutingTable(*val));
-    m_hasRoutingtable = true;
-  }
-
-  if (val != m_wire.elements_end()) {
-    std::stringstream error;
-    error << "Expected the end of elements, but Block is of a different type: #"
-          << val->type();
-    BOOST_THROW_EXCEPTION(Error(error.str()));
-  }
-}
-
-std::ostream&
-operator<<(std::ostream& os, const RoutingTableStatus& rtStatus)
-{
-  os << "Routing Table Status: " << std::endl;
-
-  bool isFirst = true;
-
-  for (const auto& routingtable : rtStatus.getRoutingtable()) {
-    if (isFirst) {
-      isFirst = false;
-    }
-    else {
-      os << ", ";
-    }
-
-    os << routingtable;
-  }
-
-  return os;
-}
-
-} // namespace tlv
-} // namespace nlsr
diff --git a/src/tlv/routing-table-status.hpp b/src/tlv/routing-table-status.hpp
deleted file mode 100644
index 97d083f..0000000
--- a/src/tlv/routing-table-status.hpp
+++ /dev/null
@@ -1,106 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2018,  The University of Memphis,
- *                           Regents of the University of California,
- *                           Arizona Board of Regents.
- *
- * This file is part of NLSR (Named-data Link State Routing).
- * See AUTHORS.md for complete list of NLSR authors and contributors.
- *
- * NLSR is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NLSR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * 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/>.
- **/
-
-#ifndef NLSR_TLV_ROUTING_TABLE_STATUS_HPP
-#define NLSR_TLV_ROUTING_TABLE_STATUS_HPP
-
-#include "routing-table-entry.hpp"
-#include "destination.hpp"
-
-#include <ndn-cxx/util/time.hpp>
-#include <ndn-cxx/encoding/block.hpp>
-#include <ndn-cxx/encoding/encoding-buffer.hpp>
-#include <ndn-cxx/encoding/tlv.hpp>
-#include <ndn-cxx/name.hpp>
-
-#include <list>
-
-namespace nlsr {
-namespace tlv {
-
-/*! \brief Data abstraction for routing table status
- *
- * RtStatus := RT-STATUS-TYPE TLV-LENGTH
- *              RouteTableInfo*
- *
- * \sa https://redmine.named-data.net/projects/nlsr/wiki/Routing_Table_Dataset
- */
-class RoutingTableStatus
-{
-public:
-  class Error : public ndn::tlv::Error
-  {
-  public:
-    explicit
-    Error(const std::string& what)
-      : ndn::tlv::Error(what)
-    {
-    }
-  };
-
-  typedef std::list<RoutingTable> RTList;
-
-  RoutingTableStatus();
-
-  explicit
-  RoutingTableStatus(const ndn::Block& block);
-
-  const std::list<RoutingTable>&
-  getRoutingtable() const
-  {
-    return m_routingtables;
-  }
-
-  RoutingTableStatus&
-  addRoutingTable(const RoutingTable& routeTable);
-
-  RoutingTableStatus&
-  clearRoutingTable();
-
-  bool
-  hasRoutingTable();
-
-  template<ndn::encoding::Tag TAG>
-  size_t
-  wireEncode(ndn::EncodingImpl<TAG>& block) const;
-
-  const ndn::Block&
-  wireEncode() const;
-
-  void
-  wireDecode(const ndn::Block& wire);
-
-private:
-  RTList m_routingtables;
-  bool m_hasRoutingtable;
-
-  mutable ndn::Block m_wire;
-};
-
-NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS(RoutingTableStatus);
-
-std::ostream&
-operator<<(std::ostream& os, const RoutingTableStatus& rtStatus);
-
-} // namespace tlv
-} // namespace nlsr
-
-#endif // NLSR_TLV_ROUTING_TABLE_STATUS_HPP
diff --git a/tests/publisher/test-dataset-interest-handler.cpp b/tests/publisher/test-dataset-interest-handler.cpp
index 7342f62..2ec5d35 100644
--- a/tests/publisher/test-dataset-interest-handler.cpp
+++ b/tests/publisher/test-dataset-interest-handler.cpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California,
  *                           Arizona Board of Regents.
@@ -17,10 +17,10 @@
  *
  * 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 "publisher/dataset-interest-handler.hpp"
-#include "tlv/tlv-nlsr.hpp"
+#include "tlv-nlsr.hpp"
 
 #include "tests/test-common.hpp"
 #include "publisher-fixture.hpp"
diff --git a/tests/test-hyperbolic-calculator.cpp b/tests/route/test-hyperbolic-calculator.cpp
similarity index 98%
rename from tests/test-hyperbolic-calculator.cpp
rename to tests/route/test-hyperbolic-calculator.cpp
index 2a787ba..a697e2e 100644
--- a/tests/test-hyperbolic-calculator.cpp
+++ b/tests/route/test-hyperbolic-calculator.cpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California,
  *                           Arizona Board of Regents.
@@ -17,14 +17,13 @@
  *
  * 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 "test-common.hpp"
+#include "../test-common.hpp"
 
 #include "route/routing-table-calculator.hpp"
 
 #include "adjacency-list.hpp"
-//#include "lsa.hpp"
 #include "lsdb.hpp"
 #include "nlsr.hpp"
 #include "route/map.hpp"
diff --git a/tests/test-link-state-calculator.cpp b/tests/route/test-link-state-calculator.cpp
similarity index 99%
rename from tests/test-link-state-calculator.cpp
rename to tests/route/test-link-state-calculator.cpp
index f43c4f6..a0d04df 100644
--- a/tests/test-link-state-calculator.cpp
+++ b/tests/route/test-link-state-calculator.cpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California,
  *                           Arizona Board of Regents.
@@ -17,15 +17,14 @@
  *
  * 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 "route/routing-table-calculator.hpp"
 
 #include "adjacency-list.hpp"
-//#include "lsa.hpp"
 #include "lsdb.hpp"
 #include "nlsr.hpp"
-#include "test-common.hpp"
+#include "../test-common.hpp"
 #include "route/map.hpp"
 #include "route/routing-table.hpp"
 #include "adjacent.hpp"
diff --git a/tests/route/test-map-entry.cpp b/tests/route/test-map-entry.cpp
deleted file mode 100644
index 0429dde..0000000
--- a/tests/route/test-map-entry.cpp
+++ /dev/null
@@ -1,45 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2019,  The University of Memphis,
- *                           Regents of the University of California
- *
- * This file is part of NLSR (Named-data Link State Routing).
- * See AUTHORS.md for complete list of NLSR authors and contributors.
- *
- * NLSR is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NLSR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * 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/>.
- *
- * \author Ashlesh Gawande <agawande@memphis.edu>
- **/
-
-#include "route/map.hpp"
-#include "tests/boost-test.hpp"
-
-namespace nlsr {
-namespace test {
-
-BOOST_AUTO_TEST_SUITE(TestMapEntry)
-
-BOOST_AUTO_TEST_CASE(MapEntryConstructorAndGetters)
-{
-  std::string rtr = "r0";
-
-  MapEntry me1(rtr, 1);
-
-  BOOST_CHECK_EQUAL(me1.getRouter(), "r0");
-
-  BOOST_CHECK_EQUAL(me1.getMappingNumber(), 1);
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace test
-} // namespace nlsr
diff --git a/tests/route/test-nexthop-list.cpp b/tests/route/test-nexthop-list.cpp
index 5bdef4d..9ab8572 100644
--- a/tests/route/test-nexthop-list.cpp
+++ b/tests/route/test-nexthop-list.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2019,  The University of Memphis,
+/*
+ * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California,
  *                           Arizona Board of Regents.
  *
@@ -17,7 +17,7 @@
  *
  * 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 "route/nexthop-list.hpp"
 #include "route/nexthop.hpp"
@@ -101,7 +101,7 @@
   NexthopList::iterator it = list.begin();
   BOOST_CHECK_EQUAL(it->getConnectingFaceUri(), hopA.getConnectingFaceUri());
 
-  list.reset();
+  list.clear();
   list.addNextHop(hopZ);
   list.addNextHop(hopA);
 
@@ -118,7 +118,7 @@
   shortUriHop.setRouteCost(25);
   shortUriHop.setConnectingFaceUri("AAA");
 
-  list.reset();
+  list.clear();
   list.addNextHop(longUriHop);
   list.addNextHop(shortUriHop);
 
diff --git a/tests/route/test-nexthop.cpp b/tests/route/test-nexthop.cpp
index 3a6a5fd..a11c221 100644
--- a/tests/route/test-nexthop.cpp
+++ b/tests/route/test-nexthop.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2019,  The University of Memphis,
+/*
+ * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California
  *
  * This file is part of NLSR (Named-data Link State Routing).
@@ -16,9 +16,7 @@
  *
  * 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/>.
- *
- * \author Ashlesh Gawande <agawande@memphis.edu>
- **/
+ */
 
 #include "route/nexthop.hpp"
 #include "tests/boost-test.hpp"
@@ -102,6 +100,50 @@
   BOOST_CHECK(hop1.getRouteCostAsAdjustedInteger() > hop2.getRouteCostAsAdjustedInteger());
 }
 
+const uint8_t NexthopData[] =
+{
+  // Header
+  0x8f, 0x1d,
+  // Uri
+  0x8d, 0x11, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x6e, 0x65, 0x78, 0x74, 0x68, 0x6f,
+  0x70, 0x2f, 0x74, 0x6c, 0x76,
+  // Cost
+  0x86, 0x08, 0x3f, 0xfa, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66
+};
+
+BOOST_AUTO_TEST_CASE(NexthopEncode)
+{
+  NextHop nexthops1;
+  nexthops1.setConnectingFaceUri("/test/nexthop/tlv");
+  nexthops1.setRouteCost(1.65);
+
+  const ndn::Block& wire = nexthops1.wireEncode();
+  BOOST_REQUIRE_EQUAL_COLLECTIONS(NexthopData,
+                                  NexthopData + sizeof(NexthopData),
+                                  wire.begin(), wire.end());
+}
+
+BOOST_AUTO_TEST_CASE(NexthopDecode)
+{
+  NextHop nexthops1;
+
+  nexthops1.wireDecode(ndn::Block(NexthopData, sizeof(NexthopData)));
+
+  BOOST_REQUIRE_EQUAL(nexthops1.getConnectingFaceUri(), "/test/nexthop/tlv");
+  BOOST_REQUIRE_EQUAL(nexthops1.getRouteCost(), 1.65);
+}
+
+BOOST_AUTO_TEST_CASE(AdjacencyOutputStream)
+{
+  NextHop nexthops1;
+  nexthops1.setConnectingFaceUri("/test/nexthop/tlv");
+  nexthops1.setRouteCost(99);
+
+  std::ostringstream os;
+  os << nexthops1;
+  BOOST_CHECK_EQUAL(os.str(), "NextHop(Uri: /test/nexthop/tlv, Cost: 99)");
+}
+
 BOOST_AUTO_TEST_SUITE_END()
 
 } // namespace test
diff --git a/tests/route/test-routing-table-entry.cpp b/tests/route/test-routing-table-entry.cpp
index 574abc2..c17b981 100644
--- a/tests/route/test-routing-table-entry.cpp
+++ b/tests/route/test-routing-table-entry.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2019,  The University of Memphis,
+/*
+ * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California
  *
  * This file is part of NLSR (Named-data Link State Routing).
@@ -16,9 +16,7 @@
  *
  * 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/>.
- *
- * \author Ashlesh Gawande <agawande@memphis.edu>
- **/
+ */
 
 #include "route/routing-table-entry.hpp"
 #include "tests/boost-test.hpp"
@@ -35,6 +33,134 @@
   BOOST_CHECK_EQUAL(rte1.getDestination(), "router1");
 }
 
+const uint8_t RoutingTableEntryWithNexthopsData[] =
+{
+  // Header
+  0x91, 0x35,
+  // Destination Name
+  0x07, 0x07, 0x08, 0x05, 0x64, 0x65, 0x73, 0x74, 0x31, 0x8f, 0x14,
+  // Nexthop
+  0x8d, 0x08, 0x6e, 0x65, 0x78, 0x74, 0x68, 0x6f, 0x70, 0x31, 0x86, 0x08, 0x3f, 0xfa,
+  0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x8f, 0x14, 0x8d, 0x08,
+  // Nexthop
+  0x6e, 0x65, 0x78, 0x74, 0x68, 0x6f, 0x70, 0x32, 0x86, 0x08, 0x3f, 0xfa, 0x66, 0x66,
+  0x66, 0x66, 0x66, 0x66
+};
+
+const uint8_t RoutingTableEntryWithoutNexthopsData[] =
+{
+  // Header
+  0x91, 0x09,
+  // Destination Name
+  0x07, 0x07, 0x08, 0x05, 0x64, 0x65, 0x73, 0x74, 0x31
+};
+
+BOOST_AUTO_TEST_CASE(RoutingTableEntryEncodeWithNexthops)
+{
+  RoutingTableEntry rte(ndn::Name("dest1"));
+
+  NextHop nexthops1;
+  nexthops1.setConnectingFaceUri("nexthop1");
+  nexthops1.setRouteCost(1.65);
+  rte.getNexthopList().addNextHop(nexthops1);
+
+  NextHop nexthops2;
+  nexthops2.setConnectingFaceUri("nexthop2");
+  nexthops2.setRouteCost(1.65);
+  rte.getNexthopList().addNextHop(nexthops2);
+
+  const ndn::Block& wire = rte.wireEncode();
+
+  BOOST_REQUIRE_EQUAL_COLLECTIONS(RoutingTableEntryWithNexthopsData,
+                                  RoutingTableEntryWithNexthopsData +
+                                    sizeof(RoutingTableEntryWithNexthopsData),
+                                  wire.begin(), wire.end());
+}
+
+BOOST_AUTO_TEST_CASE(RoutingTableEntryDecodeWithNexthops)
+{
+  RoutingTableEntry rte(ndn::Block(RoutingTableEntryWithNexthopsData,
+                                   sizeof(RoutingTableEntryWithNexthopsData)));
+  BOOST_CHECK_EQUAL(rte.getDestination(), "dest1");
+
+  BOOST_CHECK(rte.getNexthopList().size() != 0);
+  auto it = rte.getNexthopList().begin();
+  BOOST_CHECK_EQUAL(it->getConnectingFaceUri(), "nexthop1");
+  BOOST_CHECK_EQUAL(it->getRouteCost(), 1.65);
+
+  it++;
+  BOOST_CHECK_EQUAL(it->getConnectingFaceUri(), "nexthop2");
+  BOOST_CHECK_EQUAL(it->getRouteCost(), 1.65);
+}
+
+BOOST_AUTO_TEST_CASE(RoutingTableEntryEncodeWithoutNexthops)
+{
+  RoutingTableEntry rte(ndn::Name("dest1"));
+
+  auto wire = rte.wireEncode();
+
+  BOOST_REQUIRE_EQUAL_COLLECTIONS(RoutingTableEntryWithoutNexthopsData,
+                                  RoutingTableEntryWithoutNexthopsData +
+                                    sizeof(RoutingTableEntryWithoutNexthopsData),
+                                  wire.begin(), wire.end());
+}
+
+BOOST_AUTO_TEST_CASE(RoutingTableEntryDecodeWithoutNexthops)
+{
+  RoutingTableEntry rte(ndn::Block(RoutingTableEntryWithoutNexthopsData,
+                                   sizeof(RoutingTableEntryWithoutNexthopsData)));
+
+  BOOST_CHECK_EQUAL(rte.getDestination(), "dest1");
+  BOOST_CHECK(rte.getNexthopList().size() == 0);
+}
+
+
+BOOST_AUTO_TEST_CASE(RoutingTableEntryClear)
+{
+  RoutingTableEntry rte(ndn::Name("dest1"));
+
+  NextHop nexthops1;
+  nexthops1.setConnectingFaceUri("nexthop1");
+  nexthops1.setRouteCost(99);
+  rte.getNexthopList().addNextHop(nexthops1);
+
+  BOOST_CHECK_EQUAL(rte.getNexthopList().size(), 1);
+
+  auto it = rte.getNexthopList().begin();
+  BOOST_CHECK_EQUAL(it->getConnectingFaceUri(), "nexthop1");
+  BOOST_CHECK_EQUAL(it->getRouteCost(), 99);
+
+  rte.getNexthopList().clear();
+  BOOST_CHECK_EQUAL(rte.getNexthopList().size(), 0);
+
+  NextHop nexthops2;
+  nexthops2.setConnectingFaceUri("nexthop2");
+  nexthops2.setRouteCost(99);
+  rte.getNexthopList().addNextHop(nexthops2);
+
+  BOOST_CHECK_EQUAL(rte.getNexthopList().size(), 1);
+  it =  rte.getNexthopList().begin();
+  BOOST_CHECK_EQUAL(it->getConnectingFaceUri(), "nexthop2");
+  BOOST_CHECK_EQUAL(it->getRouteCost(), 99);
+}
+
+BOOST_AUTO_TEST_CASE(RoutingTableEntryOutputStream)
+{
+  RoutingTableEntry rte(ndn::Name("dest1"));
+
+  NextHop nexthops1;
+  nexthops1.setConnectingFaceUri("nexthop1");
+  nexthops1.setRouteCost(99);
+  rte.getNexthopList().addNextHop(nexthops1);
+
+  std::ostringstream os;
+  os << rte;
+
+  BOOST_CHECK_EQUAL(os.str(),
+                    "  Destination: /dest1\n"
+                    "    NextHop(Uri: nexthop1, Cost: 99)\n");
+}
+
 BOOST_AUTO_TEST_SUITE_END()
 
 } // namespace test
diff --git a/tests/route/test-routing-table.cpp b/tests/route/test-routing-table.cpp
index f8a7df5..0bce153 100644
--- a/tests/route/test-routing-table.cpp
+++ b/tests/route/test-routing-table.cpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California
  *
@@ -16,9 +16,7 @@
  *
  * 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/>.
- *
- * \author Ashlesh Gawande <agawande@memphis.edu>
- **/
+ */
 
 #include "route/routing-table.hpp"
 #include "nlsr.hpp"
@@ -30,23 +28,106 @@
 namespace nlsr {
 namespace test {
 
-BOOST_FIXTURE_TEST_SUITE(TestRoutingTable, BaseFixture)
-
-BOOST_AUTO_TEST_CASE(RoutingTableAddNextHop)
+class RoutingTableFixture
 {
+public:
+  RoutingTableFixture()
+    : conf(face, keyChain)
+    , nlsr(face, keyChain, conf)
+    , rt(nlsr.m_routingTable)
+  {
+  }
+
+public:
   ndn::util::DummyClientFace face;
   ndn::KeyChain keyChain;
-  ConfParameter conf(face, keyChain);
-  Nlsr nlsr(face, keyChain, conf);
+  ConfParameter conf;
+  Nlsr nlsr;
 
-  RoutingTable rt1(m_scheduler, nlsr.m_fib, nlsr.m_lsdb,
-                   nlsr.m_namePrefixTable, conf);
+  RoutingTable& rt;
+};
 
+BOOST_AUTO_TEST_SUITE(TestRoutingTable)
+
+BOOST_FIXTURE_TEST_CASE(RoutingTableAddNextHop, RoutingTableFixture)
+{
   NextHop nh1;
   const std::string DEST_ROUTER = "destRouter";
-  rt1.addNextHop(DEST_ROUTER, nh1);
+  rt.addNextHop(DEST_ROUTER, nh1);
 
-  BOOST_CHECK_EQUAL(rt1.findRoutingTableEntry(DEST_ROUTER)->getDestination(), DEST_ROUTER);
+  BOOST_CHECK_EQUAL(rt.findRoutingTableEntry(DEST_ROUTER)->getDestination(), DEST_ROUTER);
+}
+
+const uint8_t RoutingTableData1[] =
+{
+  // Header
+  0x90, 0x20,
+  // Routing table entry
+  0x91, 0x1e,
+  // Destination
+  0x07, 0x07, 0x08, 0x05, 0x64, 0x65, 0x73, 0x74, 0x31, 0x8f, 0x13,
+  // Nexthop
+  0x8d, 0x07, 0x6e, 0x65, 0x78, 0x74, 0x68, 0x6f, 0x70, 0x86, 0x08, 0x3f, 0xfa, 0x66,
+  0x66, 0x66, 0x66, 0x66, 0x66
+};
+
+const uint8_t RoutingTableData2[] =
+{
+  // Header
+  0x90, 0x00
+};
+
+BOOST_FIXTURE_TEST_CASE(RoutingTableEncode1, RoutingTableFixture)
+{
+  NextHop nexthops;
+  nexthops.setConnectingFaceUri("nexthop");
+  nexthops.setRouteCost(1.65);
+  rt.addNextHop("dest1", nexthops);
+
+  auto wire = rt.wireEncode();
+  BOOST_REQUIRE_EQUAL_COLLECTIONS(RoutingTableData1,
+                                  RoutingTableData1 + sizeof(RoutingTableData1),
+                                  wire.begin(), wire.end());
+}
+
+BOOST_FIXTURE_TEST_CASE(RoutingTableEncode2, RoutingTableFixture)
+{
+  auto wire = rt.wireEncode();
+  BOOST_REQUIRE_EQUAL_COLLECTIONS(RoutingTableData2,
+                                  RoutingTableData2 + sizeof(RoutingTableData2),
+                                  wire.begin(), wire.end());
+}
+
+BOOST_FIXTURE_TEST_CASE(RoutingTableDecode1, RoutingTableFixture)
+{
+  RoutingTableStatus rtStatus(ndn::Block(RoutingTableData1, sizeof(RoutingTableData1)));
+
+  auto it1 = rtStatus.m_rTable.begin();
+
+  ndn::Name des1 = it1->getDestination();
+  BOOST_CHECK_EQUAL(des1, "dest1");
+
+  auto it2 = it1->getNexthopList().begin();
+  BOOST_CHECK_EQUAL(it2->getConnectingFaceUri(), "nexthop");
+  BOOST_CHECK_EQUAL(it2->getRouteCost(), 1.65);
+
+  BOOST_CHECK_EQUAL(rtStatus.m_rTable.size(), 1);
+}
+
+BOOST_FIXTURE_TEST_CASE(RoutingTableOutputStream, RoutingTableFixture)
+{
+  NextHop nexthops;
+  nexthops.setConnectingFaceUri("nexthop");
+  nexthops.setRouteCost(99);
+  rt.addNextHop("dest1", nexthops);
+
+  std::ostringstream os;
+  os << rt;
+
+  BOOST_CHECK_EQUAL(os.str(),
+                    "Routing Table:\n"
+                    "  Destination: /dest1\n"
+                    "    NextHop(Uri: nexthop, Cost: 99)\n");
 }
 
 BOOST_AUTO_TEST_SUITE_END()
diff --git a/tests/tlv/test-destination.cpp b/tests/tlv/test-destination.cpp
deleted file mode 100644
index adc153e..0000000
--- a/tests/tlv/test-destination.cpp
+++ /dev/null
@@ -1,86 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2020,  The University of Memphis,
- *                           Regents of the University of California,
- *                           Arizona Board of Regents.
- *
- * This file is part of NLSR (Named-data Link State Routing).
- * See AUTHORS.md for complete list of NLSR authors and contributors.
- *
- * NLSR is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NLSR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * 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 "tlv/destination.hpp"
-
-#include "tests/boost-test.hpp"
-
-namespace nlsr {
-namespace tlv {
-namespace test {
-
-BOOST_AUTO_TEST_SUITE(TlvTestDes)
-
-const uint8_t DesData[] =
-{
-  // Header
-  0x8e, 0x13,
-  // Routername 746573742f646573742f746c76
-  0x07, 0x11, 0x08, 0x04, 0x74, 0x65, 0x73, 0x74, 0x08, 0x04, 0x64, 0x65, 0x73, 0x74,
-  0x08, 0x03, 0x74, 0x6c, 0x76
-};
-
-BOOST_AUTO_TEST_CASE(DesEncode)
-{
-  Destination des1;
-  des1.setName("/test/dest/tlv");
-
-  const ndn::Block& wire = des1.wireEncode();
-
-  BOOST_REQUIRE_EQUAL_COLLECTIONS(DesData,
-                                  DesData + sizeof(DesData),
-                                  wire.begin(), wire.end());
-}
-
-BOOST_AUTO_TEST_CASE(DesDecode)
-{
-  Destination des1;
-
-  des1.wireDecode(ndn::Block(DesData, sizeof(DesData)));
-
-  ndn::Name DEST_NAME = ndn::Name("/test/dest/tlv");
-  BOOST_REQUIRE_EQUAL(des1.getName(), DEST_NAME);
-}
-
-BOOST_AUTO_TEST_CASE(DesOutputStream)
-{
-  Destination des1;
-  des1.setName("/test/dest/tlv");
-
-  std::ostringstream os;
-  os << des1;
-
-  BOOST_CHECK_EQUAL(os.str(), "Destination: /test/dest/tlv");
-}
-
-BOOST_AUTO_TEST_CASE(DesMake)
-{
-  RoutingTableEntry rte("/test/dest/tlv");
-
-  std::shared_ptr<Destination> des = makeDes(rte);
-  BOOST_CHECK_EQUAL(des->getName(), rte.getDestination());
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace test
-} // namespace tlv
-} // namespace nlsr
diff --git a/tests/tlv/test-nexthops.cpp b/tests/tlv/test-nexthops.cpp
deleted file mode 100644
index f5b4d29..0000000
--- a/tests/tlv/test-nexthops.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2020,  The University of Memphis,
- *                           Regents of the University of California,
- *                           Arizona Board of Regents.
- *
- * This file is part of NLSR (Named-data Link State Routing).
- * See AUTHORS.md for complete list of NLSR authors and contributors.
- *
- * NLSR is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NLSR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * 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 "tlv/nexthop.hpp"
-
-#include "tests/boost-test.hpp"
-
-namespace nlsr {
-namespace tlv {
-namespace test {
-
-BOOST_AUTO_TEST_SUITE(TlvTestNexthops)
-
-const uint8_t NexthopData[] =
-{
-  // Header
-  0x8f, 0x1d,
-  // Uri
-  0x8d, 0x11, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x6e, 0x65, 0x78, 0x74, 0x68, 0x6f,
-  0x70, 0x2f, 0x74, 0x6c, 0x76,
-  // Cost
-  0x86, 0x08, 0x3f, 0xfa, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66
-};
-
-BOOST_AUTO_TEST_CASE(NexthopEncode)
-{
-  NextHop nexthops1;
-  nexthops1.setUri("/test/nexthop/tlv");
-  nexthops1.setCost(1.65);
-
-  const ndn::Block& wire = nexthops1.wireEncode();
-  BOOST_REQUIRE_EQUAL_COLLECTIONS(NexthopData,
-                                  NexthopData + sizeof(NexthopData),
-                                  wire.begin(), wire.end());
-}
-
-BOOST_AUTO_TEST_CASE(NexthopDecode)
-{
-  NextHop nexthops1;
-
-  nexthops1.wireDecode(ndn::Block(NexthopData, sizeof(NexthopData)));
-
-  BOOST_REQUIRE_EQUAL(nexthops1.getUri(), "/test/nexthop/tlv");
-  BOOST_REQUIRE_EQUAL(nexthops1.getCost(), 1.65);
-}
-
-BOOST_AUTO_TEST_CASE(AdjacencyOutputStream)
-{
-  NextHop nexthops1;
-  nexthops1.setUri("/test/nexthop/tlv");
-  nexthops1.setCost(99);
-
-  std::ostringstream os;
-  os << nexthops1;
-  BOOST_CHECK_EQUAL(os.str(), "NextHop(Uri: /test/nexthop/tlv, Cost: 99)\n");
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace test
-} // namespace tlv
-} // namespace nlsr
diff --git a/tests/tlv/test-routing-table-entry.cpp b/tests/tlv/test-routing-table-entry.cpp
deleted file mode 100644
index 338945b..0000000
--- a/tests/tlv/test-routing-table-entry.cpp
+++ /dev/null
@@ -1,192 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2020,  The University of Memphis,
- *                           Regents of the University of California,
- *                           Arizona Board of Regents.
- *
- * This file is part of NLSR (Named-data Link State Routing).
- * See AUTHORS.md for complete list of NLSR authors and contributors.
- *
- * NLSR is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NLSR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * 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 "tlv/routing-table-entry.hpp"
-
-#include "tests/boost-test.hpp"
-
-namespace nlsr {
-namespace tlv {
-namespace test {
-
-BOOST_AUTO_TEST_SUITE(TlvTestRoutingTableEntry)
-
-const uint8_t RoutingTableEntryWithNexthopsData[] =
-{
-  // Header
-  0x91, 0x37,
-  // Destination
-  0x8e, 0x09, 0x07, 0x07, 0x08, 0x05, 0x64, 0x65, 0x73, 0x74, 0x31,
-  // Nexthop
-  0x8f, 0x14, 0x8d, 0x08, 0x6e, 0x65, 0x78, 0x74, 0x68, 0x6f, 0x70, 0x31, 0x86, 0x08,
-  0x3f, 0xfa, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x8f, 0x14,
-  // Nexthop
-  0x8d, 0x08, 0x6e, 0x65, 0x78, 0x74, 0x68, 0x6f, 0x70, 0x32, 0x86, 0x08, 0x3f, 0xfa,
-  0x66, 0x66, 0x66, 0x66, 0x66, 0x66
-};
-
-const uint8_t RoutingTableEntryWithoutNexthopsData[] =
-{
-  // Header
-  0x91, 0x0b,
-  // Destination
-  0x8e, 0x09, 0x07, 0x07, 0x08, 0x05, 0x64, 0x65, 0x73, 0x74, 0x31
-};
-
-BOOST_AUTO_TEST_CASE(RoutingTableEntryEncodeWithNexthops)
-{
-  RoutingTable rt;
-
-  Destination des1;
-  des1.setName("dest1");
-  rt.setDestination(des1);
-
-  NextHop nexthops1;
-  nexthops1.setUri("nexthop1");
-  nexthops1.setCost(1.65);
-  rt.addNexthops(nexthops1);
-
-  NextHop nexthops2;
-  nexthops2.setUri("nexthop2");
-  nexthops2.setCost(1.65);
-  rt.addNexthops(nexthops2);
-
-  const ndn::Block& wire = rt.wireEncode();
-
-  BOOST_REQUIRE_EQUAL_COLLECTIONS(RoutingTableEntryWithNexthopsData,
-                                  RoutingTableEntryWithNexthopsData +
-                                    sizeof(RoutingTableEntryWithNexthopsData),
-                                  wire.begin(), wire.end());
-}
-
-BOOST_AUTO_TEST_CASE(RoutingTableEntryDecodeWithNexthops)
-{
-  RoutingTable rt;
-
-  rt.wireDecode(ndn::Block(RoutingTableEntryWithNexthopsData,
-                                      sizeof(RoutingTableEntryWithNexthopsData)));
-
-  Destination des = rt.getDestination();
-  BOOST_CHECK_EQUAL(des.getName(), "dest1");
-
-  BOOST_CHECK_EQUAL(rt.hasNexthops(), true);
-  std::list<NextHop> nexthops = rt.getNextHops();
-  std::list<NextHop>::const_iterator it = nexthops.begin();
-  BOOST_CHECK_EQUAL(it->getUri(), "nexthop1");
-  BOOST_CHECK_EQUAL(it->getCost(), 1.65);
-
-  it++;
-  BOOST_CHECK_EQUAL(it->getUri(), "nexthop2");
-  BOOST_CHECK_EQUAL(it->getCost(), 1.65);
-}
-
-BOOST_AUTO_TEST_CASE(RoutingTableEntryEncodeWithoutNexthops)
-{
-  RoutingTable rt;
-
-  Destination des1;
-  des1.setName("dest1");
-  rt.setDestination(des1);
-
-  const ndn::Block& wire = rt.wireEncode();
-
-  BOOST_REQUIRE_EQUAL_COLLECTIONS(RoutingTableEntryWithoutNexthopsData,
-                                  RoutingTableEntryWithoutNexthopsData +
-                                    sizeof(RoutingTableEntryWithoutNexthopsData),
-                                  wire.begin(), wire.end());
-}
-
-BOOST_AUTO_TEST_CASE(RoutingTableEntryDecodeWithoutNexthops)
-{
-  RoutingTable rt;
-
-  rt.wireDecode(ndn::Block(RoutingTableEntryWithoutNexthopsData,
-                           sizeof(RoutingTableEntryWithoutNexthopsData)));
-
-  Destination des = rt.getDestination();
-  BOOST_CHECK_EQUAL(des.getName(), "dest1");
-
-  BOOST_CHECK_EQUAL(rt.hasNexthops(), false);
-}
-
-
-BOOST_AUTO_TEST_CASE(RoutingTableEntryClear)
-{
-  RoutingTable rt;
-  Destination des1;
-  des1.setName("dest1");
-  rt.setDestination(des1);
-
-  NextHop nexthops1;
-  nexthops1.setUri("nexthop1");
-  nexthops1.setCost(99);
-  rt.addNexthops(nexthops1);
-
-  BOOST_CHECK_EQUAL(rt.getNextHops().size(), 1);
-
-  std::list<NextHop> nexthops = rt.getNextHops();
-  std::list<NextHop>::const_iterator it = nexthops.begin();
-  BOOST_CHECK_EQUAL(it->getUri(), "nexthop1");
-  BOOST_CHECK_EQUAL(it->getCost(), 99);
-
-  rt.clearNexthops();
-  BOOST_CHECK_EQUAL(rt.getNextHops().size(), 0);
-
-  NextHop nexthops2;
-  nexthops2.setUri("nexthop2");
-  nexthops2.setCost(99);
-  rt.addNexthops(nexthops2);
-
-  BOOST_CHECK_EQUAL(rt.getNextHops().size(), 1);
-
-  nexthops = rt.getNextHops();
-  it = nexthops.begin();
-  BOOST_CHECK_EQUAL(it->getUri(), "nexthop2");
-  BOOST_CHECK_EQUAL(it->getCost(), 99);
-}
-
-BOOST_AUTO_TEST_CASE(RoutingTableEntryOutputStream)
-{
-  RoutingTable rt;
-  Destination des1;
-  des1.setName("dest1");
-  rt.setDestination(des1);
-
-  NextHop nexthops1;
-  nexthops1.setUri("nexthop1");
-  nexthops1.setCost(99);
-  rt.addNexthops(nexthops1);
-
-  std::ostringstream os;
-  os << rt;
-
-  BOOST_CHECK_EQUAL(os.str(),
-                    "Destination: /dest1\n"
-                    "NexthopList(\n"
-                    "NextHop(Uri: nexthop1, Cost: 99)\n"
-                    ")");
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace test
-} // namespace tlv
-} // namespace nlsr
diff --git a/tests/tlv/test-routing-table.cpp b/tests/tlv/test-routing-table.cpp
deleted file mode 100644
index 70c25c9..0000000
--- a/tests/tlv/test-routing-table.cpp
+++ /dev/null
@@ -1,168 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2020,  The University of Memphis,
- *                           Regents of the University of California,
- *                           Arizona Board of Regents.
- *
- * This file is part of NLSR (Named-data Link State Routing).
- * See AUTHORS.md for complete list of NLSR authors and contributors.
- *
- * NLSR is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NLSR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * 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 "tlv/routing-table-status.hpp"
-
-#include "tests/boost-test.hpp"
-
-namespace nlsr {
-namespace tlv {
-namespace test {
-
-BOOST_AUTO_TEST_SUITE(TlvTestRoutingTable)
-
-const uint8_t RoutingTableData1[] =
-{
-  // Header
-  0x90, 0x22,
-  // Routing table entry
-  0x91, 0x20,
-  // Destination
-  0x8e, 0x09, 0x07, 0x07, 0x08, 0x05, 0x64, 0x65, 0x73, 0x74, 0x31,
-  // Nexthop
-  0x8f, 0x13, 0x8d, 0x07, 0x6e, 0x65, 0x78, 0x74, 0x68, 0x6f, 0x70, 0x86, 0x08, 0x3f,
-  0xfa, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66
-};
-
-const uint8_t RoutingTableData2[] =
-{
-  // Header
-  0x90, 0x00
-};
-
-BOOST_AUTO_TEST_CASE(RoutingTableEncode1)
-{
-  RoutingTableStatus rtStatus;
-
-  Destination des;
-  des.setName("dest1");
-
-  // RoutingtableEntry
-  RoutingTable rt;
-  rt.setDestination(des);
-
-  NextHop nexthops;
-  nexthops.setUri("nexthop");
-  nexthops.setCost(1.65);
-  rt.addNexthops(nexthops);
-
-  rtStatus.addRoutingTable(rt);
-
-  const ndn::Block& wire = rtStatus.wireEncode();
-
-  BOOST_REQUIRE_EQUAL_COLLECTIONS(RoutingTableData1,
-                                  RoutingTableData1 + sizeof(RoutingTableData1),
-                                  wire.begin(), wire.end());
-}
-
-BOOST_AUTO_TEST_CASE(RoutingTableEncode2)
-{
-  RoutingTableStatus rtStatus;
-
-  const ndn::Block& wire = rtStatus.wireEncode();
-
-  BOOST_REQUIRE_EQUAL_COLLECTIONS(RoutingTableData2,
-                                  RoutingTableData2 + sizeof(RoutingTableData2),
-                                  wire.begin(), wire.end());
-}
-
-BOOST_AUTO_TEST_CASE(RoutingTableDecode1)
-{
-  RoutingTableStatus rtStatus;
-
-  rtStatus.wireDecode(ndn::Block(RoutingTableData1, sizeof(RoutingTableData1)));
-
-  std::list<RoutingTable> rte = rtStatus.getRoutingtable();
-  std::list<RoutingTable>::const_iterator it1 = rte.begin();
-
-  Destination des1 = it1->getDestination();
-  BOOST_CHECK_EQUAL(des1.getName(), "dest1");
-
-  std::list<NextHop> nexthops = it1->getNextHops();
-  std::list<NextHop>::const_iterator it2 = nexthops.begin();
-  BOOST_CHECK_EQUAL(it2->getUri(), "nexthop");
-  BOOST_CHECK_EQUAL(it2->getCost(), 1.65);
-
-  BOOST_CHECK_EQUAL(rtStatus.hasRoutingTable(), true);
-}
-
-BOOST_AUTO_TEST_CASE(RoutingTableDecode2)
-{
-  RoutingTableStatus rtStatus;
-  rtStatus.wireDecode(ndn::Block(RoutingTableData2, sizeof(RoutingTableData2)));
-
-  BOOST_CHECK_EQUAL(rtStatus.hasRoutingTable(), false);
-}
-
-BOOST_AUTO_TEST_CASE(RoutingTableClear)
-{
-  RoutingTableStatus rtStatus;
-  Destination des;
-  des.setName("dest1");
-
-  // RoutingtableEntry
-  RoutingTable rt;
-  rt.setDestination(des);
-
-  NextHop nexthops;
-  nexthops.setUri("nexthop");
-  nexthops.setCost(1.65);
-  rt.addNexthops(nexthops);
-
-  rtStatus.addRoutingTable(rt);
-
-  BOOST_CHECK_EQUAL(rtStatus.hasRoutingTable(), true);
-  rtStatus.clearRoutingTable();
-  BOOST_CHECK_EQUAL(rtStatus.hasRoutingTable(), false);
-}
-
-BOOST_AUTO_TEST_CASE(RoutingTableOutputStream)
-{
-  RoutingTableStatus rtStatus;
-  Destination des;
-  des.setName("dest1");
-
-  // RoutingtableEntry
-  RoutingTable rt;
-  rt.setDestination(des);
-
-  NextHop nexthops;
-  nexthops.setUri("nexthop");
-  nexthops.setCost(99);
-  rt.addNexthops(nexthops);
-
-  rtStatus.addRoutingTable(rt);
-
-  std::ostringstream os;
-  os << rtStatus;
-
-  BOOST_CHECK_EQUAL(os.str(), "Routing Table Status: \n"
-                                  "Destination: /dest1\n"
-                                  "NexthopList(\n"
-                                  "NextHop(Uri: nexthop, Cost: 99)\n"
-                                  ")");
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace test
-} // namespace tlv
-} // namespace nlsr
diff --git a/tools/nlsrc.cpp b/tools/nlsrc.cpp
index a943b85..b54eb43 100644
--- a/tools/nlsrc.cpp
+++ b/tools/nlsrc.cpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California,
  *                           Arizona Board of Regents.
@@ -17,7 +17,7 @@
  *
  * 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 "nlsrc.hpp"
 
@@ -273,10 +273,7 @@
 void
 Nlsrc::fetchRtables()
 {
-  fetchFromRt<nlsr::tlv::RoutingTableStatus>(
-    [this] (const nlsr::tlv::RoutingTableStatus& rts) {
-      recordRtable(rts);
-    });
+  fetchFromRt<nlsr::RoutingTableStatus>([this] (const auto& rts) { recordRtable(rts); });
 }
 
 template <class T>
@@ -373,24 +370,10 @@
 }
 
 void
-Nlsrc::recordRtable(const nlsr::tlv::RoutingTableStatus& rts)
+Nlsrc::recordRtable(const nlsr::RoutingTableStatus& rts)
 {
   std::ostringstream os;
-
-  ndn::Name firstDes;
-  for (const auto& rt : rts.getRoutingtable()) {
-    if (firstDes.empty()) {
-      firstDes = rt.getDestination().getName();
-      os << rt << std::endl;
-      continue;
-    }
-
-    if (firstDes == rt.getDestination().getName()) {
-      os << "\n------Dry-run Hyperbolic Routing Tables:------- \n " << std::endl;
-    }
-    os << rt << std::endl;
-  }
-
+  os << rts;
   m_rtString = os.str();
 }
 
@@ -423,8 +406,7 @@
 Nlsrc::printRT()
 {
   if (!m_rtString.empty()) {
-    std::cout << "Routing Table" << std::endl;
-    std::cout << m_rtString << std::endl;
+    std::cout << m_rtString;
   }
   else {
     std::cout << "Routing Table is not calculated yet" << std::endl;
diff --git a/tools/nlsrc.hpp b/tools/nlsrc.hpp
index aab636c..938e82c 100644
--- a/tools/nlsrc.hpp
+++ b/tools/nlsrc.hpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California,
  *                           Arizona Board of Regents.
@@ -17,12 +17,12 @@
  *
  * 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 "lsa/adj-lsa.hpp"
 #include "lsa/coordinate-lsa.hpp"
 #include "lsa/name-lsa.hpp"
-#include "tlv/routing-table-status.hpp"
+#include "route/routing-table.hpp"
 
 #include <boost/noncopyable.hpp>
 #include <ndn-cxx/face.hpp>
@@ -123,7 +123,7 @@
   recordLsa(const nlsr::Lsa& lsa);
 
   void
-  recordRtable(const nlsr::tlv::RoutingTableStatus& rts);
+  recordRtable(const nlsr::RoutingTableStatus& rts);
 
   void
   printLsdb();
