diff --git a/src/adjacency-list.hpp b/src/adjacency-list.hpp
index 2f2b164..dd10082 100644
--- a/src/adjacency-list.hpp
+++ b/src/adjacency-list.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.
  *
@@ -32,8 +32,8 @@
 class AdjacencyList
 {
 public:
-  typedef std::list<Adjacent>::const_iterator const_iterator;
-  typedef std::list<Adjacent>::iterator iterator;
+  using const_iterator = std::list<Adjacent>::const_iterator;
+  using iterator = std::list<Adjacent>::iterator;
 
   bool
   insert(const Adjacent& adjacent);
@@ -116,12 +116,8 @@
     converted to Name and findAdjacent(Name) be used.
     So when faceUri is passed as string this will cause a compile error
    */
-  template <typename T = float> void
-  findAdjacent(const std::string& faceUri)
-  {
-    BOOST_STATIC_ASSERT_MSG(std::is_integral<T>::value,
-      "Don't use std::string with findAdjacent!");
-  }
+  void
+  findAdjacent(const std::string&) = delete;
 
   uint64_t
   getFaceId(const ndn::FaceUri& faceUri);
diff --git a/src/adjacent.cpp b/src/adjacent.cpp
index 637ea90..508832a 100644
--- a/src/adjacent.cpp
+++ b/src/adjacent.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).
@@ -26,9 +26,6 @@
 
 INIT_LOGGER(Adjacent);
 
-const double Adjacent::DEFAULT_LINK_COST = 10.0;
-const double Adjacent::NON_ADJACENT_COST = -12345;
-
 Adjacent::Adjacent()
   : m_name()
   , m_faceUri()
@@ -86,14 +83,14 @@
 {
   size_t totalLength = 0;
 
-  totalLength += prependDoubleBlock(encoder, ndn::tlv::nlsr::Cost, m_linkCost);
+  totalLength += prependDoubleBlock(encoder, nlsr::tlv::Cost, m_linkCost);
 
-  totalLength += prependStringBlock(encoder, ndn::tlv::nlsr::Uri, m_faceUri.toString());
+  totalLength += prependStringBlock(encoder, nlsr::tlv::Uri, m_faceUri.toString());
 
   totalLength += m_name.wireEncode(encoder);
 
   totalLength += encoder.prependVarNumber(totalLength);
-  totalLength += encoder.prependVarNumber(ndn::tlv::nlsr::Adjacency);
+  totalLength += encoder.prependVarNumber(nlsr::tlv::Adjacency);
 
   return totalLength;
 }
@@ -125,7 +122,7 @@
 
   m_wire = wire;
 
-  if (m_wire.type() != ndn::tlv::nlsr::Adjacency) {
+  if (m_wire.type() != nlsr::tlv::Adjacency) {
     NDN_THROW(Error("Adjacency", m_wire.type()));
   }
 
@@ -141,7 +138,7 @@
     NDN_THROW(Error("Missing required Name field"));
   }
 
-  if (val != m_wire.elements_end() && val->type() == ndn::tlv::nlsr::Uri) {
+  if (val != m_wire.elements_end() && val->type() == nlsr::tlv::Uri) {
     m_faceUri = ndn::FaceUri(readString(*val));
     ++val;
   }
@@ -149,7 +146,7 @@
     NDN_THROW(Error("Missing required Uri field"));
   }
 
-  if (val != m_wire.elements_end() && val->type() == ndn::tlv::nlsr::Cost) {
+  if (val != m_wire.elements_end() && val->type() == nlsr::tlv::Cost) {
     m_linkCost = ndn::encoding::readDouble(*val);
     ++val;
   }
diff --git a/src/adjacent.hpp b/src/adjacent.hpp
index 135c6fc..b5b93a9 100644
--- a/src/adjacent.hpp
+++ b/src/adjacent.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.
  *
@@ -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/>.
- **/
+ */
 
 #ifndef NLSR_ADJACENT_HPP
 #define NLSR_ADJACENT_HPP
 
-#include <string>
 #include <cmath>
+#include <string>
 
 #include <ndn-cxx/face.hpp>
 #include <ndn-cxx/net/face-uri.hpp>
@@ -183,8 +183,8 @@
   wireDecode(const ndn::Block& wire);
 
 public:
-  static const double DEFAULT_LINK_COST;
-  static const double NON_ADJACENT_COST;
+  static constexpr double DEFAULT_LINK_COST = 10.0;
+  static constexpr double NON_ADJACENT_COST = -12345.0;
 
 private:
   /*! m_name The NLSR-configured router name of the neighbor */
diff --git a/src/common.hpp b/src/common.hpp
index dd826ac..a0db086 100644
--- a/src/common.hpp
+++ b/src/common.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).
@@ -26,6 +26,7 @@
 #include <functional>
 #include <iterator>
 #include <memory>
+#include <type_traits>
 #include <utility>
 
 #include <ndn-cxx/name.hpp>
@@ -36,7 +37,7 @@
 
 using namespace ndn::time_literals;
 
-const ndn::time::seconds TIME_ALLOWED_FOR_CANONIZATION = 4_s;
+constexpr ndn::time::seconds TIME_ALLOWED_FOR_CANONIZATION = 4_s;
 
 template<typename T, typename = void>
 struct is_iterator
