diff --git a/src/route/fib.cpp b/src/route/fib.cpp
index 2d34a36..0975c20 100644
--- a/src/route/fib.cpp
+++ b/src/route/fib.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2021,  The University of Memphis,
+ * Copyright (c) 2014-2022,  The University of Memphis,
  *                           Regents of the University of California
  *
  * This file is part of NLSR (Named-data Link State Routing).
@@ -24,18 +24,14 @@
 #include "logger.hpp"
 #include "nexthop-list.hpp"
 
-#include <map>
-#include <cmath>
 #include <algorithm>
-#include <iterator>
+#include <cmath>
+#include <map>
 
 namespace nlsr {
 
 INIT_LOGGER(route.Fib);
 
-const std::string Fib::MULTICAST_STRATEGY("ndn:/localhost/nfd/strategy/multicast");
-const std::string Fib::BEST_ROUTE_V2_STRATEGY("ndn:/localhost/nfd/strategy/best-route");
-
 Fib::Fib(ndn::Face& face, ndn::Scheduler& scheduler, AdjacencyList& adjacencyList,
          ConfParameter& conf, ndn::security::KeyChain& keyChain)
   : m_scheduler(scheduler)
@@ -109,12 +105,9 @@
 
     FibEntry entry;
     entry.name = name;
-
     addNextHopsToFibEntryAndNfd(entry, hopsToAdd);
 
-    m_table.emplace(name, std::move(entry));
-
-    entryIt = m_table.find(name);
+    entryIt = m_table.try_emplace(name, std::move(entry)).first;
   }
   // Existing FIB entry that may or may not have nextHops
   else {
@@ -127,7 +120,7 @@
       return;
     }
 
-    FibEntry& entry = (entryIt->second);
+    FibEntry& entry = entryIt->second;
     addNextHopsToFibEntryAndNfd(entry, hopsToAdd);
 
     std::set<NextHop, NextHopUriSortedComparator> hopsToRemove;
@@ -278,7 +271,7 @@
 }
 
 void
-Fib::setStrategy(const ndn::Name& name, const std::string& strategy, uint32_t count)
+Fib::setStrategy(const ndn::Name& name, const ndn::Name& strategy, uint32_t count)
 {
   ndn::nfd::ControlParameters parameters;
   parameters
@@ -311,7 +304,7 @@
 }
 
 void
