diff --git a/daemon/face/face-system.cpp b/daemon/face/face-system.cpp
index 5601057..79cb436 100644
--- a/daemon/face/face-system.cpp
+++ b/daemon/face/face-system.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2019,  Regents of the University of California,
+ * Copyright (c) 2014-2021,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -94,7 +94,9 @@
 void
 FaceSystem::setConfigFile(ConfigFile& configFile)
 {
-  configFile.addSectionHandler(CFGSEC_FACESYSTEM, bind(&FaceSystem::processConfig, this, _1, _2, _3));
+  configFile.addSectionHandler(CFGSEC_FACESYSTEM, [this] (auto&&... args) {
+    processConfig(std::forward<decltype(args)>(args)...);
+  });
 }
 
 void
diff --git a/daemon/face/generic-link-service.cpp b/daemon/face/generic-link-service.cpp
index 819a91a..5ed4ac2 100644
--- a/daemon/face/generic-link-service.cpp
+++ b/daemon/face/generic-link-service.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2020,  Regents of the University of California,
+ * Copyright (c) 2014-2021,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -45,11 +45,11 @@
   , m_reassembler(m_options.reassemblerOptions, this)
   , m_reliability(m_options.reliabilityOptions, this)
   , m_lastSeqNo(-2)
-  , m_nextMarkTime(time::steady_clock::TimePoint::max())
+  , m_nextMarkTime(time::steady_clock::time_point::max())
   , m_nMarkedSinceInMarkingState(0)
 {
-  m_reassembler.beforeTimeout.connect([this] (auto...) { ++this->nReassemblyTimeouts; });
-  m_reliability.onDroppedInterest.connect([this] (const auto& i) { this->notifyDroppedInterest(i); });
+  m_reassembler.beforeTimeout.connect([this] (auto&&...) { ++nReassemblyTimeouts; });
+  m_reliability.onDroppedInterest.connect([this] (const auto& i) { notifyDroppedInterest(i); });
   nReassembling.observe(&m_reassembler);
 }
 
@@ -105,7 +105,7 @@
 
   auto block = pkt.wireEncode();
   if (mtu != MTU_UNLIMITED && block.size() > static_cast<size_t>(mtu)) {
-    ++this->nOutOverMtu;
+    ++nOutOverMtu;
     NFD_LOG_FACE_WARN("attempted to send packet over MTU limit");
     return;
   }
@@ -207,7 +207,7 @@
     std::tie(isOk, frags) = m_fragmenter.fragmentPacket(pkt, mtu);
     if (!isOk) {
       // fragmentation failed (warning is logged by LpFragmenter)
-      ++this->nFragmentationErrors;
+      ++nFragmentationErrors;
       return;
     }
   }
@@ -261,7 +261,7 @@
   if (static_cast<size_t>(sendQueueLength) > m_options.defaultCongestionThreshold) {
     const auto now = time::steady_clock::now();
 
-    if (m_nextMarkTime == time::steady_clock::TimePoint::max()) {
+    if (m_nextMarkTime == time::steady_clock::time_point::max()) {
       m_nextMarkTime = now + m_options.baseCongestionMarkingInterval;
     }
     // Mark packet if sendQueue stays above target for one interval
@@ -279,10 +279,10 @@
       m_nextMarkTime += interval;
     }
   }
-  else if (m_nextMarkTime != time::steady_clock::TimePoint::max()) {
+  else if (m_nextMarkTime != time::steady_clock::time_point::max()) {
     // Congestion incident has ended, so reset
     NFD_LOG_FACE_DEBUG("Send queue length dropped below congestion threshold");
-    m_nextMarkTime = time::steady_clock::TimePoint::max();
+    m_nextMarkTime = time::steady_clock::time_point::max();
     m_nMarkedSinceInMarkingState = 0;
   }
 }
@@ -296,7 +296,7 @@
     if (m_options.reliabilityOptions.isEnabled) {
       if (!m_reliability.processIncomingPacket(pkt)) {
         NFD_LOG_FACE_TRACE("received duplicate fragment: DROP");
-        ++this->nDuplicateSequence;
+        ++nDuplicateSequence;
         return;
       }
     }
@@ -321,7 +321,7 @@
     }
   }
   catch (const tlv::Error& e) {
-    ++this->nInLpInvalid;
+    ++nInLpInvalid;
     NFD_LOG_FACE_WARN("packet parse error (" << e.what() << "): DROP");
   }
 }
@@ -344,13 +344,13 @@
         this->decodeData(netPkt, firstPkt, endpointId);
         break;
       default:
-        ++this->nInNetInvalid;
+        ++nInNetInvalid;
         NFD_LOG_FACE_WARN("unrecognized network-layer packet TLV-TYPE " << netPkt.type() << ": DROP");
         return;
     }
   }
   catch (const tlv::Error& e) {
-    ++this->nInNetInvalid;
+    ++nInNetInvalid;
     NFD_LOG_FACE_WARN("packet parse error (" << e.what() << "): DROP");
   }
 }
@@ -376,7 +376,7 @@
   }
 
   if (firstPkt.has<lp::CachePolicyField>()) {
-    ++this->nInNetInvalid;
+    ++nInNetInvalid;
     NFD_LOG_FACE_WARN("received CachePolicy with Interest: DROP");
     return;
   }
@@ -399,7 +399,7 @@
   }
 
   if (firstPkt.has<lp::PrefixAnnouncementField>()) {
-    ++this->nInNetInvalid;
+    ++nInNetInvalid;
     NFD_LOG_FACE_WARN("received PrefixAnnouncement with Interest: DROP");
     return;
   }
@@ -421,13 +421,13 @@
   auto data = make_shared<Data>(netPkt);
 
   if (firstPkt.has<lp::NackField>()) {
-    ++this->nInNetInvalid;
+    ++nInNetInvalid;
     NFD_LOG_FACE_WARN("received Nack with Data: DROP");
     return;
   }
 
   if (firstPkt.has<lp::NextHopFaceIdField>()) {
-    ++this->nInNetInvalid;
+    ++nInNetInvalid;
     NFD_LOG_FACE_WARN("received NextHopFaceId with Data: DROP");
     return;
   }
@@ -448,7 +448,7 @@
   }
 
   if (firstPkt.has<lp::NonDiscoveryField>()) {
-    ++this->nInNetInvalid;
+    ++nInNetInvalid;
     NFD_LOG_FACE_WARN("received NonDiscovery with Data: DROP");
     return;
   }
@@ -476,13 +476,13 @@
   nack.setHeader(firstPkt.get<lp::NackField>());
 
   if (firstPkt.has<lp::NextHopFaceIdField>()) {
-    ++this->nInNetInvalid;
+    ++nInNetInvalid;
     NFD_LOG_FACE_WARN("received NextHopFaceId with Nack: DROP");
     return;
   }
 
   if (firstPkt.has<lp::CachePolicyField>()) {
-    ++this->nInNetInvalid;
+    ++nInNetInvalid;
     NFD_LOG_FACE_WARN("received CachePolicy with Nack: DROP");
     return;
   }
@@ -496,13 +496,13 @@
   }
 
   if (firstPkt.has<lp::NonDiscoveryField>()) {
-    ++this->nInNetInvalid;
+    ++nInNetInvalid;
     NFD_LOG_FACE_WARN("received NonDiscovery with Nack: DROP");
     return;
   }
 
   if (firstPkt.has<lp::PrefixAnnouncementField>()) {
-    ++this->nInNetInvalid;
+    ++nInNetInvalid;
     NFD_LOG_FACE_WARN("received PrefixAnnouncement with Nack: DROP");
     return;
   }