@@ -47,9 +48,8 @@
 /*! Use C++11 iterator_traits to check if some type is an iterator
  */
 template<typename T>
-struct is_iterator<T, typename std::enable_if<!std::is_same<
-  typename std::iterator_traits<T>::value_type,
-  void>::value>::type>
+struct is_iterator<T, std::enable_if_t<!std::is_same_v<
+  typename std::iterator_traits<T>::value_type, void>>>
 {
   static constexpr bool value = true;
 };
diff --git a/src/conf-parameter.cpp b/src/conf-parameter.cpp
index a7008e7..8a7a56f 100644
--- a/src/conf-parameter.cpp
+++ b/src/conf-parameter.cpp
@@ -20,15 +20,13 @@
 
 #include "conf-parameter.hpp"
 #include "logger.hpp"
+
 #include <ndn-cxx/security/signing-helpers.hpp>
 
 namespace nlsr {
 
 INIT_LOGGER(ConfParameter);
 
-// To be changed when breaking changes are made to sync
-const uint64_t ConfParameter::SYNC_VERSION = 10;
-
 static std::unique_ptr<ndn::security::CertificateFetcherDirectFetch>
 makeCertificateFetcher(ndn::Face& face)
 {
@@ -119,7 +117,7 @@
   m_prefixUpdateValidator.loadAnchor("Authoritative-Certificate", ndn::security::Certificate(cert));
 }
 
-ndn::optional<ndn::security::Certificate>
+std::optional<ndn::security::Certificate>
 ConfParameter::initializeKey()
 {
   using namespace ndn::security;
@@ -133,7 +131,7 @@
     NLSR_LOG_ERROR("Router identity " << m_routerPrefix << " not found. "
                    "NLSR is running without security. "
                    "If security is enabled in the configuration, NLSR will not converge.");
-    return ndn::nullopt;
+    return std::nullopt;
   }
   catch (const std::invalid_argument& e) {
     // This is (probably) needed for the dummy keychain patch.
@@ -155,7 +153,7 @@
       NLSR_LOG_ERROR(exceptionText);
       throw;
     }
-    return ndn::nullopt;
+    return std::nullopt;
   }
 
   auto key = m_keyChain.createIdentity(instanceName).getDefaultKey();
diff --git a/src/conf-parameter.hpp b/src/conf-parameter.hpp
index 9989803..aedffac 100644
--- a/src/conf-parameter.hpp
+++ b/src/conf-parameter.hpp
@@ -23,7 +23,6 @@
 #define NLSR_CONF_PARAMETER_HPP
 
 #include "common.hpp"
-#include "logger.hpp"
 #include "test-access-control.hpp"
 #include "adjacency-list.hpp"
 #include "name-prefix-list.hpp"
@@ -32,6 +31,8 @@
 #include <ndn-cxx/security/validator-config.hpp>
 #include <ndn-cxx/security/certificate-fetcher-direct-fetch.hpp>
 
+#include <optional>
+
 namespace nlsr {
 
 enum {
@@ -475,7 +476,7 @@
     return m_keyChain;
   }
 
-  ndn::optional<ndn::security::Certificate>
+  std::optional<ndn::security::Certificate>
   initializeKey();
 
   void
@@ -530,7 +531,8 @@
   SyncProtocol m_syncProtocol;
 
 PUBLIC_WITH_TESTS_ELSE_PRIVATE:
-  static const uint64_t SYNC_VERSION;
+  // must be incremented when breaking changes are made to sync
+  static constexpr uint64_t SYNC_VERSION = 10;
 
   AdjacencyList m_adjl;
   NamePrefixList m_npl;
diff --git a/src/hello-protocol.cpp b/src/hello-protocol.cpp
index fac4458..ec03da7 100644
--- a/src/hello-protocol.cpp
+++ b/src/hello-protocol.cpp
@@ -21,8 +21,8 @@
 #include "hello-protocol.hpp"
 #include "nlsr.hpp"
 #include "lsdb.hpp"
-#include "utility/name-helper.hpp"
 #include "logger.hpp"
+#include "utility/name-helper.hpp"
 
 #include <ndn-cxx/encoding/nfd-constants.hpp>
 
@@ -30,9 +30,6 @@
 
 INIT_LOGGER(HelloProtocol);
 
-const std::string HelloProtocol::INFO_COMPONENT = "INFO";
-const std::string HelloProtocol::NLSR_COMPONENT = "nlsr";
-
 HelloProtocol::HelloProtocol(ndn::Face& face, ndn::KeyChain& keyChain,
                              ConfParameter& confParam, RoutingTable& routingTable,
                              Lsdb& lsdb)
@@ -204,9 +201,9 @@
   }
 }
 