-Fib::scheduleEntryRefresh(FibEntry& entry, const afterRefreshCallback& refreshCallback)
+Fib::scheduleEntryRefresh(FibEntry& entry, const AfterRefreshCallback& refreshCallback)
 {
   NLSR_LOG_DEBUG("Scheduling refresh for " << entry.name <<
                  " Seq Num: " << entry.seqNo <<
@@ -329,7 +322,7 @@
 }
 
 void
-Fib::refreshEntry(const ndn::Name& name, afterRefreshCallback refreshCb)
+Fib::refreshEntry(const ndn::Name& name, AfterRefreshCallback refreshCb)
 {
   auto it = m_table.find(name);
   if (it == m_table.end()) {
diff --git a/src/route/fib.hpp b/src/route/fib.hpp
index 25b5956..e24c61b 100644
--- a/src/route/fib.hpp
+++ b/src/route/fib.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2021,  The University of Memphis,
+ * Copyright (c) 2014-2022,  The University of Memphis,
  *                           Regents of the University of California,
  *                           Arizona Board of Regents.
  *
@@ -31,16 +31,17 @@
 
 namespace nlsr {
 
-typedef NexthopListT<NextHopUriSortedComparator> NextHopsUriSortedSet;
+using NextHopsUriSortedSet = NexthopListT<NextHopUriSortedComparator>;
 
-struct FibEntry {
+struct FibEntry
+{
   ndn::Name name;
   ndn::scheduler::ScopedEventId refreshEventId;
   int32_t seqNo = 1;
   NextHopsUriSortedSet nexthopSet;
 };
 
-typedef std::function<void(FibEntry&)> afterRefreshCallback;
+using AfterRefreshCallback = std::function<void(FibEntry&)>;
 
 class AdjacencyList;
 class ConfParameter;
@@ -135,7 +136,7 @@
                  uint8_t times);
 
   void
-  setStrategy(const ndn::Name& name, const std::string& strategy, uint32_t count);
+  setStrategy(const ndn::Name& name, const ndn::Name& strategy, uint32_t count);
 
   void
   writeLog();
@@ -204,7 +205,7 @@
    * \sa Fib::scheduleLoop
    */
   void
-  scheduleEntryRefresh(FibEntry& entry, const afterRefreshCallback& refreshCb);
+  scheduleEntryRefresh(FibEntry& entry, const AfterRefreshCallback& refreshCb);
 
 private:
   /*! \brief Continue the entry refresh cycle.
@@ -215,12 +216,13 @@
   /*! \brief Refreshes an entry in NFD.
    */
   void
-  refreshEntry(const ndn::Name& name, afterRefreshCallback refreshCb);
+  refreshEntry(const ndn::Name& name, AfterRefreshCallback refreshCb);
 
 public:
-  static const std::string MULTICAST_STRATEGY;
-  static const std::string BEST_ROUTE_V2_STRATEGY;
-  ndn::util::Signal<Fib, const ndn::Name&> onPrefixRegistrationSuccess;
+  static inline const ndn::Name MULTICAST_STRATEGY{"/localhost/nfd/strategy/multicast"};
+  static inline const ndn::Name BEST_ROUTE_STRATEGY{"/localhost/nfd/strategy/best-route"};
+
+  ndn::util::Signal<Fib, ndn::Name> onPrefixRegistrationSuccess;
 
 private:
   ndn::Scheduler& m_scheduler;
diff --git a/src/route/map.cpp b/src/route/map.cpp
index 0aab84f..a1828af 100644
--- a/src/route/map.cpp
+++ b/src/route/map.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2020,  The University of Memphis,
+ * Copyright (c) 2014-2022,  The University of Memphis,
  *                           Regents of the University of California
  *
  * This file is part of NLSR (Named-data Link State Routing).
@@ -44,20 +44,20 @@
   return m_entries.insert(mpe).second;
 }
 
-ndn::optional<ndn::Name>
+std::optional<ndn::Name>
 Map::getRouterNameByMappingNo(int32_t mn) const
 {
   auto&& mappingNumberView = m_entries.get<detail::byMappingNumber>();
   auto it = mappingNumberView.find(mn);
-  return it == mappingNumberView.end() ? ndn::nullopt : ndn::optional<ndn::Name>(it->router);
+  return it == mappingNumberView.end() ? std::nullopt : std::optional(it->router);
 }
 
-ndn::optional<int32_t>
+std::optional<int32_t>
 Map::getMappingNoByRouterName(const ndn::Name& rName)
 {
   auto&& routerNameView = m_entries.get<detail::byRouterName>();
   auto it = routerNameView.find(rName);
-  return it == routerNameView.end() ? ndn::nullopt : ndn::optional<int32_t>(it->mappingNumber);
+  return it == routerNameView.end() ? std::nullopt : std::optional(it->mappingNumber);
 }
 
 void
@@ -66,7 +66,7 @@
   NLSR_LOG_DEBUG("---------------Map----------------------");
   for (const auto& entry : m_entries.get<detail::byRouterName>()) {
     NLSR_LOG_DEBUG("MapEntry: ( Router: " << entry.router << " Mapping No: " <<
-                    entry.mappingNumber << " )");
+                   entry.mappingNumber << " )");
   }
 }
 
diff --git a/src/route/map.hpp b/src/route/map.hpp
index be62d2d..f2e8eae 100644
--- a/src/route/map.hpp
+++ b/src/route/map.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2020,  The University of Memphis,
+ * Copyright (c) 2014-2022,  The University of Memphis,
  *                           Regents of the University of California
  *
  * This file is part of NLSR (Named-data Link State Routing).
@@ -29,9 +29,12 @@
 #include <boost/multi_index/member.hpp>
 #include <boost/multi_index/tag.hpp>
 
+#include <optional>
+
 namespace nlsr {
 
-struct MapEntry {
+struct MapEntry
+{
   ndn::Name router;
   int32_t mappingNumber = -1;
 };
@@ -104,10 +107,10 @@
     }
   }
 
-  ndn::optional<ndn::Name>
+  std::optional<ndn::Name>
   getRouterNameByMappingNo(int32_t mn) const;
 
-  ndn::optional<int32_t>
+  std::optional<int32_t>
   getMappingNoByRouterName(const ndn::Name& rName);
 
   size_t
diff --git a/src/route/name-prefix-table.cpp b/src/route/name-prefix-table.cpp
index deb9af7..3ee9132 100644
--- a/src/route/name-prefix-table.cpp
+++ b/src/route/name-prefix-table.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2021,  The University of Memphis,
+ * Copyright (c) 2014-2022,  The University of Memphis,
  *                           Regents of the University of California,
  *                           Arizona Board of Regents.
  *
@@ -116,15 +116,11 @@
 NamePrefixTable::addEntry(const ndn::Name& name, const ndn::Name& destRouter)
 {
   // Check if the advertised name prefix is in the table already.
-  NptEntryList::iterator nameItr =
-    std::find_if(m_table.begin(),
-                 m_table.end(),
-                 [&] (const std::shared_ptr<NamePrefixTableEntry>& entry) {
-                   return name == entry->getNamePrefix();
-                 });
+  auto nameItr = std::find_if(m_table.begin(), m_table.end(),
+                              [&] (const auto& entry) { return name == entry->getNamePrefix(); });
 
   // Attempt to find a routing table pool entry (RTPE) we can use.
-  RoutingTableEntryPool::iterator rtpeItr = m_rtpool.find(destRouter);
+  auto rtpeItr = m_rtpool.find(destRouter);
 
   // These declarations just to make the compiler happy...
   RoutingTablePoolEntry rtpe;
@@ -196,8 +192,8 @@
   }
 
   // Add the reference to this NPT to the RTPE.
-  rtpePtr->namePrefixTableEntries.emplace(
-    std::make_pair(npte->getNamePrefix(), std::weak_ptr<NamePrefixTableEntry>(npte)));
+  rtpePtr->namePrefixTableEntries.try_emplace(npte->getNamePrefix(),
+                                              std::weak_ptr<NamePrefixTableEntry>(npte));
 }
 
 void
