diff --git a/src/adjacency-list.cpp b/src/adjacency-list.cpp
index 302d9b9..cb192eb 100644
--- a/src/adjacency-list.cpp
+++ b/src/adjacency-list.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-2023,  The University of Memphis,
  *                           Regents of the University of California,
  *                           Arizona Board of Regents.
  *
@@ -43,9 +43,9 @@
 AdjacencyList::getAdjacent(const ndn::Name& adjName)
 {
   Adjacent adj(adjName);
-  std::list<Adjacent>::iterator it = find(adjName);
+  auto it = find(adjName);
   if (it != m_adjList.end()) {
-    return (*it);
+    return *it;
   }
   return adj;
 }
@@ -60,56 +60,47 @@
 
   std::set<Adjacent> ourSet(m_adjList.cbegin(), m_adjList.cend());
   std::set<Adjacent> theirSet(theirList.cbegin(), theirList.cend());
-
   return ourSet == theirSet;
 }
 
 bool
 AdjacencyList::isNeighbor(const ndn::Name& adjName) const
 {
-  std::list<Adjacent>::const_iterator it = find(adjName);
-  if (it == m_adjList.end())
-  {
-    return false;
-  }
-  return true;
+  return find(adjName) != m_adjList.end();
 }
 
 void
 AdjacencyList::incrementTimedOutInterestCount(const ndn::Name& neighbor)
 {
-  std::list<Adjacent>::iterator it = find(neighbor);
-  if (it == m_adjList.end()) {
-    return ;
+  auto it = find(neighbor);
+  if (it != m_adjList.end()) {
+    it->setInterestTimedOutNo(it->getInterestTimedOutNo() + 1);
   }
-  (*it).setInterestTimedOutNo((*it).getInterestTimedOutNo() + 1);
 }
 
 void
-AdjacencyList::setTimedOutInterestCount(const ndn::Name& neighbor,
-                                        uint32_t count)
+AdjacencyList::setTimedOutInterestCount(const ndn::Name& neighbor, uint32_t count)
 {
-  std::list<Adjacent>::iterator it = find(neighbor);
+  auto it = find(neighbor);
   if (it != m_adjList.end()) {
-    (*it).setInterestTimedOutNo(count);
+    it->setInterestTimedOutNo(count);
   }
 }
 
 int32_t
 AdjacencyList::getTimedOutInterestCount(const ndn::Name& neighbor) const
 {
-  std::list<Adjacent>::const_iterator it = find(neighbor);
+  auto it = find(neighbor);
   if (it == m_adjList.end()) {
     return -1;
   }
-  return (*it).getInterestTimedOutNo();
+  return it->getInterestTimedOutNo();
 }
 
 Adjacent::Status
 AdjacencyList::getStatusOfNeighbor(const ndn::Name& neighbor) const
 {
-  std::list<Adjacent>::const_iterator it = find(neighbor);
-
+  auto it = find(neighbor);
   if (it == m_adjList.end()) {
     return Adjacent::STATUS_UNKNOWN;
   }
@@ -121,7 +112,7 @@
 void
 AdjacencyList::setStatusOfNeighbor(const ndn::Name& neighbor, Adjacent::Status status)
 {
-  std::list<Adjacent>::iterator it = find(neighbor);
+  auto it = find(neighbor);
   if (it != m_adjList.end()) {
     it->setStatus(status);
   }
@@ -144,8 +135,7 @@
 {
   uint32_t nTimedOutNeighbors = 0;
 
-  for (const Adjacent& adjacency : m_adjList) {
-
+  for (const auto& adjacency : m_adjList) {
     if (adjacency.getStatus() == Adjacent::STATUS_ACTIVE) {
       return true;
     }
@@ -154,12 +144,7 @@
     }
   }
 
-  if (nTimedOutNeighbors == m_adjList.size()) {
-    return true;
-  }
-  else {
-    return false;
-  }
+  return nTimedOutNeighbors == m_adjList.size();
 }
 
 int32_t
@@ -177,54 +162,43 @@
 std::list<Adjacent>::iterator
 AdjacencyList::find(const ndn::Name& adjName)
 {
-  return std::find_if(m_adjList.begin(),
-                      m_adjList.end(),
+  return std::find_if(m_adjList.begin(), m_adjList.end(),
                       std::bind(&Adjacent::compare, _1, std::cref(adjName)));
 }
 
 std::list<Adjacent>::const_iterator
 AdjacencyList::find(const ndn::Name& adjName) const
 {
-  return std::find_if(m_adjList.cbegin(),
-                      m_adjList.cend(),
+  return std::find_if(m_adjList.cbegin(), m_adjList.cend(),
                       std::bind(&Adjacent::compare, _1, std::cref(adjName)));
 }
 
 AdjacencyList::iterator
 AdjacencyList::findAdjacent(const ndn::Name& adjName)
 {
-  return std::find_if(m_adjList.begin(),
-                      m_adjList.end(),
-                      std::bind(&Adjacent::compare,
-                                _1, std::cref(adjName)));
+  return std::find_if(m_adjList.begin(), m_adjList.end(),
+                      std::bind(&Adjacent::compare, _1, std::cref(adjName)));
 }
 
 AdjacencyList::iterator
 AdjacencyList::findAdjacent(uint64_t faceId)
 {
-  return std::find_if(m_adjList.begin(),
-                      m_adjList.end(),
-                      std::bind(&Adjacent::compareFaceId,
-                                _1, faceId));
+  return std::find_if(m_adjList.begin(), m_adjList.end(),
+                      std::bind(&Adjacent::compareFaceId, _1, faceId));
 }
 
 AdjacencyList::iterator
 AdjacencyList::findAdjacent(const ndn::FaceUri& faceUri)
 {
-  return std::find_if(m_adjList.begin(),
-                      m_adjList.end(),
-                      std::bind(&Adjacent::compareFaceUri,
-                                _1, faceUri));
+  return std::find_if(m_adjList.begin(), m_adjList.end(),
+                      std::bind(&Adjacent::compareFaceUri, _1, faceUri));
 }
 
 uint64_t
 AdjacencyList::getFaceId(const ndn::FaceUri& faceUri)
 {
-  std::list<Adjacent>::iterator it = std::find_if(m_adjList.begin(),
-                                                  m_adjList.end(),
-                                                  std::bind(&Adjacent::compareFaceUri,
-                                                            _1, faceUri));
-
+  auto it = std::find_if(m_adjList.begin(), m_adjList.end(),
+                         std::bind(&Adjacent::compareFaceUri, _1, faceUri));
   return it != m_adjList.end() ? it->getFaceId() : 0;
 }
 
diff --git a/src/hello-protocol.cpp b/src/hello-protocol.cpp
index ec03da7..49722fe 100644
--- a/src/hello-protocol.cpp
+++ b/src/hello-protocol.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2022,  The University of Memphis,
+ * Copyright (c) 2014-2023,  The University of Memphis,
  *                           Regents of the University of California
  *
  * This file is part of NLSR (Named-data Link State Routing).
@@ -34,7 +34,7 @@
                              ConfParameter& confParam, RoutingTable& routingTable,
                              Lsdb& lsdb)
   : m_face(face)
-  , m_scheduler(m_face.getIoService())
+  , m_scheduler(m_face.getIoContext())
   , m_keyChain(keyChain)
   , m_signingInfo(confParam.getSigningInfo())
   , m_confParam(confParam)
@@ -72,8 +72,7 @@
   interest.setCanBePrefix(true);
   m_face.expressInterest(interest,
     std::bind(&HelloProtocol::onContent, this, _1, _2),
-    [this, seconds] (const ndn::Interest& interest, const ndn::lp::Nack& nack)
-    {
+    [this, seconds] (const auto& interest, const auto& nack) {
       NDN_LOG_TRACE("Received Nack with reason: " << nack.getReason());
       NDN_LOG_TRACE("Will treat as timeout in " << 2 * seconds << " seconds");
       m_scheduler.schedule(ndn::time::seconds(2 * seconds),
@@ -89,7 +88,6 @@
 HelloProtocol::sendHelloInterest(const ndn::Name& neighbor)
 {
   auto adjacent = m_adjacencyList.findAdjacent(neighbor);
-
   if (adjacent == m_adjacencyList.end()) {
     return;
   }
@@ -119,10 +117,10 @@
   // increment RCV_HELLO_INTEREST
   hpIncrementSignal(Statistics::PacketType::RCV_HELLO_INTEREST);
 
-  NLSR_LOG_DEBUG("Interest Received for Name: " << interestName);
+  NLSR_LOG_DEBUG("Interest received for Name: " << interestName);
   if (interestName.get(-2).toUri() != INFO_COMPONENT) {
-    NLSR_LOG_DEBUG("INFO_COMPONENT not found or interestName: " << interestName
-               << " does not match expression");
+    NLSR_LOG_DEBUG("INFO_COMPONENT not found or Interest Name " << interestName
+                   << " does not match expression");
     return;
   }
 
@@ -130,9 +128,9 @@
   neighbor.wireDecode(interestName.get(-1).blockFromValue());
   NLSR_LOG_DEBUG("Neighbor: " << neighbor);
   if (m_adjacencyList.isNeighbor(neighbor)) {
-    std::shared_ptr<ndn::Data> data = std::make_shared<ndn::Data>();
+    auto data = std::make_shared<ndn::Data>();
     data->setName(ndn::Name(interest.getName()).appendVersion());
-    data->setFreshnessPeriod(ndn::time::seconds(10)); // 10 sec
+    data->setFreshnessPeriod(10_s);
     data->setContent(ndn::make_span(reinterpret_cast<const uint8_t*>(INFO_COMPONENT.data()),
                                     INFO_COMPONENT.size()));
 
@@ -233,8 +231,8 @@
     m_adjacencyList.setTimedOutInterestCount(neighbor, 0);
     Adjacent::Status newStatus = m_adjacencyList.getStatusOfNeighbor(neighbor);
 
-    NLSR_LOG_DEBUG("Neighbor : " << neighbor);
-    NLSR_LOG_DEBUG("Old Status: " << oldStatus << " New Status: " << newStatus);
+    NLSR_LOG_DEBUG("Neighbor: " << neighbor);
+    NLSR_LOG_DEBUG("Old Status: " << oldStatus << ", New Status: " << newStatus);
     // change in Adjacency list
     if ((oldStatus - newStatus) != 0) {
       if (m_confParam.getHyperbolicState() == HYPERBOLIC_STATE_ON) {
@@ -254,7 +252,7 @@
 HelloProtocol::onContentValidationFailed(const ndn::Data& data,
                                          const ndn::security::ValidationError& ve)
 {
-  NLSR_LOG_DEBUG("Validation Error: " << ve);
+  NLSR_LOG_DEBUG("Validation error: " << ve);
 }
 
 } // namespace nlsr
diff --git a/src/lsdb.cpp b/src/lsdb.cpp
index 876fa57..f672a41 100644
--- a/src/lsdb.cpp
+++ b/src/lsdb.cpp
@@ -33,7 +33,7 @@
 
 Lsdb::Lsdb(ndn::Face& face, ndn::KeyChain& keyChain, ConfParameter& confParam)
   : m_face(face)
-  , m_scheduler(face.getIoService())
+  , m_scheduler(face.getIoContext())
   , m_confParam(confParam)
   , m_sync(m_face, keyChain,
            [this] (const auto& routerName, const Lsa::Type& lsaType,
@@ -203,7 +203,7 @@
   }
   // else the interest is for other router's LSA, serve signed data from LsaSegmentStorage
   else if (auto lsaSegment = m_lsaStorage.find(interest); lsaSegment) {
-    NLSR_LOG_TRACE("Found data in lsa storage. Sending data for " << interest.getName());
+    NLSR_LOG_TRACE("Found data in LSA storage. Sending data for " << interest.getName());
     m_face.put(*lsaSegment);
   }
 }
@@ -256,19 +256,16 @@
 
   auto chkLsa = findLsa(lsa->getOriginRouter(), lsa->getType());
   if (chkLsa == nullptr) {
-    NLSR_LOG_DEBUG("Adding " << lsa->getType() << " LSA");
-    NLSR_LOG_DEBUG(lsa->toString());
+    NLSR_LOG_DEBUG("Adding LSA:\n" << lsa->toString());
 
     m_lsdb.emplace(lsa);
-
     onLsdbModified(lsa, LsdbUpdate::INSTALLED, {}, {});
 
     lsa->setExpiringEventId(scheduleLsaExpiration(lsa, timeToExpire));
   }
   // Else this is a known name LSA, so we are updating it.
   else if (chkLsa->getSeqNo() < lsa->getSeqNo()) {
-    NLSR_LOG_DEBUG("Updating " << lsa->getType() << " LSA:");
-    NLSR_LOG_DEBUG(chkLsa->toString());
+    NLSR_LOG_DEBUG("Updating LSA:\n" << chkLsa->toString());
     chkLsa->setSeqNo(lsa->getSeqNo());
     chkLsa->setExpirationTimePoint(lsa->getExpirationTimePoint());
 
@@ -278,8 +275,7 @@
     }
 
     chkLsa->setExpiringEventId(scheduleLsaExpiration(chkLsa, timeToExpire));
-    NLSR_LOG_DEBUG("Updated " << lsa->getType() << " LSA:");
-    NLSR_LOG_DEBUG(chkLsa->toString());
+    NLSR_LOG_DEBUG("Updated LSA:\n" << chkLsa->toString());
   }
 }
 
@@ -288,8 +284,7 @@
 {
   if (lsaIt != m_lsdb.end()) {
     auto lsaPtr = *lsaIt;
-    NLSR_LOG_DEBUG("Removing " << lsaPtr->getType() << " LSA:");
-    NLSR_LOG_DEBUG(lsaPtr->toString());
+    NLSR_LOG_DEBUG("Removing LSA:\n" << lsaPtr->toString());
     m_lsdb.erase(lsaIt);
     onLsdbModified(lsaPtr, LsdbUpdate::REMOVED, {}, {});
   }
@@ -385,13 +380,11 @@
     if (lsaPtr->getSeqNo() == lsa->getSeqNo()) {
       if (lsaPtr->getOriginRouter() == m_thisRouterPrefix) {
         NLSR_LOG_DEBUG("Own " << lsaPtr->getType() << " LSA, so refreshing it");
-        NLSR_LOG_DEBUG("Current LSA:");
-        NLSR_LOG_DEBUG(lsaPtr->toString());
+        NLSR_LOG_DEBUG("Current LSA:\n" << lsaPtr->toString());
         lsaPtr->setSeqNo(lsaPtr->getSeqNo() + 1);
         m_sequencingManager.setLsaSeq(lsaPtr->getSeqNo(), lsaPtr->getType());
         lsaPtr->setExpirationTimePoint(getLsaExpirationTimePoint());
-        NLSR_LOG_DEBUG("Updated LSA:");
-        NLSR_LOG_DEBUG(lsaPtr->toString());
+        NLSR_LOG_DEBUG("Updated LSA:\n" << lsaPtr->toString());
         // schedule refreshing event again
         lsaPtr->setExpiringEventId(scheduleLsaExpiration(lsaPtr, m_lsaRefreshTime));
         m_sequencingManager.writeSeqNoToFile();
@@ -490,13 +483,12 @@
       // immediately since at the least the LSA Interest lifetime has elapsed.
       // Otherwise, it is necessary to delay the Interest re-expression to prevent
       // the potential for constant Interest flooding.
-      ndn::time::seconds delay = m_confParam.getLsaInterestLifetime();
-
+      auto delay = m_confParam.getLsaInterestLifetime();
       if (errorCode == ndn::SegmentFetcher::ErrorCode::INTEREST_TIMEOUT) {
-        delay = ndn::time::seconds(0);
+        delay = 0_s;
       }
-      m_scheduler.schedule(delay, std::bind(&Lsdb::expressInterest, this,
-                                            interestName, retransmitNo + 1, /*Multicast FaceID*/0, deadline));
+      m_scheduler.schedule(delay, std::bind(&Lsdb::expressInterest, this, interestName,
+                                            retransmitNo + 1, /*Multicast FaceID*/0, deadline));
     }
   }
 }
@@ -559,7 +551,7 @@
       }
     }
     catch (const std::exception& e) {
-      NLSR_LOG_TRACE("LSA data decoding error :( " << e.what());
+      NLSR_LOG_TRACE("LSA data decoding error: " << e.what());
     }
   }
 }
diff --git a/src/lsdb.hpp b/src/lsdb.hpp
index 2c9008d..1116e98 100644
--- a/src/lsdb.hpp
+++ b/src/lsdb.hpp
@@ -220,11 +220,11 @@
     \param seqNo The sequence number to check.
   */
   bool
-  isLsaNew(const ndn::Name& originRouter, const Lsa::Type& lsaType, uint64_t lsSeqNo) const
+  isLsaNew(const ndn::Name& originRouter, const Lsa::Type& lsaType, uint64_t seqNo) const
   {
     // Is the name in the LSDB and the supplied seq no is the highest so far
     auto lsaPtr = findLsa(originRouter, lsaType);
-    return lsaPtr ? lsaPtr->getSeqNo() < lsSeqNo : true;
+    return lsaPtr ? lsaPtr->getSeqNo() < seqNo : true;
   }
 
   void
diff --git a/src/nlsr.cpp b/src/nlsr.cpp
index 8c4033a..f135636 100644
--- a/src/nlsr.cpp
+++ b/src/nlsr.cpp
@@ -36,7 +36,7 @@
 
 Nlsr::Nlsr(ndn::Face& face, ndn::KeyChain& keyChain, ConfParameter& confParam)
   : m_face(face)
-  , m_scheduler(face.getIoService())
+  , m_scheduler(face.getIoContext())
   , m_confParam(confParam)
   , m_adjacencyList(confParam.getAdjacencyList())
   , m_namePrefixList(confParam.getNamePrefixList())
@@ -259,7 +259,7 @@
 Nlsr::initializeFaces(const FetchDatasetCallback& onFetchSuccess,
                       const FetchDatasetTimeoutCallback& onFetchFailure)
 {
-  NLSR_LOG_TRACE("Initializing Faces...");
+  NLSR_LOG_TRACE("Initializing faces");
   m_faceDatasetController.fetch<ndn::nfd::FaceDataset>(onFetchSuccess, onFetchFailure);
 }
 
@@ -317,14 +317,12 @@
                                 const std::string& msg,
                                 uint32_t nRetriesSoFar)
 {
-  NLSR_LOG_DEBUG("onFaceDatasetFetchTimeout");
   // If we have exceeded the maximum attempt count, do not try again.
   if (nRetriesSoFar++ < m_confParam.getFaceDatasetFetchTries()) {
     NLSR_LOG_DEBUG("Failed to fetch dataset: " << msg << ". Attempting retry #" << nRetriesSoFar);
-    m_faceDatasetController.fetch<ndn::nfd::FaceDataset>(std::bind(&Nlsr::processFaceDataset,
-                                                        this, _1),
-                                              std::bind(&Nlsr::onFaceDatasetFetchTimeout,
-                                                        this, _1, _2, nRetriesSoFar));
+    m_faceDatasetController.fetch<ndn::nfd::FaceDataset>(std::bind(&Nlsr::processFaceDataset, this, _1),
+                                                         std::bind(&Nlsr::onFaceDatasetFetchTimeout,
+                                                                   this, _1, _2, nRetriesSoFar));
   }
   else {
     NLSR_LOG_ERROR("Failed to fetch dataset: " << msg << ". Exceeded limit of " <<
@@ -339,17 +337,12 @@
 void
 Nlsr::scheduleDatasetFetch()
 {
-  NLSR_LOG_DEBUG("Scheduling Dataset Fetch in " << m_confParam.getFaceDatasetFetchInterval());
+  NLSR_LOG_DEBUG("Scheduling dataset fetch in " << m_confParam.getFaceDatasetFetchInterval());
 
-  m_scheduler.schedule(m_confParam.getFaceDatasetFetchInterval(),
-    [this] {
-      this->initializeFaces(
-        [this] (const std::vector<ndn::nfd::FaceStatus>& faces) {
-         this->processFaceDataset(faces);
-        },
-        [this] (uint32_t code, const std::string& msg) {
-         this->onFaceDatasetFetchTimeout(code, msg, 0);
-        });
+  m_scheduler.schedule(m_confParam.getFaceDatasetFetchInterval(), [this] {
+    initializeFaces(
+      [this] (const auto& faces) { processFaceDataset(faces); },
+      [this] (uint32_t code, const std::string& msg) { onFaceDatasetFetchTimeout(code, msg, 0); });
   });
 }
 
diff --git a/src/route/routing-table-calculator.cpp b/src/route/routing-table-calculator.cpp
index 54c8a47..474604a 100644
--- a/src/route/routing-table-calculator.cpp
+++ b/src/route/routing-table-calculator.cpp
@@ -435,7 +435,7 @@
 
   // Iterate over directly connected neighbors
   std::list<Adjacent> neighbors = adjacencies.getAdjList();
-  for (std::list<Adjacent>::iterator adj = neighbors.begin(); adj != neighbors.end(); ++adj) {
+  for (auto adj = neighbors.begin(); adj != neighbors.end(); ++adj) {
 
     // Don't calculate nexthops using an inactive router
     if (adj->getStatus() == Adjacent::STATUS_INACTIVE) {
