diff --git a/src/route/fib-entry.hpp b/src/route/fib-entry.hpp
index 2d653ad..248c0fd 100644
--- a/src/route/fib-entry.hpp
+++ b/src/route/fib-entry.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2018,  The University of Memphis,
+/*
+ * Copyright (c) 2014-2019,  The University of Memphis,
  *                           Regents of the University of California
  *
  * This file is part of NLSR (Named-data Link State Routing).
@@ -30,18 +30,11 @@
 class FibEntry
 {
 public:
-  FibEntry()
-    : m_name()
-    , m_seqNo(1)
-    , m_nexthopList()
-  {
-  }
+  FibEntry() = default;
 
   FibEntry(const ndn::Name& name)
-    : m_seqNo(1)
-    , m_nexthopList()
+    : m_name(name)
   {
-    m_name = name;
   }
 
   const ndn::Name&
@@ -57,12 +50,12 @@
   }
 
   void
-  setRefreshEventId(ndn::EventId id)
+  setRefreshEventId(ndn::scheduler::EventId id)
   {
-    m_refreshEventId = id;
+    m_refreshEventId = std::move(id);
   }
 
-  ndn::EventId
+  ndn::scheduler::EventId
   getRefreshEventId() const
   {
     return m_refreshEventId;
@@ -93,8 +86,8 @@
 
 private:
   ndn::Name m_name;
-  ndn::EventId m_refreshEventId;
-  int32_t m_seqNo;
+  ndn::scheduler::EventId m_refreshEventId;
+  int32_t m_seqNo = 1;
   NexthopList m_nexthopList;
 };
 
diff --git a/src/route/fib.cpp b/src/route/fib.cpp
index 1da774b..5966108 100644
--- a/src/route/fib.cpp
+++ b/src/route/fib.cpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2019,  The University of Memphis,
  *                           Regents of the University of California
  *
@@ -49,7 +49,7 @@
 Fib::remove(const ndn::Name& name)
 {
   NLSR_LOG_DEBUG("Fib::remove called");
-  std::map<ndn::Name, FibEntry>::iterator it = m_table.find(name);
+  auto it = m_table.find(name);
 
   // Only unregister the prefix if it ISN'T a neighbor.
   if (it != m_table.end() && isNotNeighbor((it->second).getName())) {
@@ -96,12 +96,11 @@
   unsigned int nFaces = 0;
 
   // Create a list of next hops to be installed with length == maxFaces
-  for (NexthopList::iterator it = allHops.cbegin(); it != allHops.cend() && nFaces < maxFaces;
-       ++it, ++nFaces) {
+  for (auto it = allHops.cbegin(); it != allHops.cend() && nFaces < maxFaces; ++it, ++nFaces) {
     hopsToAdd.addNextHop(*it);
   }
 
-  std::map<ndn::Name, FibEntry>::iterator entryIt = m_table.find(name);
+  auto entryIt = m_table.find(name);
 
   // New FIB entry that has nextHops
   if (entryIt == m_table.end() && hopsToAdd.size() != 0) {
@@ -236,7 +235,7 @@
   NLSR_LOG_DEBUG(message << ": " << commandSuccessResult.getName() <<
                  " Face Uri: " << faceUri << " faceId: " << commandSuccessResult.getFaceId());
 
-  AdjacencyList::iterator adjacent = m_adjacencyList.findAdjacent(faceUri);
+  auto adjacent = m_adjacencyList.findAdjacent(faceUri);
   if (adjacent != m_adjacencyList.end()) {
     adjacent->setFaceId(commandSuccessResult.getFaceId());
   }
@@ -311,29 +310,24 @@
     .setStrategy(strategy);
 
   m_controller.start<ndn::nfd::StrategyChoiceSetCommand>(parameters,
-                                                         std::bind(&Fib::onSetStrategySuccess, this, _1,
-                                                              "Successfully set strategy choice"),
+                                                         std::bind(&Fib::onSetStrategySuccess, this, _1),
                                                          std::bind(&Fib::onSetStrategyFailure, this, _1,
-                                                              parameters,
-                                                              count,
-                                                              "Failed to set strategy choice"));
+                                                                   parameters, count));
 }
 
 void
-Fib::onSetStrategySuccess(const ndn::nfd::ControlParameters& commandSuccessResult,
-                         const std::string& message)
+Fib::onSetStrategySuccess(const ndn::nfd::ControlParameters& commandSuccessResult)
 {
-  NLSR_LOG_DEBUG(message << ": " << commandSuccessResult.getStrategy() <<
+  NLSR_LOG_DEBUG("Successfully set strategy choice: " << commandSuccessResult.getStrategy() <<
                  " for name: " << commandSuccessResult.getName());
 }
 
 void
 Fib::onSetStrategyFailure(const ndn::nfd::ControlResponse& response,
                           const ndn::nfd::ControlParameters& parameters,
-                          uint32_t count,
-                          const std::string& message)
+                          uint32_t count)
 {
-  NLSR_LOG_DEBUG(message << ": " << parameters.getStrategy() <<
+  NLSR_LOG_DEBUG("Failed to set strategy choice: " << parameters.getStrategy() <<
                  " for name: " << parameters.getName());
   if (count < 3) {
     setStrategy(parameters.getName(), parameters.getStrategy().toUri(), count + 1);
@@ -347,9 +341,9 @@
                  " Seq Num: " << entry.getSeqNo() <<
                  " in " << m_refreshTime << " seconds");
 
-  entry.setRefreshEventId(m_scheduler.scheduleEvent(ndn::time::seconds(m_refreshTime),
-                                                    std::bind(&Fib::refreshEntry, this,
-                                                              entry.getName(), refreshCallback)));
+  entry.setRefreshEventId(m_scheduler.schedule(ndn::time::seconds(m_refreshTime),
+                                               std::bind(&Fib::refreshEntry, this,
+                                                         entry.getName(), refreshCallback)));
 }
 
 void
@@ -362,16 +356,13 @@
 Fib::cancelEntryRefresh(const FibEntry& entry)
 {
   NLSR_LOG_DEBUG("Canceling refresh for " << entry.getName() << " Seq Num: " << entry.getSeqNo());
-
-  m_scheduler.cancelEvent(entry.getRefreshEventId());
-  entry.getRefreshEventId().reset();
+  entry.getRefreshEventId().cancel();
 }
 
 void
 Fib::refreshEntry(const ndn::Name& name, afterRefreshCallback refreshCb)
 {
-  std::map<ndn::Name, FibEntry>::iterator it = m_table.find(name);
-
+  auto it = m_table.find(name);
   if (it == m_table.end()) {
     return;
   }
diff --git a/src/route/fib.hpp b/src/route/fib.hpp
index 012d61d..2d4f47f 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-2018,  The University of Memphis,
+ * Copyright (c) 2014-2019,  The University of Memphis,
  *                           Regents of the University of California,
  *                           Arizona Board of Regents.
  *
@@ -191,16 +191,14 @@
   /*! \brief Log a successful strategy setting.
    */
   void