@@ -206,27 +202,23 @@
   NLSR_LOG_DEBUG("Removing origin: " << destRouter << " from " << name);
 
   // Fetch an iterator to the appropriate pair object in the pool.
-  RoutingTableEntryPool::iterator rtpeItr = m_rtpool.find(destRouter);
+  auto rtpeItr = m_rtpool.find(destRouter);
 
   // Simple error checking to prevent any unusual behavior in the case
   // that we try to remove an entry that isn't there.
   if (rtpeItr == m_rtpool.end()) {
     NLSR_LOG_DEBUG("No entry for origin: " << destRouter
-               << " found, so it cannot be removed from prefix: "
-               << name);
+                   << " found, so it cannot be removed from prefix: " << name);
     return;
   }
   std::shared_ptr<RoutingTablePoolEntry> rtpePtr = rtpeItr->second;
 
   // Ensure that the entry exists
-  NptEntryList::iterator nameItr =
-    std::find_if(m_table.begin(), m_table.end(),
-                 [&] (const std::shared_ptr<NamePrefixTableEntry>& entry) {
-                   return entry->getNamePrefix() == name;
-                 });
+  auto nameItr = std::find_if(m_table.begin(), m_table.end(),
+                              [&] (const auto& entry) { return entry->getNamePrefix() == name; });
   if (nameItr != m_table.end()) {
     NLSR_LOG_TRACE("Removing origin: " << rtpePtr->getDestination()
-               << " from prefix: " << **nameItr);
+                   << " from prefix: " << **nameItr);
 
     // Rather than iterating through the whole list periodically, just
     // delete them here if they have no references.
@@ -251,20 +243,20 @@
     //
     if ((*nameItr)->getRteListSize() == 0) {
       NLSR_LOG_TRACE(**nameItr << " has no routing table entries;"
-                 << " removing from table and FIB");
+                     << " removing from table and FIB");
       m_table.erase(nameItr);
       m_fib.remove(name);
     }
     else {
       NLSR_LOG_TRACE(**nameItr << " has other routing table entries;"
-                 << " updating FIB with next hops");
+                     << " updating FIB with next hops");
       (*nameItr)->generateNhlfromRteList();
       m_fib.update(name, (*nameItr)->getNexthopList());
     }
   }
   else {
     NLSR_LOG_DEBUG("Attempted to remove origin: " << rtpePtr->getDestination()
-               << " from non-existent prefix: " << name);
+                   << " from non-existent prefix: " << name);
   }
 }
 