-  // This is the first function that incoming Hello data will
-  // see. This checks if the data appears to be signed, and passes it
-  // on to validate the content of the data.
+// This is the first function that incoming Hello data will
+// see. This checks if the data appears to be signed, and passes it
+// on to validate the content of the data.
 void
 HelloProtocol::onContent(const ndn::Interest& interest, const ndn::Data& data)
 {
diff --git a/src/hello-protocol.hpp b/src/hello-protocol.hpp
index a42a4de..3ae3629 100644
--- a/src/hello-protocol.hpp
+++ b/src/hello-protocol.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.
  *
@@ -22,19 +22,16 @@
 #ifndef NLSR_HELLO_PROTOCOL_HPP
 #define NLSR_HELLO_PROTOCOL_HPP
 
-#include "statistics.hpp"
-#include "test-access-control.hpp"
 #include "conf-parameter.hpp"
 #include "lsdb.hpp"
 #include "route/routing-table.hpp"
+#include "statistics.hpp"
+#include "test-access-control.hpp"
 
-#include <ndn-cxx/util/signal.hpp>
 #include <ndn-cxx/face.hpp>
-#include <ndn-cxx/mgmt/nfd/control-parameters.hpp>
-#include <ndn-cxx/mgmt/nfd/control-response.hpp>
-#include <ndn-cxx/util/scheduler.hpp>
 #include <ndn-cxx/security/validation-error.hpp>
-#include <ndn-cxx/security/validator-config.hpp>
+#include <ndn-cxx/util/scheduler.hpp>
+#include <ndn-cxx/util/signal.hpp>
 
 namespace nlsr {
 
@@ -139,8 +136,8 @@
   AdjacencyList& m_adjacencyList;
 
 PUBLIC_WITH_TESTS_ELSE_PRIVATE:
-  static const std::string INFO_COMPONENT;
-  static const std::string NLSR_COMPONENT;
+  static inline const std::string INFO_COMPONENT{"INFO"};
+  static inline const std::string NLSR_COMPONENT{"nlsr"};
 };
 
 } // namespace nlsr
diff --git a/src/lsa/adj-lsa.cpp b/src/lsa/adj-lsa.cpp
index 3d49533..e6d2f6e 100644
--- a/src/lsa/adj-lsa.cpp
+++ b/src/lsa/adj-lsa.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.
  *
@@ -62,7 +62,7 @@
   totalLength += Lsa::wireEncode(block);
 
   totalLength += block.prependVarNumber(totalLength);
-  totalLength += block.prependVarNumber(ndn::tlv::nlsr::AdjacencyLsa);
+  totalLength += block.prependVarNumber(nlsr::tlv::AdjacencyLsa);
 
   return totalLength;
 }
