diff --git a/src/route/map.hpp b/src/route/map.hpp
index ae92d25..be62d2d 100644
--- a/src/route/map.hpp
+++ b/src/route/map.hpp
@@ -22,6 +22,7 @@
 #define NLSR_MAP_HPP
 
 #include "common.hpp"
+#include "lsa/adj-lsa.hpp"
 
 #include <boost/multi_index_container.hpp>
 #include <boost/multi_index/hashed_index.hpp>
@@ -81,8 +82,9 @@
   {
     BOOST_STATIC_ASSERT_MSG(is_iterator<IteratorType>::value, "IteratorType must be an iterator!");
     for (auto lsa = begin; lsa != end; lsa++) {
-      addEntry(lsa->getOriginRouter());
-      for (const auto& adjacent : lsa->getAdl().getAdjList()) {
+      auto adjLsa = std::static_pointer_cast<AdjLsa>(*lsa);
+      addEntry(adjLsa->getOriginRouter());
+      for (const auto& adjacent : adjLsa->getAdl().getAdjList()) {
         addEntry(adjacent.getName());
       }
     }
@@ -98,7 +100,7 @@
   {
     BOOST_STATIC_ASSERT_MSG(is_iterator<IteratorType>::value, "IteratorType must be an iterator!");
     for (auto lsa = begin; lsa != end; lsa++) {
-      addEntry(lsa->getOriginRouter());
+      addEntry((*lsa)->getOriginRouter());
     }
   }
 
diff --git a/src/route/routing-table-calculator.cpp b/src/route/routing-table-calculator.cpp
index 04cc78f..2d283eb 100644
--- a/src/route/routing-table-calculator.cpp
+++ b/src/route/routing-table-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,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 "routing-table-calculator.hpp"
 #include "lsdb.hpp"
@@ -61,13 +61,15 @@
 }
 
 void
-RoutingTableCalculator::makeAdjMatrix(const std::list<AdjLsa>& adjLsaList, Map& pMap)
+RoutingTableCalculator::makeAdjMatrix(const Lsdb& lsdb, Map& pMap)
 {
   // For each LSA represented in the map
-  for (const auto& adjLsa : adjLsaList) {
-    ndn::optional<int32_t> row = pMap.getMappingNoByRouterName(adjLsa.getOriginRouter());
+  auto lsaRange = lsdb.getLsdbIterator<AdjLsa>();
+  for (auto lsaIt = lsaRange.first; lsaIt != lsaRange.second; ++lsaIt) {
+    auto adjLsa = std::static_pointer_cast<AdjLsa>(*lsaIt);
+    ndn::optional<int32_t> row = pMap.getMappingNoByRouterName(adjLsa->getOriginRouter());
 
-    std::list<Adjacent> adl = adjLsa.getAdl().getAdjList();
+    std::list<Adjacent> adl = adjLsa->getAdl().getAdjList();
     // For each adjacency represented in the LSA
     for (const auto& adjacent : adl) {
       ndn::optional<int32_t> col = pMap.getMappingNoByRouterName(adjacent.getName());
@@ -217,7 +219,6 @@
   linkCosts = new double[vNoLink];
 }
 
-
 void
 RoutingTableCalculator::freeLinks()
 {
@@ -232,12 +233,12 @@
 void
 LinkStateRoutingTableCalculator::calculatePath(Map& pMap, RoutingTable& rt,
                                                ConfParameter& confParam,
-                                               const std::list<AdjLsa>& adjLsaList)
+                                               const Lsdb& lsdb)
 {
   NLSR_LOG_DEBUG("LinkStateRoutingTableCalculator::calculatePath Called");
   allocateAdjMatrix();
   initMatrix();
-  makeAdjMatrix(adjLsaList, pMap);
+  makeAdjMatrix(lsdb, pMap);
   writeAdjMatrixLog(pMap);
   ndn::optional<int32_t> sourceRouter =
     pMap.getMappingNoByRouterName(confParam.getRouterPrefix());
@@ -497,15 +498,8 @@
 
   double distance = UNKNOWN_DISTANCE;
 
-  ndn::Name srcLsaKey = src;
-  srcLsaKey.append(boost::lexical_cast<std::string>(Lsa::Type::COORDINATE));
-
-  CoordinateLsa* srcLsa = lsdb.findCoordinateLsa(srcLsaKey);
-
-  ndn::Name destLsaKey = dest;
-  destLsaKey.append(boost::lexical_cast<std::string>(Lsa::Type::COORDINATE));
-
-  CoordinateLsa* destLsa = lsdb.findCoordinateLsa(destLsaKey);
+  auto srcLsa  = lsdb.findLsa<CoordinateLsa>(src);
+  auto destLsa = lsdb.findLsa<CoordinateLsa>(dest);
 
   // Coordinate LSAs do not exist for these routers
   if (srcLsa == nullptr || destLsa == nullptr) {
diff --git a/src/route/routing-table-calculator.hpp b/src/route/routing-table-calculator.hpp
index 16d64d7..9c0c6b5 100644
--- a/src/route/routing-table-calculator.hpp
+++ b/src/route/routing-table-calculator.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_CALCULATOR_HPP
 #define NLSR_ROUTING_TABLE_CALCULATOR_HPP
@@ -25,6 +24,7 @@
 #include "common.hpp"
 #include "lsa/lsa.hpp"
 #include "lsa/adj-lsa.hpp"
+#include "lsdb.hpp"
 #include "conf-parameter.hpp"
 
 #include <list>
@@ -56,11 +56,11 @@
   initMatrix();
 
   /*! \brief Constructs an adj. matrix to calculate with.
-    \param adjLsaList The Adjacency Lsa list.
+    \param lsdb Reference to the Lsdb
     \param pMap The map to populate with the adj. data.
   */
   void
-  makeAdjMatrix(const std::list<AdjLsa>& adjLsaList, Map& pMap);
+  makeAdjMatrix(const Lsdb& lsdb, Map& pMap);
 
   /*! \brief Writes a formated adjacent matrix to DEBUG log
     \param map The map containing adjacent matrix data
@@ -137,7 +137,7 @@
 
   void
   calculatePath(Map& pMap, RoutingTable& rt, ConfParameter& confParam,
-                const std::list<AdjLsa>& adjLsaList);
+                const Lsdb& lsdb);
 
 private:
   /*! \brief Performs a Dijkstra's calculation over the adjacency matrix.
diff --git a/src/route/routing-table.cpp b/src/route/routing-table.cpp
index a2ec12b..74d3c11 100644
--- a/src/route/routing-table.cpp
+++ b/src/route/routing-table.cpp
@@ -52,9 +52,7 @@
 void
 RoutingTable::calculate()
 {
-  m_lsdb.writeCorLsdbLog();
-  m_lsdb.writeNameLsdbLog();
-  m_lsdb.writeAdjLsdbLog();
+  m_lsdb.writeLog();
   m_namePrefixTable.writeLog();
   if (m_isRoutingTableCalculating == false) {
     // setting routing table calculation
@@ -63,14 +61,10 @@
     bool isHrEnabled = m_confParam.getHyperbolicState() != HYPERBOLIC_STATE_OFF;
 
     if ((!isHrEnabled &&
-         m_lsdb
-         .doesLsaExist(ndn::Name{m_confParam.getRouterPrefix()}
-                       .append(boost::lexical_cast<std::string>(Lsa::Type::ADJACENCY)), Lsa::Type::ADJACENCY))
+         m_lsdb.doesLsaExist(m_confParam.getRouterPrefix(), Lsa::Type::ADJACENCY))
         ||
         (isHrEnabled &&
-         m_lsdb
-         .doesLsaExist(ndn::Name{m_confParam.getRouterPrefix()}
-                       .append(boost::lexical_cast<std::string>(Lsa::Type::COORDINATE)), Lsa::Type::COORDINATE))) {
+         m_lsdb.doesLsaExist(m_confParam.getRouterPrefix(), Lsa::Type::COORDINATE))) {
       if (m_lsdb.getIsBuildAdjLsaSheduled() != 1) {
         NLSR_LOG_TRACE("Clearing old routing table");
         clearRoutingTable();
@@ -80,8 +74,8 @@
         NLSR_LOG_DEBUG("Calculating routing table");
 
         // calculate Link State routing
-        if ((m_confParam.getHyperbolicState() == HYPERBOLIC_STATE_OFF)
-            || (m_confParam.getHyperbolicState() == HYPERBOLIC_STATE_DRY_RUN)) {
+        if ((m_confParam.getHyperbolicState() == HYPERBOLIC_STATE_OFF) ||
+            (m_confParam.getHyperbolicState() == HYPERBOLIC_STATE_DRY_RUN)) {
           calculateLsRoutingTable();
         }
         // calculate hyperbolic routing
@@ -126,25 +120,26 @@
 void
 RoutingTable::calculateLsRoutingTable()
 {
-  NLSR_LOG_DEBUG("RoutingTable::calculateLsRoutingTable Called");
+  NLSR_LOG_TRACE("CalculateLsRoutingTable Called");
 
   Map map;
-  map.createFromAdjLsdb(m_lsdb.getAdjLsdb().begin(), m_lsdb.getAdjLsdb().end());
+  auto lsaRange = m_lsdb.getLsdbIterator<AdjLsa>();
+  map.createFromAdjLsdb(lsaRange.first, lsaRange.second);
   map.writeLog();
 
   size_t nRouters = map.getMapSize();
 
   LinkStateRoutingTableCalculator calculator(nRouters);
 
-  calculator.calculatePath(map, *this, m_confParam, m_lsdb.getAdjLsdb());
+  calculator.calculatePath(map, *this, m_confParam, m_lsdb);
 }
 
 void
 RoutingTable::calculateHypRoutingTable(bool isDryRun)
 {
   Map map;
-  map.createFromCoordinateLsdb(m_lsdb.getCoordinateLsdb().begin(),
-                               m_lsdb.getCoordinateLsdb().end());
+  auto lsaRange = m_lsdb.getLsdbIterator<CoordinateLsa>();
+  map.createFromCoordinateLsdb(lsaRange.first, lsaRange.second);
   map.writeLog();
 
   size_t nRouters = map.getMapSize();