@@ -305,33 +297,30 @@
   }
 }
 
-  // Inserts the routing table pool entry into the NPT's RTE storage
-  // pool.  This cannot fail, so the pool is guaranteed to contain the
-  // item after this occurs.
+// Inserts the routing table pool entry into the NPT's RTE storage
+// pool.  This cannot fail, so the pool is guaranteed to contain the
+// item after this occurs.
 std::shared_ptr<RoutingTablePoolEntry>
 NamePrefixTable::addRtpeToPool(RoutingTablePoolEntry& rtpe)
 {
-  RoutingTableEntryPool::iterator poolItr =
-    m_rtpool.insert(std::make_pair(rtpe.getDestination(),
-                                   std::make_shared<RoutingTablePoolEntry>
-                                   (rtpe)))
-    .first;
-  return poolItr->second;
+  auto poolIt = m_rtpool.try_emplace(rtpe.getDestination(),
+                                     std::make_shared<RoutingTablePoolEntry>(rtpe)).first;
+  return poolIt->second;
 }
 
-  // Removes the routing table pool entry from the storage pool. The
-  // postconditions of this function are guaranteed to include that
-  // the storage pool does not contain such an item. Additionally,
-  // this function cannot fail, but nonetheless debug information is
-  // given in the case that this function is called with an entry that
-  // isn't in the pool.
+// Removes the routing table pool entry from the storage pool. The
+// postconditions of this function are guaranteed to include that
+// the storage pool does not contain such an item. Additionally,
+// this function cannot fail, but nonetheless debug information is
+// given in the case that this function is called with an entry that
+// isn't in the pool.
 void
 NamePrefixTable::deleteRtpeFromPool(std::shared_ptr<RoutingTablePoolEntry> rtpePtr)
 {
   if (m_rtpool.erase(rtpePtr->getDestination()) != 1) {
     NLSR_LOG_DEBUG("Attempted to delete non-existent origin: "
-               << rtpePtr->getDestination()
-               << " from NPT routing table entry storage pool.");
+                   << rtpePtr->getDestination()
+                   << " from NPT routing table entry storage pool.");
   }
 }
 
diff --git a/src/route/nexthop.cpp b/src/route/nexthop.cpp
index bdb0bde..a5f10ba 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-2021,  The University of Memphis,
+ * Copyright (c) 2014-2022,  The University of Memphis,
  *                           Regents of the University of California
  *
  * This file is part of NLSR (Named-data Link State Routing).
@@ -31,11 +31,11 @@
 {
   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 += ndn::encoding::prependDoubleBlock(block, nlsr::tlv::CostDouble, m_routeCost);
+  totalLength += ndn::encoding::prependStringBlock(block, nlsr::tlv::Uri, m_connectingFaceUri);
 
   totalLength += block.prependVarNumber(totalLength);
-  totalLength += block.prependVarNumber(ndn::tlv::nlsr::NextHop);
+  totalLength += block.prependVarNumber(nlsr::tlv::NextHop);
 
   return totalLength;
 }
@@ -68,7 +68,7 @@
 
   m_wire = wire;
 