diff --git a/daemon/face/network-predicate.cpp b/daemon/face/network-predicate.cpp
index 31a2cf8..07de63c 100644
--- a/daemon/face/network-predicate.cpp
+++ b/daemon/face/network-predicate.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2019,  Regents of the University of California,
+ * Copyright (c) 2014-2021,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -198,8 +198,10 @@
 bool
 NetworkInterfacePredicate::operator()(const ndn::net::NetworkInterface& netif) const
 {
-  return std::any_of(m_whitelist.begin(), m_whitelist.end(), bind(&doesNetifMatchRule, std::cref(netif), _1)) &&
-         std::none_of(m_blacklist.begin(), m_blacklist.end(), bind(&doesNetifMatchRule, std::cref(netif), _1));
+  return std::any_of(m_whitelist.begin(), m_whitelist.end(),
+                     [&netif] (const auto& rule) { return doesNetifMatchRule(netif, rule); }) &&
+         std::none_of(m_blacklist.begin(), m_blacklist.end(),
+                      [&netif] (const auto& rule) { return doesNetifMatchRule(netif, rule); });
 }
 
 static bool
@@ -219,8 +221,10 @@
 bool
 IpAddressPredicate::operator()(const boost::asio::ip::address& address) const
 {
-  return std::any_of(m_whitelist.begin(), m_whitelist.end(), bind(&doesAddressMatchRule, std::cref(address), _1)) &&
-         std::none_of(m_blacklist.begin(), m_blacklist.end(), bind(&doesAddressMatchRule, std::cref(address), _1));
+  return std::any_of(m_whitelist.begin(), m_whitelist.end(),
+                     [&address] (const auto& rule) { return doesAddressMatchRule(address, rule); }) &&
+         std::none_of(m_blacklist.begin(), m_blacklist.end(),
+                      [&address] (const auto& rule) { return doesAddressMatchRule(address, rule); });
 }
 
 } // namespace face
diff --git a/daemon/face/tcp-factory.cpp b/daemon/face/tcp-factory.cpp
index f45d786..89e34d5 100644
--- a/daemon/face/tcp-factory.cpp
+++ b/daemon/face/tcp-factory.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2019,  Regents of the University of California,
+ * Copyright (c) 2014-2021,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -200,8 +200,9 @@
   if (it != m_channels.end())
     return it->second;
 
-  auto channel = make_shared<TcpChannel>(endpoint, m_wantCongestionMarking,
-                                         bind(&TcpFactory::determineFaceScopeFromAddresses, this, _1, _2));
+  auto channel = make_shared<TcpChannel>(endpoint, m_wantCongestionMarking, [this] (auto&&... args) {
+    return determineFaceScopeFromAddresses(std::forward<decltype(args)>(args)...);
+  });
   m_channels[endpoint] = channel;
   return channel;
 }
diff --git a/daemon/face/udp-factory.cpp b/daemon/face/udp-factory.cpp
index 9eabd42..8f7f77c 100644
--- a/daemon/face/udp-factory.cpp
+++ b/daemon/face/udp-factory.cpp
@@ -434,7 +434,7 @@
     NFD_LOG_DEBUG("Not creating multicast faces on " << netif->getName() << ": no viable IP address");
     // keep an eye on new addresses
     m_netifConns[netif->getIndex()].addrAddConn =
-      netif->onAddressAdded.connect([=] (auto...) { this->applyMcastConfigToNetif(netif); });
+      netif->onAddressAdded.connect([=] (auto&&...) { this->applyMcastConfigToNetif(netif); });
     return {};
   }
 
diff --git a/daemon/face/websocket-channel.cpp b/daemon/face/websocket-channel.cpp
index 13f6f38..957c9ad 100644
--- a/daemon/face/websocket-channel.cpp
+++ b/daemon/face/websocket-channel.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2020,  Regents of the University of California,
+ * Copyright (c) 2014-2021,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -53,13 +53,13 @@
     }
     return websocketpp::lib::error_code{};
   });
-  m_server.set_open_handler(bind(&WebSocketChannel::handleOpen, this, _1));
-  m_server.set_close_handler(bind(&WebSocketChannel::handleClose, this, _1));
-  m_server.set_message_handler(bind(&WebSocketChannel::handleMessage, this, _1, _2));
+  m_server.set_open_handler(std::bind(&WebSocketChannel::handleOpen, this, _1));
+  m_server.set_close_handler(std::bind(&WebSocketChannel::handleClose, this, _1));
+  m_server.set_message_handler(std::bind(&WebSocketChannel::handleMessage, this, _1, _2));
 
   // Detect disconnections using ping-pong messages
-  m_server.set_pong_handler(bind(&WebSocketChannel::handlePong, this, _1));
-  m_server.set_pong_timeout_handler(bind(&WebSocketChannel::handlePongTimeout, this, _1));
+  m_server.set_pong_handler(std::bind(&WebSocketChannel::handlePong, this, _1));
+  m_server.set_pong_timeout_handler(std::bind(&WebSocketChannel::handlePongTimeout, this, _1));
 
   // Always set SO_REUSEADDR flag
   m_server.set_reuse_addr(true);
diff --git a/daemon/fw/algorithm.cpp b/daemon/fw/algorithm.cpp
index a5d692f..a4d864b 100644
--- a/daemon/fw/algorithm.cpp
+++ b/daemon/fw/algorithm.cpp
@@ -84,7 +84,7 @@
 bool
 hasPendingOutRecords(const pit::Entry& pitEntry)
 {
-  time::steady_clock::TimePoint now = time::steady_clock::now();
+  auto now = time::steady_clock::now();
   return std::any_of(pitEntry.out_begin(), pitEntry.out_end(),
                       [&now] (const pit::OutRecord& outRecord) {
                         return outRecord.getExpiry() >= now &&
@@ -92,7 +92,7 @@
                       });
 }
 
-time::steady_clock::TimePoint
+time::steady_clock::time_point
 getLastOutgoing(const pit::Entry& pitEntry)
 {
   pit::OutRecordCollection::const_iterator lastOutgoing = std::max_element(
@@ -111,7 +111,7 @@
                                          const shared_ptr<pit::Entry>& pitEntry)
 {
   auto found = nexthops.end();
-  auto earliestRenewed = time::steady_clock::TimePoint::max();
+  auto earliestRenewed = time::steady_clock::time_point::max();
 
   for (auto it = nexthops.begin(); it != nexthops.end(); ++it) {
     if (!isNextHopEligible(inFace, interest, *it, pitEntry))
@@ -132,7 +132,7 @@
                   const fib::NextHop& nexthop,
                   const shared_ptr<pit::Entry>& pitEntry,
                   bool wantUnused,
-                  time::steady_clock::TimePoint now)
+                  time::steady_clock::time_point now)
 {
   const Face& outFace = nexthop.getFace();
 
diff --git a/daemon/fw/forwarder.cpp b/daemon/fw/forwarder.cpp
index 3683734..d984f0c 100644
--- a/daemon/fw/forwarder.cpp
+++ b/daemon/fw/forwarder.cpp
@@ -40,7 +40,7 @@
 
 NFD_LOG_INIT(Forwarder);
 
-const std::string CFGSEC_FORWARDER = "forwarder";
+const std::string CFG_FORWARDER = "forwarder";
 
 static Name
 getDefaultStrategyName()
@@ -607,7 +607,9 @@
 void
 Forwarder::setConfigFile(ConfigFile& configFile)
 {
-  configFile.addSectionHandler(CFGSEC_FORWARDER, bind(&Forwarder::processConfig, this, _1, _2, _3));
+  configFile.addSectionHandler(CFG_FORWARDER, [this] (auto&&... args) {
+    processConfig(std::forward<decltype(args)>(args)...);
+  });
 }
 
 void
@@ -618,10 +620,10 @@
   for (const auto& pair : configSection) {
     const std::string& key = pair.first;
     if (key == "default_hop_limit") {
-      config.defaultHopLimit = ConfigFile::parseNumber<uint8_t>(pair, CFGSEC_FORWARDER);
+      config.defaultHopLimit = ConfigFile::parseNumber<uint8_t>(pair, CFG_FORWARDER);
     }
     else {
-      NDN_THROW(ConfigFile::Error("Unrecognized option " + CFGSEC_FORWARDER + "." + key));
+      NDN_THROW(ConfigFile::Error("Unrecognized option " + CFG_FORWARDER + "." + key));
     }
   }
 
diff --git a/daemon/fw/retx-suppression-fixed.cpp b/daemon/fw/retx-suppression-fixed.cpp
index dddd742..50ade91 100644
--- a/daemon/fw/retx-suppression-fixed.cpp
+++ b/daemon/fw/retx-suppression-fixed.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2018,  Regents of the University of California,
+ * Copyright (c) 2014-2021,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -44,9 +44,9 @@
     return RetxSuppressionResult::NEW;
   }
 
-  time::steady_clock::TimePoint lastOutgoing = getLastOutgoing(pitEntry);
-  time::steady_clock::TimePoint now = time::steady_clock::now();
-  time::steady_clock::Duration sinceLastOutgoing = now - lastOutgoing;
+  auto lastOutgoing = getLastOutgoing(pitEntry);
+  auto now = time::steady_clock::now();
+  auto sinceLastOutgoing = now - lastOutgoing;
   bool shouldSuppress = sinceLastOutgoing < m_minRetxInterval;
   return shouldSuppress ? RetxSuppressionResult::SUPPRESS : RetxSuppressionResult::FORWARD;
 }