-  onSetStrategySuccess(const ndn::nfd::ControlParameters& commandSuccessResult,
-                       const std::string& message);
+  onSetStrategySuccess(const ndn::nfd::ControlParameters& commandSuccessResult);
 
   /*! \brief Retry a strategy setting up to three (3) times.
    */
   void
   onSetStrategyFailure(const ndn::nfd::ControlResponse& response,
                        const ndn::nfd::ControlParameters& parameters,
-                       uint32_t count,
-                       const std::string& message);
+                       uint32_t count);
 
 PUBLIC_WITH_TESTS_ELSE_PRIVATE:
   /*! \brief Schedule a refresh event for an entry.
diff --git a/src/route/routing-table.cpp b/src/route/routing-table.cpp
index 4e2fa86..f0e4aac 100644
--- a/src/route/routing-table.cpp
+++ b/src/route/routing-table.cpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2019,  The University of Memphis,
  *                           Regents of the University of California
  *
@@ -160,12 +160,9 @@
 void
 RoutingTable::scheduleRoutingTableCalculation()
 {
-  if (m_isRouteCalculationScheduled != true) {
+  if (!m_isRouteCalculationScheduled) {
     NLSR_LOG_DEBUG("Scheduling routing table calculation in " << m_routingCalcInterval);
-
-    m_scheduler.scheduleEvent(m_routingCalcInterval,
-                              std::bind(&RoutingTable::calculate, this));
-
+    m_scheduler.schedule(m_routingCalcInterval, [this] { calculate(); });
     m_isRouteCalculationScheduled = true;
   }
 }
@@ -182,7 +179,7 @@
   NLSR_LOG_DEBUG("Adding " << nh << " for destination: " << destRouter);
 
   RoutingTableEntry* rteChk = findRoutingTableEntry(destRouter);
-  if (rteChk == 0) {
+  if (rteChk == nullptr) {
     RoutingTableEntry rte(destRouter);
     rte.getNexthopList().addNextHop(nh);
     m_rTable.push_back(rte);
@@ -195,14 +192,12 @@
 RoutingTableEntry*
 RoutingTable::findRoutingTableEntry(const ndn::Name& destRouter)
 {
-  std::list<RoutingTableEntry>::iterator it = std::find_if(m_rTable.begin(),
-                                                           m_rTable.end(),
-                                                           std::bind(&routingTableEntryCompare,
-                                                                     _1, destRouter));
+  auto it = std::find_if(m_rTable.begin(), m_rTable.end(),
+                         std::bind(&routingTableEntryCompare, _1, destRouter));
   if (it != m_rTable.end()) {
     return &(*it);
   }
-  return 0;
+  return nullptr;
 }
 
 void
@@ -230,17 +225,15 @@
 {
   NLSR_LOG_DEBUG("Adding " << nh << " to dry table for destination: " << destRouter);
 
-  std::list<RoutingTableEntry>::iterator it = std::find_if(m_dryTable.begin(),
-                                                           m_dryTable.end(),
-                                                           std::bind(&routingTableEntryCompare,
-                                                                     _1, destRouter));
+  auto it = std::find_if(m_dryTable.begin(), m_dryTable.end(),
+                         std::bind(&routingTableEntryCompare, _1, destRouter));
   if (it == m_dryTable.end()) {
     RoutingTableEntry rte(destRouter);
     rte.getNexthopList().addNextHop(nh);
     m_dryTable.push_back(rte);
   }
   else {
-    (*it).getNexthopList().addNextHop(nh);
+    it->getNexthopList().addNextHop(nh);
   }
 }
 