@@ -92,7 +92,7 @@
 {
   m_wire = wire;
 
-  if (m_wire.type() != ndn::tlv::nlsr::AdjacencyLsa) {
+  if (m_wire.type() != nlsr::tlv::AdjacencyLsa) {
     NDN_THROW(Error("AdjacencyLsa", m_wire.type()));
   }
 
@@ -100,7 +100,7 @@
 
   auto val = m_wire.elements_begin();
 
-  if (val != m_wire.elements_end() && val->type() == ndn::tlv::nlsr::Lsa) {
+  if (val != m_wire.elements_end() && val->type() == nlsr::tlv::Lsa) {
     Lsa::wireDecode(*val);
     ++val;
   }
@@ -110,7 +110,7 @@
 
   AdjacencyList adl;
   for (; val != m_wire.elements_end(); ++val) {
-    if (val->type() == ndn::tlv::nlsr::Adjacency) {
+    if (val->type() == nlsr::tlv::Adjacency) {
       adl.insert(Adjacent(*val));
     }
     else {
@@ -148,9 +148,9 @@
     for (const auto& adjacent : alsa->getAdl()) {
       addAdjacent(adjacent);
     }
-    return std::make_tuple(true, std::list<ndn::Name>{}, std::list<ndn::Name>{});
+    return {true, std::list<ndn::Name>{}, std::list<ndn::Name>{}};
   }
-  return std::make_tuple(false, std::list<ndn::Name>{}, std::list<ndn::Name>{});
+  return {false, std::list<ndn::Name>{}, std::list<ndn::Name>{}};
 }
 
 std::ostream&
diff --git a/src/lsa/coordinate-lsa.cpp b/src/lsa/coordinate-lsa.cpp
index f61fb29..fb268b2 100644
--- a/src/lsa/coordinate-lsa.cpp
+++ b/src/lsa/coordinate-lsa.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.
  *
@@ -65,16 +65,15 @@
   size_t totalLength = 0;
 
   for (auto it = m_hyperbolicAngles.rbegin(); it != m_hyperbolicAngles.rend(); ++it) {
-    totalLength += ndn::encoding::prependDoubleBlock(block, ndn::tlv::nlsr::HyperbolicAngle, *it);
+    totalLength += ndn::encoding::prependDoubleBlock(block, nlsr::tlv::HyperbolicAngle, *it);
   }
 
-  totalLength += ndn::encoding::prependDoubleBlock(block, ndn::tlv::nlsr::HyperbolicRadius,
-                                                   m_hyperbolicRadius);
+  totalLength += ndn::encoding::prependDoubleBlock(block, nlsr::tlv::HyperbolicRadius, m_hyperbolicRadius);
 
   totalLength += Lsa::wireEncode(block);
 
   totalLength += block.prependVarNumber(totalLength);
-  totalLength += block.prependVarNumber(ndn::tlv::nlsr::CoordinateLsa);
+  totalLength += block.prependVarNumber(nlsr::tlv::CoordinateLsa);
 
   return totalLength;
 }
@@ -104,7 +103,7 @@
 {
   m_wire = wire;
 
-  if (m_wire.type() != ndn::tlv::nlsr::CoordinateLsa) {
+  if (m_wire.type() != nlsr::tlv::CoordinateLsa) {
     NDN_THROW(Error("CoordinateLsa", m_wire.type()));
   }
 
@@ -112,7 +111,7 @@
 
   auto val = m_wire.elements_begin();
 
-  if (val != m_wire.elements_end() && val->type() == ndn::tlv::nlsr::Lsa) {
+  if (val != m_wire.elements_end() && val->type() == nlsr::tlv::Lsa) {
     Lsa::wireDecode(*val);
     ++val;
   }
@@ -120,7 +119,7 @@
     NDN_THROW(Error("Missing required Lsa field"));
   }
 
-  if (val != m_wire.elements_end() && val->type() == ndn::tlv::nlsr::HyperbolicRadius) {
+  if (val != m_wire.elements_end() && val->type() == nlsr::tlv::HyperbolicRadius) {
     m_hyperbolicRadius = ndn::encoding::readDouble(*val);
     ++val;
   }
@@ -130,7 +129,7 @@
 
   std::vector<double> angles;
   for (; val != m_wire.elements_end(); ++val) {
-    if (val->type() == ndn::tlv::nlsr::HyperbolicAngle) {
+    if (val->type() == nlsr::tlv::HyperbolicAngle) {
       angles.push_back(ndn::encoding::readDouble(*val));
     }
     else {
@@ -164,9 +163,9 @@
     for (const auto& angle : clsa->getCorTheta()) {
       m_hyperbolicAngles.push_back(angle);
     }
-    return std::make_tuple(true, std::list<ndn::Name>{}, std::list<ndn::Name>{});
+    return {true, std::list<ndn::Name>{}, std::list<ndn::Name>{}};
   }
-  return std::make_tuple(false, std::list<ndn::Name>{}, std::list<ndn::Name>{});
+  return {false, std::list<ndn::Name>{}, std::list<ndn::Name>{}};
 }
 
 std::ostream&
diff --git a/src/lsa/lsa.cpp b/src/lsa/lsa.cpp
index 738607e..66e5b2d 100644
--- a/src/lsa/lsa.cpp
+++ b/src/lsa/lsa.cpp
@@ -49,15 +49,15 @@
   size_t totalLength = 0;
 
   totalLength += prependStringBlock(encoder,
-                                    ndn::tlv::nlsr::ExpirationTime,
+                                    nlsr::tlv::ExpirationTime,
                                     ndn::time::toString(m_expirationTimePoint));
 
-  totalLength += prependNonNegativeIntegerBlock(encoder, ndn::tlv::nlsr::SequenceNumber, m_seqNo);
+  totalLength += prependNonNegativeIntegerBlock(encoder, nlsr::tlv::SequenceNumber, m_seqNo);
 
   totalLength += m_originRouter.wireEncode(encoder);
 
   totalLength += encoder.prependVarNumber(totalLength);
-  totalLength += encoder.prependVarNumber(ndn::tlv::nlsr::Lsa);
+  totalLength += encoder.prependVarNumber(nlsr::tlv::Lsa);
 
   return totalLength;
 }
@@ -84,7 +84,7 @@
 
   ++val;
 
-  if (val != baseWire.elements_end() && val->type() == ndn::tlv::nlsr::SequenceNumber) {
+  if (val != baseWire.elements_end() && val->type() == nlsr::tlv::SequenceNumber) {
     m_seqNo = ndn::readNonNegativeInteger(*val);
     ++val;
   }
@@ -92,7 +92,7 @@
     NDN_THROW(Error("Missing required SequenceNumber field"));
   }
 
-  if (val != baseWire.elements_end() && val->type() == ndn::tlv::nlsr::ExpirationTime) {
+  if (val != baseWire.elements_end() && val->type() == nlsr::tlv::ExpirationTime) {
     m_expirationTimePoint = ndn::time::fromString(readString(*val));
   }
   else {
diff --git a/src/lsa/name-lsa.cpp b/src/lsa/name-lsa.cpp
index 53281e1..f578a06 100644
--- a/src/lsa/name-lsa.cpp
+++ b/src/lsa/name-lsa.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.
  *
@@ -54,7 +54,7 @@
   totalLength += Lsa::wireEncode(block);
 
   totalLength += block.prependVarNumber(totalLength);
-  totalLength += block.prependVarNumber(ndn::tlv::nlsr::NameLsa);
+  totalLength += block.prependVarNumber(nlsr::tlv::NameLsa);
 
   return totalLength;
 }
@@ -84,7 +84,7 @@
 {
   m_wire = wire;
 
-  if (m_wire.type() != ndn::tlv::nlsr::NameLsa) {
+  if (m_wire.type() != nlsr::tlv::NameLsa) {
     NDN_THROW(Error("NameLsa", m_wire.type()));
   }
 
@@ -92,7 +92,7 @@
 
   auto val = m_wire.elements_begin();
 
-  if (val != m_wire.elements_end() && val->type() == ndn::tlv::nlsr::Lsa) {
+  if (val != m_wire.elements_end() && val->type() == nlsr::tlv::Lsa) {
     Lsa::wireDecode(*val);
     ++val;
   }
@@ -164,7 +164,7 @@
     updated = true;
   }
 
-  return std::make_tuple(updated, namesToAdd, namesToRemove);
+  return {updated, namesToAdd, namesToRemove};
 }
 
 std::ostream&
diff --git a/src/lsdb.cpp b/src/lsdb.cpp
index 490c540..bca46a6 100644
--- a/src/lsdb.cpp
+++ b/src/lsdb.cpp
@@ -31,16 +31,13 @@
 
 INIT_LOGGER(Lsdb);
 
-const ndn::time::steady_clock::TimePoint Lsdb::DEFAULT_LSA_RETRIEVAL_DEADLINE =
-  ndn::time::steady_clock::TimePoint::min();
-
 Lsdb::Lsdb(ndn::Face& face, ndn::KeyChain& keyChain, ConfParameter& confParam)
   : m_face(face)
   , m_scheduler(face.getIoService())
   , m_confParam(confParam)
   , m_sync(m_face,
-           [this] (const ndn::Name& routerName, const Lsa::Type& lsaType,
-                   const uint64_t& sequenceNumber, uint64_t incomingFaceId) {
+           [this] (const auto& routerName, const Lsa::Type& lsaType,
+                   uint64_t sequenceNumber, uint64_t incomingFaceId) {
              return isLsaNew(routerName, lsaType, sequenceNumber);
            }, m_confParam)
   , m_lsaRefreshTime(ndn::time::seconds(m_confParam.getLsaRefreshTime()))
@@ -249,10 +246,7 @@
     chkLsa->setSeqNo(lsa->getSeqNo());
     chkLsa->setExpirationTimePoint(lsa->getExpirationTimePoint());
 
-    bool updated;
-    std::list<ndn::Name> namesToAdd, namesToRemove;
-    std::tie(updated, namesToAdd, namesToRemove) = chkLsa->update(lsa);
-
+    auto [updated, namesToAdd, namesToRemove] = chkLsa->update(lsa);
     if (updated) {
       onLsdbModified(lsa, LsdbUpdate::UPDATED, namesToAdd, namesToRemove);
     }
diff --git a/src/lsdb.hpp b/src/lsdb.hpp
index 5242c94..915c7b6 100644
--- a/src/lsdb.hpp
+++ b/src/lsdb.hpp
@@ -279,7 +279,7 @@
 
   void
   expressInterest(const ndn::Name& interestName, uint32_t timeoutCount, uint64_t incomingFaceId,
-                  ndn::time::steady_clock::TimePoint deadline = DEFAULT_LSA_RETRIEVAL_DEADLINE);
+                  ndn::time::steady_clock::time_point deadline = DEFAULT_LSA_RETRIEVAL_DEADLINE);
 
   /*!
      \brief Error callback when SegmentFetcher fails to return an LSA
@@ -298,7 +298,7 @@
   void
   onFetchLsaError(uint32_t errorCode, const std::string& msg,
                   const ndn::Name& interestName, uint32_t retransmitNo,
-                  const ndn::time::steady_clock::TimePoint& deadline,
+                  const ndn::time::steady_clock::time_point& deadline,
                   ndn::Name lsaName, uint64_t seqNo);
 
   /*!
@@ -316,7 +316,7 @@
     afterSegmentValidatedSignal(data);
   }
 
-  ndn::time::system_clock::TimePoint
+  ndn::time::system_clock::time_point
   getLsaExpirationTimePoint() const
   {
     return ndn::time::system_clock::now() + ndn::time::seconds(m_confParam.getRouterDeadInterval());
@@ -360,8 +360,8 @@
 
   ndn::InMemoryStoragePersistent m_lsaStorage;
 
-  const ndn::Name::Component NAME_COMPONENT = ndn::Name::Component("lsdb");
-  static const ndn::time::steady_clock::TimePoint DEFAULT_LSA_RETRIEVAL_DEADLINE;
+  static inline const ndn::time::steady_clock::time_point DEFAULT_LSA_RETRIEVAL_DEADLINE =
+    ndn::time::steady_clock::time_point::min();
 };
 
 } // namespace nlsr
diff --git a/src/name-prefix-list.cpp b/src/name-prefix-list.cpp
index b5822c5..c858c96 100644
--- a/src/name-prefix-list.cpp
+++ b/src/name-prefix-list.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.
  *
@@ -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-list.hpp"
 #include "common.hpp"
@@ -26,23 +26,10 @@
 
 NamePrefixList::NamePrefixList() = default;
 
-NamePrefixList::NamePrefixList(const std::initializer_list<ndn::Name>& names)
+NamePrefixList::NamePrefixList(ndn::span<const ndn::Name> names)
 {
-  std::vector<NamePrefixList::NamePair> namePairs;
-  std::transform(names.begin(), names.end(), std::back_inserter(namePairs),
-    [] (const ndn::Name& name) {
-      return NamePrefixList::NamePair{name, {""}};
-    });
-  m_names = std::move(namePairs);
-}
-
-NamePrefixList::NamePrefixList(const std::initializer_list<NamePrefixList::NamePair>& namesAndSources)
-  : m_names(namesAndSources)
-{
-}
-
-NamePrefixList::~NamePrefixList()
-{
+  std::transform(names.begin(), names.end(), std::back_inserter(m_names),
+                 [] (const auto& name) { return NamePair{name, {""}}; });
 }
 
 std::vector<NamePrefixList::NamePair>::iterator
@@ -70,11 +57,11 @@
   auto pairItr = get(name);
   if (pairItr == m_names.end()) {
     std::vector<std::string> sources{source};
-    m_names.push_back(std::tie(name, sources));
+    m_names.emplace_back(name, sources);
     return true;
   }
   else {
-    std::vector<std::string>& sources = std::get<NamePrefixList::NamePairIndex::SOURCES>(*pairItr);
+    auto& sources = std::get<NamePrefixList::NamePairIndex::SOURCES>(*pairItr);
     auto sourceItr = getSource(source, pairItr);
     if (sourceItr == sources.end()) {
       sources.push_back(source);
@@ -89,11 +76,11 @@
 {
   auto pairItr = get(name);
   if (pairItr != m_names.end()) {
-    std::vector<std::string>& sources = std::get<NamePrefixList::NamePairIndex::SOURCES>(*pairItr);
+    auto& sources = std::get<NamePrefixList::NamePairIndex::SOURCES>(*pairItr);
     auto sourceItr = getSource(source, pairItr);
     if (sourceItr != sources.end()) {
       sources.erase(sourceItr);
-      if (sources.size() == 0) {
+      if (sources.empty()) {
         m_names.erase(pairItr);
       }
       return true;
@@ -141,12 +128,13 @@
     return std::get<NamePrefixList::NamePairIndex::SOURCES>(*it);
   }
   else {
-    return std::vector<std::string>{};
+    return {};
   }
 }
 
 std::ostream&
-operator<<(std::ostream& os, const NamePrefixList& list) {
+operator<<(std::ostream& os, const NamePrefixList& list)
+{
   os << "Name prefix list: {\n";
   for (const auto& name : list.getNames()) {
     os << name << "\n"
diff --git a/src/name-prefix-list.hpp b/src/name-prefix-list.hpp
index f5bac1d..46eb0d0 100644
--- a/src/name-prefix-list.hpp
+++ b/src/name-prefix-list.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,
  *                           Arizona Board of Regents.
  *
@@ -17,15 +17,19 @@
  *
  * You should have received a copy of the GNU General Public License along with
  * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- **/
+ */
 
 #ifndef NLSR_NAME_PREFIX_LIST_HPP
 #define NLSR_NAME_PREFIX_LIST_HPP
 
 #include "test-access-control.hpp"
 
+#include <initializer_list>
 #include <list>
 #include <string>
+#include <tuple>
+#include <vector>
+
 #include <ndn-cxx/name.hpp>
 
 namespace nlsr {
@@ -34,6 +38,7 @@
 {
 public:
   using NamePair = std::tuple<ndn::Name, std::vector<std::string>>;
+
   enum NamePairIndex {
     NAME,
     SOURCES
@@ -41,21 +46,20 @@
 
   NamePrefixList();
 
-  NamePrefixList(const std::initializer_list<ndn::Name>& names);
+  explicit
+  NamePrefixList(ndn::span<const ndn::Name> names);
 
-  NamePrefixList(const std::initializer_list<NamePrefixList::NamePair>& namesAndSources);
-
-PUBLIC_WITH_TESTS_ELSE_PRIVATE:
-  template<class ContainerType>
-  NamePrefixList(const ContainerType& names)
+#ifdef WITH_TESTS
+  NamePrefixList(std::initializer_list<ndn::Name> names)
+    : NamePrefixList(ndn::span<const ndn::Name>(names))
   {
-    for (const auto& elem : names) {
-      m_names.push_back(NamePair{elem, {""}});
-    }
   }
 
-public:
-  ~NamePrefixList();
+  NamePrefixList(std::initializer_list<NamePair> namesAndSources)
+    : m_names(namesAndSources)
+  {
+  }
+#endif
 
   /*! \brief inserts name into NamePrefixList
       \retval true If the name was successfully inserted.
diff --git a/src/nlsr.cpp b/src/nlsr.cpp
index 176795f..c43ad47 100644
--- a/src/nlsr.cpp
+++ b/src/nlsr.cpp
@@ -33,8 +33,6 @@
 
 INIT_LOGGER(Nlsr);
 
-const ndn::Name Nlsr::LOCALHOST_PREFIX = ndn::Name("/localhost/nlsr");
-
 Nlsr::Nlsr(ndn::Face& face, ndn::KeyChain& keyChain, ConfParameter& confParam)
   : m_face(face)
   , m_scheduler(face.getIoService())
@@ -126,8 +124,8 @@
   ndn::Name instanceKey(originRouter);
   instanceKey.append("nlsr").append(ndn::security::Certificate::KEY_COMPONENT);
 
-  m_fib.setStrategy(routerKey, Fib::BEST_ROUTE_V2_STRATEGY, 0);
-  m_fib.setStrategy(instanceKey, Fib::BEST_ROUTE_V2_STRATEGY, 0);
+  m_fib.setStrategy(routerKey, Fib::BEST_ROUTE_STRATEGY, 0);
+  m_fib.setStrategy(instanceKey, Fib::BEST_ROUTE_STRATEGY, 0);
 
   ndn::Name siteKey;
   for (size_t i = 0; i < originRouter.size(); ++i) {
@@ -138,10 +136,10 @@
   }
   ndn::Name opPrefix(siteKey);
   siteKey.append(ndn::security::Certificate::KEY_COMPONENT);
-  m_fib.setStrategy(siteKey, Fib::BEST_ROUTE_V2_STRATEGY, 0);
+  m_fib.setStrategy(siteKey, Fib::BEST_ROUTE_STRATEGY, 0);
 
   opPrefix.append(std::string("%C1.Operator"));
-  m_fib.setStrategy(opPrefix, Fib::BEST_ROUTE_V2_STRATEGY, 0);
+  m_fib.setStrategy(opPrefix, Fib::BEST_ROUTE_STRATEGY, 0);
 }
 
 void
diff --git a/src/nlsr.hpp b/src/nlsr.hpp
index 4c97401..6756c9a 100644
--- a/src/nlsr.hpp
+++ b/src/nlsr.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.
  *
@@ -159,7 +159,7 @@
   enableIncomingFaceIdIndication();
 
 public:
-  static const ndn::Name LOCALHOST_PREFIX;
+  static inline const ndn::Name LOCALHOST_PREFIX{"/localhost/nlsr"};
 
 private:
   ndn::Face& m_face;
diff --git a/src/publisher/dataset-interest-handler.hpp b/src/publisher/dataset-interest-handler.hpp
index 9e5caaf..d6bf090 100644
--- a/src/publisher/dataset-interest-handler.hpp
+++ b/src/publisher/dataset-interest-handler.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.
  *
@@ -35,17 +35,17 @@
 #include "route/routing-table.hpp"
 #include "route/nexthop-list.hpp"
 #include "lsdb.hpp"
-#include "logger.hpp"
 
-#include <ndn-cxx/mgmt/dispatcher.hpp>
 #include <ndn-cxx/face.hpp>
+#include <ndn-cxx/mgmt/dispatcher.hpp>
 #include <boost/noncopyable.hpp>
 
 namespace nlsr {
+
 namespace dataset {
-const ndn::Name::Component ADJACENCY_COMPONENT = ndn::Name::Component{"adjacencies"};
-const ndn::Name::Component NAME_COMPONENT = ndn::Name::Component{"names"};
-const ndn::Name::Component COORDINATE_COMPONENT = ndn::Name::Component{"coordinates"};
+inline const ndn::Name::Component ADJACENCY_COMPONENT{"adjacencies"};
+inline const ndn::Name::Component NAME_COMPONENT{"names"};
+inline const ndn::Name::Component COORDINATE_COMPONENT{"coordinates"};
 } // namespace dataset
 
 /*!
@@ -59,11 +59,7 @@
   class Error : std::runtime_error
   {
   public:
-    explicit
-    Error(const std::string& what)
-      : std::runtime_error(what)
-    {
-    }
+    using std::runtime_error::runtime_error;
   };
 
   DatasetInterestHandler(ndn::mgmt::Dispatcher& dispatcher,
@@ -79,7 +75,7 @@
 
   /*! \brief provide LSA status dataset
    */
-  template <typename T>
+  template<typename T>
   void
   publishLsaStatus(const ndn::Name& topPrefix, const ndn::Interest& interest,
                    ndn::mgmt::StatusDatasetContext& context);
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) {
diff --git a/src/tlv-nlsr.hpp b/src/tlv-nlsr.hpp
index a445e52..224c452 100644
--- a/src/tlv-nlsr.hpp
+++ b/src/tlv-nlsr.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,
  *                           Arizona Board of Regents.
  *
@@ -22,9 +22,7 @@
 #ifndef NLSR_TLV_NLSR_HPP
 #define NLSR_TLV_NLSR_HPP
 
-namespace ndn {
-namespace tlv {
-namespace nlsr {
+namespace nlsr::tlv {
 
 /*! The TLV block types that NLSR uses to encode/decode LSA types. The
  *  way NLSR encodes LSAs to TLV is by encoding each element of the
@@ -47,11 +45,9 @@
   Uri                         = 141,
   NextHop                     = 143,
   RoutingTable                = 144,
-  RoutingTableEntry           = 145
+  RoutingTableEntry           = 145,
 };
 
-} // namespace nlsr
-} // namespace tlv
-} // namespace ndn
+} // namespace nlsr::tlv
 
 #endif // NLSR_TLV_NLSR_HPP
diff --git a/src/update/manager-base.cpp b/src/update/manager-base.cpp
index 6ca1c4a..238a88f 100644
--- a/src/update/manager-base.cpp
+++ b/src/update/manager-base.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.
  *
@@ -17,9 +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 "manager-base.hpp"
+#include "logger.hpp"
 
 namespace nlsr {
 namespace update {
diff --git a/src/update/manager-base.hpp b/src/update/manager-base.hpp
index f9fa17c..557a015 100644
--- a/src/update/manager-base.hpp
+++ b/src/update/manager-base.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.
  *
@@ -27,7 +27,6 @@
 #include "lsdb.hpp"
 #include "nfd-rib-commands.hpp"
 #include "prefix-update-commands.hpp"
-#include "logger.hpp"
 
 #include <ndn-cxx/face.hpp>
 #include <ndn-cxx/interest.hpp>
@@ -38,6 +37,7 @@
 
 #include <boost/noncopyable.hpp>
 #include <iostream>
+#include <optional>
 
 namespace nlsr {
 
@@ -95,7 +95,7 @@
   std::string m_module;
 };
 
-class CommandManagerBase: public ManagerBase
+class CommandManagerBase : public ManagerBase
 {
 public:
   CommandManagerBase(ndn::mgmt::Dispatcher& m_dispatcher,
@@ -103,7 +103,8 @@
                      Lsdb& lsdb,
                      const std::string& module);
 
-  virtual ~CommandManagerBase() {}
+  virtual
+  ~CommandManagerBase() = default;
 
   /*! \brief add desired name prefix to the advertised name prefix list
    *         or insert a prefix into the FIB if parameters is valid.
@@ -126,14 +127,20 @@
   /*! \brief save an advertised prefix to the nlsr configuration file
    *         returns bool from the overridden function while nullopt here
    */
-  virtual ndn::optional<bool>
-  afterAdvertise(const ndn::Name& prefix) { return ndn::nullopt; }
+  virtual std::optional<bool>
+  afterAdvertise(const ndn::Name& prefix)
+  {
+    return std::nullopt;
+  }
 
   /*! \brief save an advertised prefix to the nlsr configuration file
    *         returns bool from the overridden function while nullopt here
    */
-  virtual ndn::optional<bool>
-  afterWithdraw(const ndn::Name& prefix) { return ndn::nullopt; }
+  virtual std::optional<bool>
+  afterWithdraw(const ndn::Name& prefix)
+  {
+    return std::nullopt;
+  }
 
 protected:
   NamePrefixList& m_namePrefixList;
diff --git a/src/update/prefix-update-processor.cpp b/src/update/prefix-update-processor.cpp
index d8302d4..c36b408 100644
--- a/src/update/prefix-update-processor.cpp
+++ b/src/update/prefix-update-processor.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.
  *
@@ -20,6 +20,7 @@
  */
 
 #include "prefix-update-processor.hpp"
+#include "logger.hpp"
 #include "lsdb.hpp"
 #include "nlsr.hpp"
 
@@ -41,12 +42,12 @@
 
 /** \brief obtain signer from SignerTag attached to Interest, if available
  */
-static ndn::optional<std::string>
+static std::optional<std::string>
 getSignerFromTag(const ndn::Interest& interest)
 {
   auto signerTag = interest.getTag<SignerTag>();
   if (signerTag == nullptr) {
-    return ndn::nullopt;
+    return std::nullopt;
   }
   else {
     return signerTag->get().toUri();
@@ -180,13 +181,13 @@
   return true;
 }
 
-ndn::optional<bool>
+std::optional<bool>
 PrefixUpdateProcessor::afterAdvertise(const ndn::Name& prefix)
 {
   return addOrDeletePrefix(prefix, true);
 }
 
-ndn::optional<bool>
+std::optional<bool>
 PrefixUpdateProcessor::afterWithdraw(const ndn::Name& prefix)
 {
   return addOrDeletePrefix(prefix, false);
diff --git a/src/update/prefix-update-processor.hpp b/src/update/prefix-update-processor.hpp
index 80f6564..1864d0f 100644
--- a/src/update/prefix-update-processor.hpp
+++ b/src/update/prefix-update-processor.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.
  *
@@ -32,7 +32,7 @@
 namespace nlsr {
 namespace update {
 
-typedef boost::property_tree::ptree ConfigSection;
+using ConfigSection = boost::property_tree::ptree;
 
 class PrefixUpdateProcessor : public CommandManagerBase
 {
@@ -62,11 +62,11 @@
   bool
   addOrDeletePrefix(const ndn::Name& prefix, bool addPrefix);
 
-  ndn::optional<bool>
-  afterAdvertise(const ndn::Name& prefix);
+  std::optional<bool>
+  afterAdvertise(const ndn::Name& prefix) override;
 
-  ndn::optional<bool>
-  afterWithdraw(const ndn::Name& prefix);
+  std::optional<bool>
+  afterWithdraw(const ndn::Name& prefix) override;
 
   /*! \brief Check if a prefix exists in the nlsr configuration file */
   bool
diff --git a/src/utility/name-helper.hpp b/src/utility/name-helper.hpp
index 5fec4fc..4c2c7c0 100644
--- a/src/utility/name-helper.hpp
+++ b/src/utility/name-helper.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).
@@ -25,8 +25,7 @@
 
 #include "common.hpp"
 
-namespace nlsr {
-namespace util {
+namespace nlsr::util {
 
 /*!
    \brief search a name component in ndn::Name and return the position of the component
@@ -42,13 +41,12 @@
   size_t nameSize = name.size();
   for (uint32_t i = 0; i < nameSize; i++) {
     if (component == name[i]) {
-      return (int32_t)i;
+      return static_cast<int32_t>(i);
     }
   }
   return -1;
 }
 
-} // namespace util
-} // namespace nlsr
+} // namespace nlsr::util
 
 #endif // NLSR_NAME_HELPER_HPP