diff --git a/daemon/fw/strategy.cpp b/daemon/fw/strategy.cpp
index 9cfb3be..8762e24 100644
--- a/daemon/fw/strategy.cpp
+++ b/daemon/fw/strategy.cpp
@@ -291,13 +291,13 @@
     return fibEntry;
   }
 
-  const DelegationList& fh = interest.getForwardingHint();
+  const auto& fh = interest.getForwardingHint();
   // Forwarding hint should have been stripped by incoming Interest pipeline when reaching producer region
   BOOST_ASSERT(!m_forwarder.getNetworkRegionTable().isInProducerRegion(fh));
 
   const fib::Entry* fibEntry = nullptr;
-  for (const Delegation& del : fh) {
-    fibEntry = &fib.findLongestPrefixMatch(del.name);
+  for (const auto& delegation : fh) {
+    fibEntry = &fib.findLongestPrefixMatch(delegation.name);
     if (fibEntry->hasNextHops()) {
       if (fibEntry->getPrefix().size() == 0) {
         // in consumer region, return the default route
@@ -305,7 +305,7 @@
       }
       else {
         // in default-free zone, use the first delegation that finds a FIB entry
-        NFD_LOG_TRACE("lookupFib delegation=" << del.name << " found=" << fibEntry->getPrefix());
+        NFD_LOG_TRACE("lookupFib delegation=" << delegation.name << " found=" << fibEntry->getPrefix());
       }
       return *fibEntry;
     }
diff --git a/daemon/main.cpp b/daemon/main.cpp
index 1b529fb..6d29646 100644
--- a/daemon/main.cpp
+++ b/daemon/main.cpp
@@ -82,15 +82,15 @@
   NfdRunner(const std::string& configFile)
     : m_nfd(configFile, m_nfdKeyChain)
     , m_configFile(configFile)
-    , m_terminationSignalSet(getGlobalIoService())
-    , m_reloadSignalSet(getGlobalIoService())
+    , m_terminateSignals(getGlobalIoService(), SIGINT, SIGTERM)
+    , m_reloadSignals(getGlobalIoService(), SIGHUP)
   {
-    m_terminationSignalSet.add(SIGINT);
-    m_terminationSignalSet.add(SIGTERM);
-    m_terminationSignalSet.async_wait(bind(&NfdRunner::terminate, this, _1, _2));
-
-    m_reloadSignalSet.add(SIGHUP);
-    m_reloadSignalSet.async_wait(bind(&NfdRunner::reload, this, _1, _2));
+    m_terminateSignals.async_wait([this] (auto&&... args) {
+      terminate(std::forward<decltype(args)>(args)...);
+    });
+    m_reloadSignals.async_wait([this] (auto&&... args) {
+      reload(std::forward<decltype(args)>(args)...);
+    });
   }
 
   void
@@ -210,7 +210,9 @@
     m_nfd.reloadConfigFile();
     systemdNotify("READY=1");
 
-    m_reloadSignalSet.async_wait(bind(&NfdRunner::reload, this, _1, _2));
+    m_reloadSignals.async_wait([this] (auto&&... args) {
+      reload(std::forward<decltype(args)>(args)...);
+    });
   }
 
 private:
@@ -218,8 +220,8 @@
   Nfd                     m_nfd;
   std::string             m_configFile;
 
-  boost::asio::signal_set m_terminationSignalSet;
-  boost::asio::signal_set m_reloadSignalSet;
+  boost::asio::signal_set m_terminateSignals;
+  boost::asio::signal_set m_reloadSignals;
 };
 
 static void
diff --git a/daemon/mgmt/command-authenticator.cpp b/daemon/mgmt/command-authenticator.cpp
index 2196889..7c3cb23 100644
--- a/daemon/mgmt/command-authenticator.cpp
+++ b/daemon/mgmt/command-authenticator.cpp
@@ -107,8 +107,9 @@
 void
 CommandAuthenticator::setConfigFile(ConfigFile& configFile)
 {
-  configFile.addSectionHandler("authorizations",
-    bind(&CommandAuthenticator::processConfig, this, _1, _2, _3));
+  configFile.addSectionHandler("authorizations", [this] (auto&&... args) {
+    processConfig(std::forward<decltype(args)>(args)...);
+  });
 }
 
 void
diff --git a/daemon/mgmt/cs-manager.cpp b/daemon/mgmt/cs-manager.cpp
index 50c3001..eaf2cda 100644
--- a/daemon/mgmt/cs-manager.cpp
+++ b/daemon/mgmt/cs-manager.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2019,  Regents of the University of California,
+ * Copyright (c) 2014-2021,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -40,11 +40,11 @@
   , m_fwCounters(fwCounters)
 {
   registerCommandHandler<ndn::nfd::CsConfigCommand>("config",
-    bind(&CsManager::changeConfig, this, _4, _5));
+    std::bind(&CsManager::changeConfig, this, _4, _5));
   registerCommandHandler<ndn::nfd::CsEraseCommand>("erase",
-    bind(&CsManager::erase, this, _4, _5));
+    std::bind(&CsManager::erase, this, _4, _5));
 
-  registerStatusDatasetHandler("info", bind(&CsManager::serveInfo, this, _1, _2, _3));
+  registerStatusDatasetHandler("info", std::bind(&CsManager::serveInfo, this, _1, _2, _3));
 }
 
 void