-  if (m_wire.type() != ndn::tlv::nlsr::NextHop) {
+  if (m_wire.type() != nlsr::tlv::NextHop) {
     NDN_THROW(Error("NextHop", m_wire.type()));
   }
 
@@ -76,7 +76,7 @@
 
   auto val = m_wire.elements_begin();
 
-  if (val != m_wire.elements_end() && val->type() == ndn::tlv::nlsr::Uri) {
+  if (val != m_wire.elements_end() && val->type() == nlsr::tlv::Uri) {
     m_connectingFaceUri = ndn::encoding::readString(*val);
     ++val;
   }
@@ -84,7 +84,7 @@
     NDN_THROW(Error("Missing required Uri field"));
   }
 
-  if (val != m_wire.elements_end() && val->type() == ndn::tlv::nlsr::CostDouble) {
+  if (val != m_wire.elements_end() && val->type() == nlsr::tlv::CostDouble) {
     m_routeCost = ndn::encoding::readDouble(*val);
     ++val;
   }
diff --git a/src/route/nexthop.hpp b/src/route/nexthop.hpp
index 4443a9e..77bc8b1 100644
--- a/src/route/nexthop.hpp
+++ b/src/route/nexthop.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2021,  The University of Memphis,
+ * Copyright (c) 2014-2022,  The University of Memphis,
  *                           Regents of the University of California
  *
  * This file is part of NLSR (Named-data Link State Routing).
@@ -142,7 +142,7 @@
 
       e.g  costs 12.34 and 12.35 will be installed into NFD's FIB as 12340 and 12350
   */
-  static const uint64_t HYPERBOLIC_COST_ADJUSTMENT_FACTOR = 1000;
+  static constexpr uint64_t HYPERBOLIC_COST_ADJUSTMENT_FACTOR = 1000;
 };
 
 NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS(NextHop);
diff --git a/src/route/routing-table-calculator.cpp b/src/route/routing-table-calculator.cpp
index 2d283eb..34bcfb6 100644
--- a/src/route/routing-table-calculator.cpp
+++ b/src/route/routing-table-calculator.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2020,  The University of Memphis,
+ * Copyright (c) 2014-2022,  The University of Memphis,
  *                           Regents of the University of California,
  *                           Arizona Board of Regents.
  *
@@ -27,18 +27,20 @@
 #include "logger.hpp"
 #include "adjacent.hpp"
 
-#include <boost/math/constants/constants.hpp>
-#include <ndn-cxx/util/logger.hpp>
 #include <cmath>
+#include <boost/lexical_cast.hpp>
+#include <ndn-cxx/util/logger.hpp>
 
 namespace nlsr {
 
 INIT_LOGGER(route.RoutingTableCalculator);
 
-const int LinkStateRoutingTableCalculator::EMPTY_PARENT = -12345;
-const double LinkStateRoutingTableCalculator::INF_DISTANCE = 2147483647;
-const int LinkStateRoutingTableCalculator::NO_MAPPING_NUM = -1;
-const int LinkStateRoutingTableCalculator::NO_NEXT_HOP = -12345;
+const int EMPTY_PARENT = -12345;
+const double INF_DISTANCE = 2147483647;
+const int NO_MAPPING_NUM = -1;
+const int NO_NEXT_HOP = -12345;
+const double UNKNOWN_DISTANCE = -1.0;
+const double UNKNOWN_RADIUS   = -1.0;
 
 void
 RoutingTableCalculator::allocateAdjMatrix()
@@ -67,17 +69,16 @@
   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());
+    auto row = pMap.getMappingNoByRouterName(adjLsa->getOriginRouter());
 
     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());
+      auto col = pMap.getMappingNoByRouterName(adjacent.getName());
       double cost = adjacent.getLinkCost();
 
       if (row && col && *row < static_cast<int32_t>(m_nRouters)
-          && *col < static_cast<int32_t>(m_nRouters))
-      {
+          && *col < static_cast<int32_t>(m_nRouters)) {
         adjMatrix[*row][*col] = cost;
       }
     }