diff --git a/daemon/mgmt/face-manager.cpp b/daemon/mgmt/face-manager.cpp
index a6ff3df..1d38f43 100644
--- a/daemon/mgmt/face-manager.cpp
+++ b/daemon/mgmt/face-manager.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2020,  Regents of the University of California,
+ * Copyright (c) 2014-2021,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -47,14 +47,17 @@
   , m_faceTable(faceSystem.getFaceTable())
 {
   // register handlers for ControlCommand
-  registerCommandHandler<ndn::nfd::FaceCreateCommand>("create", bind(&FaceManager::createFace, this, _4, _5));
-  registerCommandHandler<ndn::nfd::FaceUpdateCommand>("update", bind(&FaceManager::updateFace, this, _3, _4, _5));
-  registerCommandHandler<ndn::nfd::FaceDestroyCommand>("destroy", bind(&FaceManager::destroyFace, this, _4, _5));
+  registerCommandHandler<ndn::nfd::FaceCreateCommand>("create",
+    std::bind(&FaceManager::createFace, this, _4, _5));
+  registerCommandHandler<ndn::nfd::FaceUpdateCommand>("update",
+    std::bind(&FaceManager::updateFace, this, _3, _4, _5));
+  registerCommandHandler<ndn::nfd::FaceDestroyCommand>("destroy",
+    std::bind(&FaceManager::destroyFace, this, _4, _5));
 
   // register handlers for StatusDataset
-  registerStatusDatasetHandler("list", bind(&FaceManager::listFaces, this, _3));
-  registerStatusDatasetHandler("channels", bind(&FaceManager::listChannels, this, _3));
-  registerStatusDatasetHandler("query", bind(&FaceManager::queryFaces, this, _2, _3));
+  registerStatusDatasetHandler("list", std::bind(&FaceManager::listFaces, this, _3));
+  registerStatusDatasetHandler("channels", std::bind(&FaceManager::listChannels, this, _3));
+  registerStatusDatasetHandler("query", std::bind(&FaceManager::queryFaces, this, _2, _3));
 
   // register notification stream
   m_postNotification = registerNotificationStream("events");
@@ -359,13 +362,13 @@
 }
 
 static ndn::nfd::FaceStatus
-makeFaceStatus(const Face& face, const time::steady_clock::TimePoint& now)
+makeFaceStatus(const Face& face, const time::steady_clock::time_point& now)
 {
   ndn::nfd::FaceStatus status;
   copyFaceProperties(face, status);
 
   auto expirationTime = face.getExpirationTime();
-  if (expirationTime != time::steady_clock::TimePoint::max()) {
+  if (expirationTime != time::steady_clock::time_point::max()) {
     status.setExpirationPeriod(std::max(0_ms,
                                         time::duration_cast<time::milliseconds>(expirationTime - now)));
   }
diff --git a/daemon/mgmt/fib-manager.cpp b/daemon/mgmt/fib-manager.cpp
index c048da5..f8a99d8 100644
--- a/daemon/mgmt/fib-manager.cpp
+++ b/daemon/mgmt/fib-manager.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2019,  Regents of the University of California,
+ * Copyright (c) 2014-2021,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -45,11 +45,11 @@
   , m_faceTable(faceTable)
 {
   registerCommandHandler<ndn::nfd::FibAddNextHopCommand>("add-nexthop",
-    bind(&FibManager::addNextHop, this, _2, _3, _4, _5));
+    std::bind(&FibManager::addNextHop, this, _2, _3, _4, _5));
   registerCommandHandler<ndn::nfd::FibRemoveNextHopCommand>("remove-nexthop",
-    bind(&FibManager::removeNextHop, this, _2, _3, _4, _5));
+    std::bind(&FibManager::removeNextHop, this, _2, _3, _4, _5));
 
-  registerStatusDatasetHandler("list", bind(&FibManager::listEntries, this, _1, _2, _3));
+  registerStatusDatasetHandler("list", std::bind(&FibManager::listEntries, this, _1, _2, _3));
 }
 
 void
diff --git a/daemon/mgmt/forwarder-status-manager.cpp b/daemon/mgmt/forwarder-status-manager.cpp
index 5d4cb4d..818d054 100644
--- a/daemon/mgmt/forwarder-status-manager.cpp
+++ b/daemon/mgmt/forwarder-status-manager.cpp
@@ -35,7 +35,7 @@
   , m_startTimestamp(time::system_clock::now())
 {
   m_dispatcher.addStatusDataset("status/general", ndn::mgmt::makeAcceptAllAuthorization(),
-                                bind(&ForwarderStatusManager::listGeneralStatus, this, _1, _2, _3));
+                                std::bind(&ForwarderStatusManager::listGeneralStatus, this, _1, _2, _3));
 }
 
 ndn::nfd::ForwarderStatus
diff --git a/daemon/mgmt/manager-base.cpp b/daemon/mgmt/manager-base.cpp
index 49f5b8b..a39bbd6 100644
--- a/daemon/mgmt/manager-base.cpp
+++ b/daemon/mgmt/manager-base.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2019,  Regents of the University of California,
+ * Copyright (c) 2014-2021,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -59,7 +59,8 @@
 }
 
 void
-ManagerBase::extractRequester(const Interest& interest, ndn::mgmt::AcceptContinuation accept)
+ManagerBase::extractRequester(const Interest& interest,
+                              const ndn::mgmt::AcceptContinuation& accept)
 {
   const Name& interestName = interest.getName();
 
@@ -103,7 +104,7 @@
                            const ControlCommandHandler& handler,
                            const Name& prefix, const Interest& interest,
                            const ndn::mgmt::ControlParameters& params,
-                           ndn::mgmt::CommandContinuation done)
+                           const ndn::mgmt::CommandContinuation& done)
 {
   BOOST_ASSERT(dynamic_cast<const ControlParameters*>(&params) != nullptr);
 
diff --git a/daemon/mgmt/manager-base.hpp b/daemon/mgmt/manager-base.hpp
index e061217..eeb55f5 100644
--- a/daemon/mgmt/manager-base.hpp
+++ b/daemon/mgmt/manager-base.hpp
@@ -97,10 +97,10 @@
    * This is called after the signature has been validated.
    *
    * @param interest a request for ControlCommand
-   * @param accept callback of successful validation, takes the requester string as a argument
+   * @param accept callback of successful validation, takes the requester string as argument
    */
-  void
-  extractRequester(const Interest& interest, ndn::mgmt::AcceptContinuation accept);
+  static void
+  extractRequester(const Interest& interest, const ndn::mgmt::AcceptContinuation& accept);
 
 NFD_PUBLIC_WITH_TESTS_ELSE_PRIVATE:
   /**
@@ -127,7 +127,7 @@
                 const ControlCommandHandler& handler,
                 const Name& prefix, const Interest& interest,
                 const ndn::mgmt::ControlParameters& params,
-                ndn::mgmt::CommandContinuation done);
+                const ndn::mgmt::CommandContinuation& done);
 
   /**
    * @brief Generates the relative prefix for a handler by appending the verb name to the module name.
@@ -148,7 +148,7 @@
 };
 
 template<typename Command>
-inline void
+void
 ManagerBase::registerCommandHandler(const std::string& verb,
                                     const ControlCommandHandler& handler)
 {
@@ -157,8 +157,8 @@
   m_dispatcher.addControlCommand<ControlParameters>(
     makeRelPrefix(verb),
     makeAuthorization(verb),
-    bind(&ManagerBase::validateParameters, std::cref(*command), _1),
-    bind(&ManagerBase::handleCommand, command, handler, _1, _2, _3, _4));
+    [=] (const auto& params) { return validateParameters(*command, params); },
+    [=] (auto&&... args) { handleCommand(command, handler, std::forward<decltype(args)>(args)...); });
 }
 
 } // namespace nfd
diff --git a/daemon/mgmt/rib-manager.cpp b/daemon/mgmt/rib-manager.cpp
index 68b061e..4e444bf 100644
--- a/daemon/mgmt/rib-manager.cpp
+++ b/daemon/mgmt/rib-manager.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2020,  Regents of the University of California,
+ * Copyright (c) 2014-2021,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -62,11 +62,11 @@
   , m_isLocalhopEnabled(false)
 {
   registerCommandHandler<ndn::nfd::RibRegisterCommand>("register",
-    bind(&RibManager::registerEntry, this, _2, _3, _4, _5));
+    std::bind(&RibManager::registerEntry, this, _2, _3, _4, _5));
   registerCommandHandler<ndn::nfd::RibUnregisterCommand>("unregister",
-    bind(&RibManager::unregisterEntry, this, _2, _3, _4, _5));
+    std::bind(&RibManager::unregisterEntry, this, _2, _3, _4, _5));
 
-  registerStatusDatasetHandler("list", bind(&RibManager::listEntries, this, _1, _2, _3));
+  registerStatusDatasetHandler("list", std::bind(&RibManager::listEntries, this, _1, _2, _3));
 }
 
 void
@@ -104,7 +104,7 @@
   }
 
   NFD_LOG_INFO("Start monitoring face create/destroy events");
-  m_faceMonitor.onNotification.connect(bind(&RibManager::onNotification, this, _1));
+  m_faceMonitor.onNotification.connect([this] (const auto& notif) { onNotification(notif); });
   m_faceMonitor.start();
 
   scheduleActiveFaceFetch(ACTIVE_FACE_FETCH_INTERVAL);
@@ -248,7 +248,7 @@
 }
 
 void
-RibManager::unregisterEntry(const Name& topPrefix, const Interest& interest,
+RibManager::unregisterEntry(const Name&, const Interest& interest,
                             ControlParameters parameters,
                             const ndn::mgmt::CommandContinuation& done)
 {
@@ -265,7 +265,7 @@
 }
 
 void
-RibManager::listEntries(const Name& topPrefix, const Interest& interest,
+RibManager::listEntries(const Name&, const Interest& interest,
                         ndn::mgmt::StatusDatasetContext& context)
 {
   auto now = time::steady_clock::now();
@@ -304,7 +304,7 @@
 }
 
 ndn::mgmt::Authorization
-RibManager::makeAuthorization(const std::string& verb)
+RibManager::makeAuthorization(const std::string&)
 {
   return [this] (const Name& prefix, const Interest& interest,
                  const ndn::mgmt::ControlParameters* params,
@@ -316,8 +316,8 @@
 
     auto& validator = prefix == LOCALHOST_TOP_PREFIX ? m_localhostValidator : m_localhopValidator;
     validator.validate(interest,
-                       bind([&interest, this, accept] { extractRequester(interest, accept); }),
-                       bind([reject] { reject(ndn::mgmt::RejectReply::STATUS403); }));
+                       [&interest, accept] (auto&&...) { extractRequester(interest, accept); },
+                       [reject] (auto&&...) { reject(ndn::mgmt::RejectReply::STATUS403); });
   };
 }
 
@@ -429,8 +429,8 @@
   NFD_LOG_DEBUG("Fetching active faces");
 
   m_nfdController.fetch<ndn::nfd::FaceDataset>(
-    bind(&RibManager::removeInvalidFaces, this, _1),
-    bind(&RibManager::onFetchActiveFacesFailure, this, _1, _2),
+    std::bind(&RibManager::removeInvalidFaces, this, _1),
+    std::bind(&RibManager::onFetchActiveFacesFailure, this, _1, _2),
     ndn::nfd::CommandOptions());
 }
 
diff --git a/daemon/mgmt/strategy-choice-manager.cpp b/daemon/mgmt/strategy-choice-manager.cpp
index 169ce2e..9be09d2 100644
--- a/daemon/mgmt/strategy-choice-manager.cpp
+++ b/daemon/mgmt/strategy-choice-manager.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2019,  Regents of the University of California,
+ * Copyright (c) 2014-2021,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -41,12 +41,12 @@
   , m_table(strategyChoice)
 {
   registerCommandHandler<ndn::nfd::StrategyChoiceSetCommand>("set",
-    bind(&StrategyChoiceManager::setStrategy, this, _4, _5));
+    std::bind(&StrategyChoiceManager::setStrategy, this, _4, _5));
   registerCommandHandler<ndn::nfd::StrategyChoiceUnsetCommand>("unset",
-    bind(&StrategyChoiceManager::unsetStrategy, this, _4, _5));
+    std::bind(&StrategyChoiceManager::unsetStrategy, this, _4, _5));
 
   registerStatusDatasetHandler("list",
-    bind(&StrategyChoiceManager::listChoices, this, _3));
+    std::bind(&StrategyChoiceManager::listChoices, this, _3));
 }
 
 void
diff --git a/daemon/mgmt/tables-config-section.cpp b/daemon/mgmt/tables-config-section.cpp
index e5383a4..f6adced 100644
--- a/daemon/mgmt/tables-config-section.cpp
+++ b/daemon/mgmt/tables-config-section.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2019,  Regents of the University of California,
+ * Copyright (c) 2014-2021,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -28,7 +28,7 @@
 
 namespace nfd {
 
-const size_t TablesConfigSection::DEFAULT_CS_MAX_PACKETS = 65536;
+const size_t DEFAULT_CS_MAX_PACKETS = 65536;
 
 TablesConfigSection::TablesConfigSection(Forwarder& forwarder)
   : m_forwarder(forwarder)
@@ -39,8 +39,9 @@
 void
 TablesConfigSection::setConfigFile(ConfigFile& configFile)
 {
-  configFile.addSectionHandler("tables",
-                               bind(&TablesConfigSection::processConfig, this, _1, _2));
+  configFile.addSectionHandler("tables", [this] (auto&&... args) {
+    processConfig(std::forward<decltype(args)>(args)...);
+  });
 }
 
 void
@@ -58,7 +59,7 @@
 }
 
 void
-TablesConfigSection::processConfig(const ConfigSection& section, bool isDryRun)
+TablesConfigSection::processConfig(const ConfigSection& section, bool isDryRun, const std::string&)
 {
   size_t nCsMaxPackets = DEFAULT_CS_MAX_PACKETS;
   OptionalConfigSection csMaxPacketsNode = section.get_child_optional("cs_max_packets");
diff --git a/daemon/mgmt/tables-config-section.hpp b/daemon/mgmt/tables-config-section.hpp
index c2cfec5..f551b78 100644
--- a/daemon/mgmt/tables-config-section.hpp
+++ b/daemon/mgmt/tables-config-section.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2019,  Regents of the University of California,
+ * Copyright (c) 2014-2021,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -83,7 +83,7 @@
 
 private:
   void
-  processConfig(const ConfigSection& section, bool isDryRun);
+  processConfig(const ConfigSection& section, bool isDryRun, const std::string& filename);
 
   void
   processStrategyChoiceSection(const ConfigSection& section, bool isDryRun);
@@ -92,10 +92,7 @@
   processNetworkRegionSection(const ConfigSection& section, bool isDryRun);
 
 private:
-  static const size_t DEFAULT_CS_MAX_PACKETS;
-
   Forwarder& m_forwarder;
-
   bool m_isConfigured;
 };
 
diff --git a/daemon/rib/fib-updater.cpp b/daemon/rib/fib-updater.cpp
index 6e600e4..5208e61 100644
--- a/daemon/rib/fib-updater.cpp
+++ b/daemon/rib/fib-updater.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2019,  Regents of the University of California,
+ * Copyright (c) 2014-2021,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -95,13 +95,13 @@
   const Name& prefix = update.getName();
   const Route& route = update.getRoute();
 
-  Rib::const_iterator it = m_rib.find(prefix);
+  auto it = m_rib.find(prefix);
 
   // Name prefix exists
   if (it != m_rib.end()) {
     shared_ptr<const RibEntry> entry(it->second);
 
-    RibEntry::const_iterator existingRoute = entry->findRoute(route);
+    auto existingRoute = entry->findRoute(route);
 
     // Route will be new
     if (existingRoute == entry->end()) {
@@ -114,8 +114,7 @@
       // Route already exists
       RibEntry entryCopy = *entry;
 
-      Route& routeToUpdate = *(entryCopy.findRoute(route));
-
+      Route& routeToUpdate = *entryCopy.findRoute(route);
       routeToUpdate.flags = route.flags;
       routeToUpdate.cost = route.cost;
       routeToUpdate.expires = route.expires;
@@ -149,16 +148,14 @@
   const Name& prefix = update.getName();
   const Route& route = update.getRoute();
 
-  Rib::const_iterator ribIt = m_rib.find(prefix);
+  auto ribIt = m_rib.find(prefix);
 
   // Name prefix exists
   if (ribIt != m_rib.end()) {
     shared_ptr<const RibEntry> entry(ribIt->second);
-
     const bool hadCapture = entry->hasCapture();
 
-    RibEntry::const_iterator existing = entry->findRoute(route);
-
+    auto existing = entry->findRoute(route);
     if (existing != entry->end()) {
       RibEntry temp = *entry;
 
@@ -240,8 +237,8 @@
       .setName(update.name)
       .setFaceId(update.faceId)
       .setCost(update.cost),
-    bind(&FibUpdater::onUpdateSuccess, this, update, onSuccess, onFailure),
-    bind(&FibUpdater::onUpdateError, this, update, onSuccess, onFailure, _1, nTimeouts));
+    [=] (const auto&) { onUpdateSuccess(update, onSuccess, onFailure); },
+    [=] (const auto& resp) { onUpdateError(update, onSuccess, onFailure, resp, nTimeouts); });
 }
 
 void
@@ -254,12 +251,12 @@
     ControlParameters()
       .setName(update.name)
       .setFaceId(update.faceId),
-    bind(&FibUpdater::onUpdateSuccess, this, update, onSuccess, onFailure),
-    bind(&FibUpdater::onUpdateError, this, update, onSuccess, onFailure, _1, nTimeouts));
+    [=] (const auto&) { onUpdateSuccess(update, onSuccess, onFailure); },
+    [=] (const auto& resp) { onUpdateError(update, onSuccess, onFailure, resp, nTimeouts); });
 }
 
 void
-FibUpdater::onUpdateSuccess(const FibUpdate update,
+FibUpdater::onUpdateSuccess(const FibUpdate& update,
                             const FibUpdateSuccessCallback& onSuccess,
                             const FibUpdateFailureCallback& onFailure)
 {
@@ -280,7 +277,7 @@
 }
 
 void
-FibUpdater::onUpdateError(const FibUpdate update,
+FibUpdater::onUpdateError(const FibUpdate& update,
                           const FibUpdateSuccessCallback& onSuccess,
                           const FibUpdateFailureCallback& onFailure,
                           const ndn::nfd::ControlResponse& response, uint32_t nTimeouts)
@@ -310,14 +307,13 @@
 }
 
 void
-FibUpdater::addFibUpdate(FibUpdate update)
+FibUpdater::addFibUpdate(const FibUpdate& update)
 {
   FibUpdateList& updates = (update.faceId == m_batchFaceId) ? m_updatesForBatchFaceId :
                                                               m_updatesForNonBatchFaceId;
 
-  // If an update with the same name and route already exists,
-  // replace it
-  FibUpdateList::iterator it = std::find_if(updates.begin(), updates.end(),
+  // If an update with the same name and route already exists, replace it
+  auto it = std::find_if(updates.begin(), updates.end(),
     [&update] (const FibUpdate& other) {
       return update.name == other.name && update.faceId == other.faceId;
     });
@@ -400,7 +396,7 @@
 
     // If there is an ancestor route which is the same as the new route, replace it
     // with the new route
-    Rib::RouteSet::iterator it = ancestorRoutes.find(route);
+    auto it = ancestorRoutes.find(route);
 
     // There is a route that needs to be overwritten, erase and then replace
     if (it != ancestorRoutes.end()) {
@@ -525,7 +521,7 @@
     else {
       // Look for an ancestor that was blocked previously
       const Rib::RouteSet ancestorRoutes = m_rib.getAncestorRoutes(entry);
-      Rib::RouteSet::iterator it = ancestorRoutes.find(route);
+      auto it = ancestorRoutes.find(route);
 
       // If an ancestor is found, add it to children
       if (it != ancestorRoutes.end()) {
@@ -616,7 +612,7 @@
   if (!entry.hasCapture() && entry.getNRoutes() != 0) {
     // If there is an ancestor route which is the same as the erased route, add that route
     // to the current entry
-    Rib::RouteSet::iterator it = ancestorRoutes.find(route);
+    auto it = ancestorRoutes.find(route);
 
     if (it != ancestorRoutes.end()) {
       addInheritedRoute(entry.getName(), *it);
diff --git a/daemon/rib/fib-updater.hpp b/daemon/rib/fib-updater.hpp
index 52f3d74..d43f50a 100644
--- a/daemon/rib/fib-updater.hpp
+++ b/daemon/rib/fib-updater.hpp
@@ -149,7 +149,7 @@
   *   the FIB update process is considered a success.
   */
   void
-  onUpdateSuccess(const FibUpdate update,
+  onUpdateSuccess(const FibUpdate& update,
                   const FibUpdateSuccessCallback& onSuccess,
                   const FibUpdateFailureCallback& onFailure);
 
@@ -169,7 +169,7 @@
   *   Otherwise, a non-recoverable error has occurred and an exception is thrown.
   */
   void
-  onUpdateError(const FibUpdate update,
+  onUpdateError(const FibUpdate& update,
                 const FibUpdateSuccessCallback& onSuccess,
                 const FibUpdateFailureCallback& onFailure,
                 const ndn::nfd::ControlResponse& response, uint32_t nTimeouts);
@@ -183,7 +183,7 @@
   *   Otherwise, the update is added to m_updatesForBatchNonFaceId.
   */
   void
-  addFibUpdate(const FibUpdate update);
+  addFibUpdate(const FibUpdate& update);
 
   /** \brief creates records of the passed routes added to the entry and creates FIB updates
   */
diff --git a/daemon/rib/readvertise/nfd-rib-readvertise-destination.cpp b/daemon/rib/readvertise/nfd-rib-readvertise-destination.cpp
index a76aaed..0592040 100644
--- a/daemon/rib/readvertise/nfd-rib-readvertise-destination.cpp
+++ b/daemon/rib/readvertise/nfd-rib-readvertise-destination.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2019,  Regents of the University of California,
+ * Copyright (c) 2014-2021,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -44,10 +44,17 @@
   , m_commandOptions(options)
   , m_controlParameters(parameters)
 {
-  m_ribInsertConn = rib.afterInsertEntry.connect(
-    std::bind(&NfdRibReadvertiseDestination::handleRibInsert, this, _1));
-  m_ribEraseConn = rib.afterEraseEntry.connect(
-    std::bind(&NfdRibReadvertiseDestination::handleRibErase, this, _1));
+  m_ribInsertConn = rib.afterInsertEntry.connect([this] (const Name& name) {
+    if (name.isPrefixOf(m_commandOptions.getPrefix())) {
+      setAvailability(true);
+    }
+  });
+
+  m_ribEraseConn = rib.afterEraseEntry.connect([this] (const Name& name) {
+    if (name.isPrefixOf(m_commandOptions.getPrefix())) {
+      setAvailability(false);
+    }
+  });
 }
 
 void
@@ -59,7 +66,7 @@
 
   m_controller.start<ndn::nfd::RibRegisterCommand>(
     getControlParameters().setName(rr.prefix),
-    [=] (const ControlParameters& cp) { successCb(); },
+    [=] (const ControlParameters&) { successCb(); },
     [=] (const ControlResponse& cr) { failureCb(cr.getText()); },
     getCommandOptions().setSigningInfo(rr.signer));
 }
@@ -73,38 +80,10 @@
 
   m_controller.start<ndn::nfd::RibUnregisterCommand>(
     getControlParameters().setName(rr.prefix),
-    [=] (const ControlParameters& cp) { successCb(); },
+    [=] (const ControlParameters&) { successCb(); },
     [=] (const ControlResponse& cr) { failureCb(cr.getText()); },
     getCommandOptions().setSigningInfo(rr.signer));
 }
 
-ndn::nfd::ControlParameters
-NfdRibReadvertiseDestination::getControlParameters()
-{
-  return m_controlParameters;
-}
-
-ndn::nfd::CommandOptions
-NfdRibReadvertiseDestination::getCommandOptions()
-{
-  return m_commandOptions;
-}
-
-void
-NfdRibReadvertiseDestination::handleRibInsert(const ndn::Name& name)
-{
-  if (name.isPrefixOf(m_commandOptions.getPrefix())) {
-    setAvailability(true);
-  }
-}
-
-void
-NfdRibReadvertiseDestination::handleRibErase(const ndn::Name& name)
-{
-  if (name.isPrefixOf(m_commandOptions.getPrefix())) {
-    setAvailability(false);
-  }
-}
-
 } // namespace rib
 } // namespace nfd