@@ -143,7 +144,7 @@
   for (size_t i = 0; i < m_nRouters; i++) {
     std::string line;
     for (size_t j = 0; j < m_nRouters; j++) {
-      if (adjMatrix[i][j] == LinkStateRoutingTableCalculator::NO_NEXT_HOP) {
+      if (adjMatrix[i][j] == NO_NEXT_HOP) {
         line += "0 ";
       }
       else {
@@ -240,8 +241,7 @@
   initMatrix();
   makeAdjMatrix(lsdb, pMap);
   writeAdjMatrixLog(pMap);
-  ndn::optional<int32_t> sourceRouter =
-    pMap.getMappingNoByRouterName(confParam.getRouterPrefix());
+  auto sourceRouter = pMap.getMappingNoByRouterName(confParam.getRouterPrefix());
   allocateParent(); // These two matrices are used in Dijkstra's algorithm.
   allocateDistance(); //
   // We only bother to do the calculation if we have a router by that name.
@@ -346,14 +346,13 @@
         // Fetch its distance
         double routeCost = m_distance[i];
         // Fetch its actual name
-        ndn::optional<ndn::Name> nextHopRouterName= pMap.getRouterNameByMappingNo(nextHopRouter);
+        auto nextHopRouterName = pMap.getRouterNameByMappingNo(nextHopRouter);
         if (nextHopRouterName) {
           std::string nextHopFace =
             adjacencies.getAdjacent(*nextHopRouterName).getFaceUri().toString();
           // Add next hop to routing table
           NextHop nh(nextHopFace, routeCost);
           rt.addNextHop(*(pMap.getRouterNameByMappingNo(i)), nh);
-
         }
       }
     }
@@ -427,18 +426,13 @@
   delete [] m_distance;
 }
 
-const double HyperbolicRoutingCalculator::MATH_PI = boost::math::constants::pi<double>();
-
-const double HyperbolicRoutingCalculator::UNKNOWN_DISTANCE = -1.0;
-const double HyperbolicRoutingCalculator::UNKNOWN_RADIUS   = -1.0;
-
 void
 HyperbolicRoutingCalculator::calculatePath(Map& map, RoutingTable& rt,
                                            Lsdb& lsdb, AdjacencyList& adjacencies)
 {
   NLSR_LOG_TRACE("Calculating hyperbolic paths");
 
-  ndn::optional<int32_t> thisRouter = map.getMappingNoByRouterName(m_thisRouterName);
+  auto thisRouter = map.getMappingNoByRouterName(m_thisRouterName);
 
   // Iterate over directly connected neighbors
   std::list<Adjacent> neighbors = adjacencies.getAdjList();
@@ -462,8 +456,7 @@
     // Install nexthops for this router to the neighbor; direct neighbors have a 0 cost link
     addNextHop(srcRouterName, srcFaceUri, 0, rt);
 
-    ndn::optional<int32_t> src = map.getMappingNoByRouterName(srcRouterName);
-
+    auto src = map.getMappingNoByRouterName(srcRouterName);
     if (!src) {
       NLSR_LOG_WARN(adj->getName() << " does not exist in the router map!");
       continue;
@@ -474,7 +467,7 @@
       // Don't calculate nexthops to this router or from a router to itself
       if (thisRouter && dest != *thisRouter && dest != *src) {
 
-        ndn::optional<ndn::Name> destRouterName = map.getRouterNameByMappingNo(dest);
+        auto destRouterName = map.getRouterNameByMappingNo(dest);
         if (destRouterName) {
           double distance = getHyperbolicDistance(lsdb, srcRouterName, *destRouterName);
 
@@ -551,6 +544,7 @@
       }
     }
   }
+
   if (angleVectorI[angleVectorI.size()-1] > 2.*M_PI ||
       angleVectorI[angleVectorI.size()-1] < 0.0) {
     NLSR_LOG_ERROR("Angle not within [0, 2PI]");
diff --git a/src/route/routing-table-calculator.hpp b/src/route/routing-table-calculator.hpp
index b497c06..749c5b8 100644
--- a/src/route/routing-table-calculator.hpp
+++ b/src/route/routing-table-calculator.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2021,  The University of Memphis,
+ * Copyright (c) 2014-2022,  The University of Memphis,
  *                           Regents of the University of California
  *
  * This file is part of NLSR (Named-data Link State Routing).
@@ -27,8 +27,6 @@
 #include "lsdb.hpp"
 #include "conf-parameter.hpp"
 
-#include <list>
-
 namespace nlsr {
 
 class Map;
@@ -193,13 +191,6 @@
 private:
   int* m_parent;
   double* m_distance;
-
-  static const int EMPTY_PARENT;
-  static const double INF_DISTANCE;
-  static const int NO_MAPPING_NUM;
-public:
-  static const int NO_NEXT_HOP;
-
 };
 
 class AdjacencyList;
@@ -236,10 +227,6 @@
   const size_t m_nRouters;
   const bool m_isDryRun;
   const ndn::Name m_thisRouterName;
-
-  static const double MATH_PI;
-  static const double UNKNOWN_DISTANCE;
-  static const double UNKNOWN_RADIUS;
 };
 
 } // namespace nlsr
diff --git a/src/route/routing-table-entry.cpp b/src/route/routing-table-entry.cpp
index 950240e..45307b2 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-2021,  The University of Memphis,
+ * Copyright (c) 2014-2022,  The University of Memphis,
  *                           Regents of the University of California
  *
  * This file is part of NLSR (Named-data Link State Routing).
@@ -37,7 +37,7 @@
   totalLength += m_destination.wireEncode(block);
 
   totalLength += block.prependVarNumber(totalLength);
-  totalLength += block.prependVarNumber(ndn::tlv::nlsr::RoutingTableEntry);
+  totalLength += block.prependVarNumber(nlsr::tlv::RoutingTableEntry);
 
   return totalLength;
 }