diff --git a/daemon/rib/readvertise/nfd-rib-readvertise-destination.hpp b/daemon/rib/readvertise/nfd-rib-readvertise-destination.hpp
index 9c5bce6..0f61669 100644
--- a/daemon/rib/readvertise/nfd-rib-readvertise-destination.hpp
+++ b/daemon/rib/readvertise/nfd-rib-readvertise-destination.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2019,  Regents of the University of California,
+ * Copyright (c) 2014-2021,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -45,8 +45,7 @@
                                Rib& rib,
                                const ndn::nfd::CommandOptions& options = ndn::nfd::CommandOptions(),
                                const ndn::nfd::ControlParameters& parameters =
-                                 ndn::nfd::ControlParameters()
-                                   .setOrigin(ndn::nfd::ROUTE_ORIGIN_CLIENT));
+                                 ndn::nfd::ControlParameters().setOrigin(ndn::nfd::ROUTE_ORIGIN_CLIENT));
 
   /** \brief add a name prefix into NFD RIB
    */
@@ -64,17 +63,16 @@
 
 protected:
   ndn::nfd::ControlParameters
-  getControlParameters();
+  getControlParameters() const
+  {
+    return m_controlParameters;
+  }
 
   ndn::nfd::CommandOptions
-  getCommandOptions();
-
-private:
-  void
-  handleRibInsert(const Name& name);
-
-  void
-  handleRibErase(const Name& name);
+  getCommandOptions() const
+  {
+    return m_commandOptions;
+  }
 
 private:
   ndn::nfd::Controller& m_controller;
diff --git a/daemon/rib/rib-entry.cpp b/daemon/rib/rib-entry.cpp
index 7385d16..6acae09 100644
--- a/daemon/rib/rib-entry.cpp
+++ b/daemon/rib/rib-entry.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2019,  Regents of the University of California,
+ * Copyright (c) 2014-2021,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -33,22 +33,30 @@
 
 NFD_LOG_INIT(RibEntry);
 
+static bool
+compareFaceIdAndOrigin(const Route& lhs, const Route& rhs)
+{
+  return lhs.faceId == rhs.faceId && lhs.origin == rhs.origin;
+}
+
 RibEntry::RouteList::iterator
 RibEntry::findRoute(const Route& route)
 {
-  return std::find_if(begin(), end(), bind(&compareFaceIdAndOrigin, _1, route));
+  return std::find_if(begin(), end(),
+                      [&] (const auto& r) { return compareFaceIdAndOrigin(r, route); });
 }
 
 RibEntry::RouteList::const_iterator
 RibEntry::findRoute(const Route& route) const
 {
-  return std::find_if(begin(), end(), bind(&compareFaceIdAndOrigin, _1, route));
+  return std::find_if(begin(), end(),
+                      [&] (const auto& r) { return compareFaceIdAndOrigin(r, route); });
 }
 
 std::pair<RibEntry::iterator, bool>
 RibEntry::insertRoute(const Route& route)
 {
-  iterator it = findRoute(route);
+  auto it = findRoute(route);
 
   if (it == end()) {
     if (route.flags & ndn::nfd::ROUTE_FLAG_CAPTURE) {
@@ -65,23 +73,21 @@
 void
 RibEntry::eraseRoute(const Route& route)
 {
-  RibEntry::iterator it = findRoute(route);
+  auto it = findRoute(route);
   eraseRoute(it);
 }
 
 bool
 RibEntry::hasRoute(const Route& route)
 {
-  RibEntry::const_iterator it = findRoute(route);
-
+  auto it = findRoute(route);
   return it != end();
 }
 
 bool
-RibEntry::hasFaceId(const uint64_t faceId) const
+RibEntry::hasFaceId(uint64_t faceId) const
 {
-  RibEntry::const_iterator it = std::find_if(begin(), end(), bind(&compareFaceId, _1, faceId));
-
+  auto it = std::find_if(begin(), end(), [faceId] (const auto& r) { return r.faceId == faceId; });
   return it != end();
 }
 
@@ -134,14 +140,14 @@
 void
 RibEntry::removeInheritedRoute(const Route& route)
 {
-  m_inheritedRoutes.remove_if(bind(&compareFaceId, _1, route.faceId));
+  m_inheritedRoutes.remove_if([id = route.faceId] (const auto& r) { return r.faceId == id; });
 }
 
 RibEntry::RouteList::const_iterator
 RibEntry::findInheritedRoute(const Route& route) const
 {
   return std::find_if(m_inheritedRoutes.begin(), m_inheritedRoutes.end(),
-                      bind(&compareFaceId, _1, route.faceId));
+                      [id = route.faceId] (const auto& r) { return r.faceId == id; });
 }
 
 bool
@@ -243,7 +249,7 @@
                                 time::milliseconds maxExpiration) const
 {
   const Route* bestAnnRoute = nullptr;
-  auto entryExpiry = time::steady_clock::TimePoint::min();
+  auto entryExpiry = time::steady_clock::time_point::min();
 
   for (const Route& route : *this) {
     if (route.expires) {
@@ -255,7 +261,7 @@
       }
     }
     else {
-      entryExpiry = time::steady_clock::TimePoint::max();
+      entryExpiry = time::steady_clock::time_point::max();
     }
   }
 
diff --git a/daemon/rib/rib-entry.hpp b/daemon/rib/rib-entry.hpp
index 45d5a87..03cfc8c 100644
--- a/daemon/rib/rib-entry.hpp
+++ b/daemon/rib/rib-entry.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2019,  Regents of the University of California,
+ * Copyright (c) 2014-2021,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -94,7 +94,7 @@
   eraseRoute(RouteList::iterator route);
 
   bool
-  hasFaceId(const uint64_t faceId) const;
+  hasFaceId(uint64_t faceId) const;
 
   const RouteList&
   getRoutes() const;
diff --git a/daemon/rib/rib.cpp b/daemon/rib/rib.cpp
index 2d1db7f..a81e77a 100644
--- a/daemon/rib/rib.cpp
+++ b/daemon/rib/rib.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2019,  Regents of the University of California,
+ * Copyright (c) 2014-2021,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -426,8 +426,8 @@
   // Until task #1698, each RibUpdateBatch contains exactly one RIB update
   BOOST_ASSERT(batch.size() == 1);
 
-  auto fibSuccessCb = bind(&Rib::onFibUpdateSuccess, this, batch, _1, item.managerSuccessCallback);
-  auto fibFailureCb = bind(&Rib::onFibUpdateFailure, this, item.managerFailureCallback, _1, _2);
+  auto fibSuccessCb = std::bind(&Rib::onFibUpdateSuccess, this, batch, _1, item.managerSuccessCallback);
+  auto fibFailureCb = std::bind(&Rib::onFibUpdateFailure, this, item.managerFailureCallback, _1, _2);
 
   m_fibUpdater->computeAndSendFibUpdates(batch, fibSuccessCb, fibFailureCb);
 }