@@ -69,7 +69,7 @@
 
   m_wire = wire;
 
-  if (m_wire.type() != ndn::tlv::nlsr::RoutingTableEntry) {
+  if (m_wire.type() != nlsr::tlv::RoutingTableEntry) {
     NDN_THROW(Error("RoutingTableEntry", m_wire.type()));
   }
 
@@ -85,7 +85,7 @@
   }
 
   for (; val != m_wire.elements_end(); ++val) {
-    if (val->type() == ndn::tlv::nlsr::NextHop) {
+    if (val->type() == nlsr::tlv::NextHop) {
       m_nexthopList.addNextHop(NextHop(*val));
     }
     else {
diff --git a/src/route/routing-table-pool-entry.hpp b/src/route/routing-table-pool-entry.hpp
index 48212c3..148d2c9 100644
--- a/src/route/routing-table-pool-entry.hpp
+++ b/src/route/routing-table-pool-entry.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2020,  The University of Memphis,
+/*
+ * Copyright (c) 2014-2022,  The University of Memphis,
  *                           Regents of the University of California
  *
  * This file is part of NLSR (Named-data Link State Routing).
@@ -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_POOL_ENTRY_HPP
 #define NLSR_ROUTING_TABLE_POOL_ENTRY_HPP
@@ -41,6 +40,7 @@
  * maintain a collection of RoutingTablePoolEntries. Then, this new
  * class can be associated with the name prefixes instead of the
  * original entries, which provides a minimal memory solution.
+ *
  * \sa NamePrefixTable
  */
 class NamePrefixTableEntry;
@@ -48,13 +48,7 @@
 class RoutingTablePoolEntry : public RoutingTableEntry
 {
 public:
-  RoutingTablePoolEntry()
-  {
-  }
-
-  ~RoutingTablePoolEntry()
-  {
-  }
+  RoutingTablePoolEntry() = default;
 
   RoutingTablePoolEntry(const ndn::Name& dest)
   {
@@ -76,7 +70,7 @@
   }
 
   uint64_t
-  getUseCount()
+  getUseCount() const
   {
     return m_useCount;
   }
@@ -99,16 +93,14 @@
   void
   setNexthopList(NexthopList nhl)
   {
-    m_nexthopList = nhl;
+    m_nexthopList = std::move(nhl);
   }
 
 public:
-  std::unordered_map<ndn::Name, std::weak_ptr<NamePrefixTableEntry>>
-    namePrefixTableEntries;
+  std::unordered_map<ndn::Name, std::weak_ptr<NamePrefixTableEntry>> namePrefixTableEntries;
 
 private:
   uint64_t m_useCount;
-
 };
 
 bool
diff --git a/src/route/routing-table.cpp b/src/route/routing-table.cpp
index c06b429..7fd8a7a 100644
--- a/src/route/routing-table.cpp
+++ b/src/route/routing-table.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2021,  The University of Memphis,
+ * Copyright (c) 2014-2022,  The University of Memphis,
  *                           Regents of the University of California
  *
  * This file is part of NLSR (Named-data Link State Routing).
@@ -262,7 +262,7 @@
   }
 
   totalLength += block.prependVarNumber(totalLength);
-  totalLength += block.prependVarNumber(ndn::tlv::nlsr::RoutingTable);
+  totalLength += block.prependVarNumber(nlsr::tlv::RoutingTable);
 
   return totalLength;
 }
@@ -294,7 +294,7 @@
 
   m_wire = wire;
 
-  if (m_wire.type() != ndn::tlv::nlsr::RoutingTable) {
+  if (m_wire.type() != nlsr::tlv::RoutingTable) {
     NDN_THROW(Error("RoutingTable", m_wire.type()));
   }
 
@@ -302,7 +302,7 @@
   auto val = m_wire.elements_begin();
 
   std::set<ndn::Name> destinations;
-  for (; val != m_wire.elements_end() && val->type() == ndn::tlv::nlsr::RoutingTableEntry; ++val) {
+  for (; val != m_wire.elements_end() && val->type() == nlsr::tlv::RoutingTableEntry; ++val) {
     auto entry = RoutingTableEntry(*val);
 
     if (destinations.emplace(entry.getDestination()).second) {