diff --git a/daemon/rib/route.cpp b/daemon/rib/route.cpp
index 04999bb..99d80e5 100644
--- a/daemon/rib/route.cpp
+++ b/daemon/rib/route.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2018,  Regents of the University of California,
+ * Copyright (c) 2014-2021,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -31,21 +31,21 @@
 
 const uint64_t PA_ROUTE_COST = 2048; ///< cost of route created by prefix announcement
 
-static time::steady_clock::TimePoint
+static time::steady_clock::time_point
 computeExpiration(const ndn::PrefixAnnouncement& ann)
 {
-  time::steady_clock::Duration validityEnd = time::steady_clock::Duration::max();
+  auto validityEnd = time::steady_clock::duration::max();
   if (ann.getValidityPeriod()) {
     auto now = time::system_clock::now();
     if (!ann.getValidityPeriod()->isValid(now)) {
-      validityEnd = time::steady_clock::Duration::zero();
+      validityEnd = time::steady_clock::duration::zero();
     }
     else {
       validityEnd = ann.getValidityPeriod()->getPeriod().second - now;
     }
   }
   return time::steady_clock::now() +
-    std::min(validityEnd, time::duration_cast<time::steady_clock::Duration>(ann.getExpiration()));
+    std::min(validityEnd, time::duration_cast<time::steady_clock::duration>(ann.getExpiration()));
 }
 
 Route::Route(const ndn::PrefixAnnouncement& ann, uint64_t faceId)
diff --git a/daemon/rib/route.hpp b/daemon/rib/route.hpp
index 92df470..18df250 100644
--- a/daemon/rib/route.hpp
+++ b/daemon/rib/route.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2019,  Regents of the University of California,
+ * Copyright (c) 2014-2021,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -82,7 +82,7 @@
   ndn::nfd::RouteOrigin origin = ndn::nfd::ROUTE_ORIGIN_APP;
   uint64_t cost = 0;
   std::underlying_type_t<ndn::nfd::RouteFlags> flags = ndn::nfd::ROUTE_FLAGS_NONE;
-  optional<time::steady_clock::TimePoint> expires;
+  optional<time::steady_clock::time_point> expires;
 
   /** \brief The prefix announcement that caused the creation of this route.
    *
@@ -98,7 +98,7 @@
    *  not yet valid or has expired. In this case, the exact value of this field does not matter.
    *  If this field is after the current time, it indicates when the prefix announcement expires.
    */
-  time::steady_clock::TimePoint annExpires;
+  time::steady_clock::time_point annExpires;
 
 private:
   scheduler::EventId m_expirationEvent;
@@ -113,18 +113,6 @@
   return !(lhs == rhs);
 }
 
-inline bool
-compareFaceIdAndOrigin(const Route& lhs, const Route& rhs)
-{
-  return (lhs.faceId == rhs.faceId && lhs.origin == rhs.origin);
-}
-
-inline bool
-compareFaceId(const Route& route, const uint64_t faceId)
-{
-  return (route.faceId == faceId);
-}
-
 std::ostream&
 operator<<(std::ostream& os, const Route& route);
 
diff --git a/daemon/rib/service.cpp b/daemon/rib/service.cpp
index 596fa27..0c674b3 100644
--- a/daemon/rib/service.cpp
+++ b/daemon/rib/service.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2020,  Regents of the University of California,
+ * Copyright (c) 2014-2021,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -45,7 +45,7 @@
 
 Service* Service::s_instance = nullptr;
 
-const std::string CFG_SECTION = "rib";
+const std::string CFG_RIB = "rib";
 const std::string CFG_LOCALHOST_SECURITY = "localhost_security";
 const std::string CFG_LOCALHOP_SECURITY = "localhop_security";
 const std::string CFG_PA_VALIDATION = "prefix_announcement_validation";
@@ -126,7 +126,9 @@
   s_instance = this;
 
   ConfigFile config(ConfigFile::ignoreUnknownSection);
-  config.addSectionHandler(CFG_SECTION, bind(&Service::processConfig, this, _1, _2, _3));
+  config.addSectionHandler(CFG_RIB, [this] (auto&&... args) {
+    processConfig(std::forward<decltype(args)>(args)...);
+  });
   configParse(config, true);
   configParse(config, false);
 
@@ -185,10 +187,10 @@
       // AutoPrefixPropagator does not support config dry-run
     }
     else if (key == CFG_READVERTISE_NLSR) {
-      ConfigFile::parseYesNo(item, CFG_SECTION + "." + CFG_READVERTISE_NLSR);
+      ConfigFile::parseYesNo(item, CFG_RIB + "." + CFG_READVERTISE_NLSR);
     }
     else {
-      NDN_THROW(ConfigFile::Error("Unrecognized option " + CFG_SECTION + "." + key));
+      NDN_THROW(ConfigFile::Error("Unrecognized option " + CFG_RIB + "." + key));
     }
   }
 
@@ -239,10 +241,10 @@
       }
     }
     else if (key == CFG_READVERTISE_NLSR) {
-      wantReadvertiseNlsr = ConfigFile::parseYesNo(item, CFG_SECTION + "." + CFG_READVERTISE_NLSR);
+      wantReadvertiseNlsr = ConfigFile::parseYesNo(item, CFG_RIB + "." + CFG_READVERTISE_NLSR);
     }
     else {
-      NDN_THROW(ConfigFile::Error("Unrecognized option " + CFG_SECTION + "." + key));
+      NDN_THROW(ConfigFile::Error("Unrecognized option " + CFG_RIB + "." + key));
     }
   }
 
diff --git a/daemon/table/network-region-table.cpp b/daemon/table/network-region-table.cpp
index c7e9cea..4ede386 100644
--- a/daemon/table/network-region-table.cpp
+++ b/daemon/table/network-region-table.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2019,  Regents of the University of California,
+ * Copyright (c) 2014-2021,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -28,10 +28,10 @@
 namespace nfd {
 
 bool
-NetworkRegionTable::isInProducerRegion(const DelegationList& forwardingHint) const
+NetworkRegionTable::isInProducerRegion(const ndn::DelegationList& forwardingHint) const
 {
   for (const Name& regionName : *this) {
-    for (const Delegation& delegation : forwardingHint) {
+    for (const auto& delegation : forwardingHint) {
       if (delegation.name.isPrefixOf(regionName)) {
         return true;
       }
diff --git a/daemon/table/network-region-table.hpp b/daemon/table/network-region-table.hpp
index 22da902..e531a45 100644
--- a/daemon/table/network-region-table.hpp
+++ b/daemon/table/network-region-table.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2017,  Regents of the University of California,
+ * Copyright (c) 2014-2021,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -28,6 +28,8 @@
 
 #include "core/common.hpp"
 
+#include <ndn-cxx/delegation-list.hpp>
+
 namespace nfd {
 
 /** \brief stores a collection of producer region names
@@ -50,7 +52,7 @@
    *  otherwise, the Interest should be forwarded according to the forwarding hint.
    */
   bool
-  isInProducerRegion(const DelegationList& forwardingHint) const;
+  isInProducerRegion(const ndn::DelegationList& forwardingHint) const;
 };
 
 } // namespace nfd
