diff --git a/daemon/fw/access-strategy.cpp b/daemon/fw/access-strategy.cpp
index e7e0904..eec5a63 100644
--- a/daemon/fw/access-strategy.cpp
+++ b/daemon/fw/access-strategy.cpp
@@ -26,6 +26,7 @@
 #include "access-strategy.hpp"
 #include "algorithm.hpp"
 #include "core/logger.hpp"
+#include "daemon/global.hpp"
 
 namespace nfd {
 namespace fw {
@@ -42,8 +43,7 @@
     NDN_THROW(std::invalid_argument("AccessStrategy does not accept parameters"));
   }
   if (parsed.version && *parsed.version != getStrategyName()[-1].toVersion()) {
-    NDN_THROW(std::invalid_argument(
-      "AccessStrategy does not support version " + to_string(*parsed.version)));
+    NDN_THROW(std::invalid_argument("AccessStrategy does not support version " + to_string(*parsed.version)));
   }
   this->setInstanceName(makeInstanceName(name, getStrategyName()));
 }
@@ -153,7 +153,7 @@
 
   // schedule RTO timeout
   PitInfo* pi = pitEntry->insertStrategyInfo<PitInfo>().first;
-  pi->rtoTimer = scheduler::schedule(rto,
+  pi->rtoTimer = getScheduler().schedule(rto,
       bind(&AccessStrategy::afterRtoTimeout, this, weak_ptr<pit::Entry>(pitEntry),
            inFace.getId(), mi.lastNexthop));
 
diff --git a/daemon/fw/asf-measurements.cpp b/daemon/fw/asf-measurements.cpp
index 17771e0..dde6866 100644
--- a/daemon/fw/asf-measurements.cpp
+++ b/daemon/fw/asf-measurements.cpp
@@ -24,6 +24,7 @@
  */
 
 #include "asf-measurements.hpp"
+#include "daemon/global.hpp"
 
 namespace nfd {
 namespace fw {
@@ -73,7 +74,7 @@
 FaceInfo::~FaceInfo()
 {
   cancelTimeoutEvent();
-  scheduler::cancel(m_measurementExpirationId);
+  m_measurementExpirationId.cancel();
 }
 
 void
@@ -92,7 +93,7 @@
 void
 FaceInfo::cancelTimeoutEvent()
 {
-  scheduler::cancel(m_timeoutEventId);
+  m_timeoutEventId.cancel();
   m_isTimeoutScheduled = false;
 }
 
@@ -114,7 +115,7 @@
 FaceInfo::recordRtt(const shared_ptr<pit::Entry>& pitEntry, const Face& inFace)
 {
   // Calculate RTT
-  pit::OutRecordCollection::const_iterator outRecord = pitEntry->getOutRecord(inFace, 0);
+  auto outRecord = pitEntry->getOutRecord(inFace, 0);
 
   if (outRecord == pitEntry->out_end()) { // no out-record
     NFD_LOG_TRACE(pitEntry->getInterest() << " dataFrom inFace=" << inFace.getId() << " no-out-record");
@@ -122,7 +123,7 @@
   }
 
   time::steady_clock::Duration steadyRtt = time::steady_clock::now() - outRecord->getLastRenewed();
-  RttEstimator::Duration durationRtt = time::duration_cast<RttEstimator::Duration>(steadyRtt);
+  auto durationRtt = time::duration_cast<RttEstimator::Duration>(steadyRtt);
 
   m_rttStats.addRttMeasurement(durationRtt);
 
@@ -148,10 +149,9 @@
 }
 
 FaceInfo*
-NamespaceInfo::getFaceInfo(const fib::Entry& fibEntry, FaceId faceId)
+NamespaceInfo::getFaceInfo(const fib::Entry&, FaceId faceId)
 {
-  FaceInfoTable::iterator it = m_fit.find(faceId);
-
+  auto it = m_fit.find(faceId);
   if (it != m_fit.end()) {
     return &it->second;
   }
@@ -161,10 +161,9 @@
 }
 
 FaceInfo&
-NamespaceInfo::getOrCreateFaceInfo(const fib::Entry& fibEntry, FaceId faceId)
+NamespaceInfo::getOrCreateFaceInfo(const fib::Entry&, FaceId faceId)
 {
-  FaceInfoTable::iterator it = m_fit.find(faceId);
-
+  auto it = m_fit.find(faceId);
   FaceInfo* info = nullptr;
 
   if (it == m_fit.end()) {
@@ -190,10 +189,11 @@
 NamespaceInfo::extendFaceInfoLifetime(FaceInfo& info, FaceId faceId)
 {
   // Cancel previous expiration
-  scheduler::cancel(info.getMeasurementExpirationEventId());
+  info.getMeasurementExpirationEventId().cancel();
 
   // Refresh measurement
-  auto id = scheduler::schedule(AsfMeasurements::MEASUREMENTS_LIFETIME, [=] { expireFaceInfo(faceId); });
+  auto id = getScheduler().schedule(AsfMeasurements::MEASUREMENTS_LIFETIME,
+                                    [=] { expireFaceInfo(faceId); });
   info.setMeasurementExpirationEventId(id);
 }
 
diff --git a/daemon/fw/asf-probing-module.cpp b/daemon/fw/asf-probing-module.cpp
index dd2b537..84055f1 100644
--- a/daemon/fw/asf-probing-module.cpp
+++ b/daemon/fw/asf-probing-module.cpp
@@ -25,6 +25,7 @@
 
 #include "asf-probing-module.hpp"
 #include "algorithm.hpp"
+#include "daemon/global.hpp"
 
 #include <ndn-cxx/util/random.hpp>
 
@@ -50,7 +51,7 @@
   Name prefix = fibEntry.getPrefix();
 
   // Set the probing flag for the namespace to true after passed interval of time
-  scheduler::schedule(interval, [this, prefix] {
+  getScheduler().schedule(interval, [this, prefix] {
     NamespaceInfo* info = m_measurements.getNamespaceInfo(prefix);
 
     if (info == nullptr) {
@@ -65,10 +66,8 @@
 }
 
 Face*
-ProbingModule::getFaceToProbe(const Face& inFace,
-                              const Interest& interest,
-                              const fib::Entry& fibEntry,
-                              const Face& faceUsed)
+ProbingModule::getFaceToProbe(const Face& inFace, const Interest& interest,
+                              const fib::Entry& fibEntry, const Face& faceUsed)
 {
   FaceInfoFacePairSet rankedFaces(
     [] (const auto& pairLhs, const auto& pairRhs) -> bool {
@@ -83,7 +82,7 @@
 
   // Put eligible faces into rankedFaces. If a face does not have an RTT measurement,
   // immediately pick the face for probing
-  for (const fib::NextHop& hop : fibEntry.getNextHops()) {
+  for (const auto& hop : fibEntry.getNextHops()) {
     Face& hopFace = hop.getFace();
 
     // Don't send probe Interest back to the incoming face or use the same face
diff --git a/daemon/fw/asf-strategy.cpp b/daemon/fw/asf-strategy.cpp
index 779daee..46acaf4 100644
--- a/daemon/fw/asf-strategy.cpp
+++ b/daemon/fw/asf-strategy.cpp
@@ -26,6 +26,7 @@
 #include "asf-strategy.hpp"
 #include "algorithm.hpp"
 #include "core/logger.hpp"
+#include "daemon/global.hpp"
 
 namespace nfd {
 namespace fw {
@@ -226,9 +227,8 @@
     NFD_LOG_TRACE("Scheduling timeout for " << fibEntry.getPrefix() << " to: " << egress
                   << " in " << time::duration_cast<time::milliseconds>(timeout) << " ms");
 
-    scheduler::EventId id = scheduler::schedule(timeout,
-        bind(&AsfStrategy::onTimeout, this, interest.getName(), egress.face.getId()));
-
+    auto id = getScheduler().schedule(timeout, bind(&AsfStrategy::onTimeout, this,
+                                                    interest.getName(), egress.face.getId()));
     faceInfo.setTimeoutEvent(id, interest.getName());
   }
 }
diff --git a/daemon/fw/face-table.cpp b/daemon/fw/face-table.cpp
index 7e1880f..a25e107 100644
--- a/daemon/fw/face-table.cpp
+++ b/daemon/fw/face-table.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-2019,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -24,8 +24,8 @@
  */
 
 #include "face-table.hpp"
-#include "core/global-io.hpp"
 #include "core/logger.hpp"
+#include "daemon/global.hpp"
 #include "face/channel.hpp"
 
 #include <ndn-cxx/util/concepts.hpp>
diff --git a/daemon/fw/forwarder.cpp b/daemon/fw/forwarder.cpp
index 508a890..328ff31 100644
--- a/daemon/fw/forwarder.cpp
+++ b/daemon/fw/forwarder.cpp
@@ -29,6 +29,7 @@
 #include "best-route-strategy2.hpp"
 #include "strategy.hpp"
 #include "core/logger.hpp"
+#include "daemon/global.hpp"
 #include "table/cleanup.hpp"
 
 #include <ndn-cxx/lp/tags.hpp>
@@ -44,7 +45,7 @@
 }
 
 Forwarder::Forwarder()
-  : m_unsolicitedDataPolicy(new fw::DefaultUnsolicitedDataPolicy())
+  : m_unsolicitedDataPolicy(make_unique<fw::DefaultUnsolicitedDataPolicy>())
   , m_fib(m_nameTree)
   , m_pit(m_nameTree)
   , m_measurements(m_nameTree)
@@ -241,7 +242,7 @@
                 << (pitEntry->isSatisfied ? " satisfied" : " unsatisfied"));
 
   // Dead Nonce List insert if necessary
-  this->insertDeadNonceList(*pitEntry, 0);
+  this->insertDeadNonceList(*pitEntry, nullptr);
 
   // Increment satisfied/unsatisfied Interests counter
   if (pitEntry->isSatisfied) {
@@ -252,7 +253,7 @@
   }
 
   // PIT delete
-  scheduler::cancel(pitEntry->expiryTimer);
+  pitEntry->expiryTimer.cancel();
   m_pit.erase(pitEntry.get());
 }
 
@@ -507,9 +508,8 @@
   BOOST_ASSERT(pitEntry);
   BOOST_ASSERT(duration >= 0_ms);
 
-  scheduler::cancel(pitEntry->expiryTimer);
-
-  pitEntry->expiryTimer = scheduler::schedule(duration, [=] { onInterestFinalize(pitEntry); });
+  pitEntry->expiryTimer.cancel();
+  pitEntry->expiryTimer = getScheduler().schedule(duration, [=] { onInterestFinalize(pitEntry); });
 }
 
 void
diff --git a/daemon/fw/forwarder.hpp b/daemon/fw/forwarder.hpp
index ecc4d72..18ca483 100644
--- a/daemon/fw/forwarder.hpp
+++ b/daemon/fw/forwarder.hpp
@@ -26,11 +26,9 @@
 #ifndef NFD_DAEMON_FW_FORWARDER_HPP
 #define NFD_DAEMON_FW_FORWARDER_HPP
 
-#include "core/common.hpp"
-#include "core/scheduler.hpp"
-#include "forwarder-counters.hpp"
-#include "face-table.hpp"
 #include "face-endpoint.hpp"
+#include "face-table.hpp"
+#include "forwarder-counters.hpp"
 #include "unsolicited-data-policy.hpp"
 #include "table/fib.hpp"
 #include "table/pit.hpp"
@@ -46,9 +44,9 @@
 class Strategy;
 } // namespace fw
 
-/** \brief main class of NFD
+/** \brief Main class of NFD forwarding engine.
  *
- *  Forwarder owns all faces and tables, and implements forwarding pipelines.
+ *  Forwarder owns all faces and tables, and implements the forwarding pipelines.
  */
 class Forwarder
 {
diff --git a/daemon/fw/ncc-strategy.cpp b/daemon/fw/ncc-strategy.cpp
index a6c1e99..5063200 100644
--- a/daemon/fw/ncc-strategy.cpp
+++ b/daemon/fw/ncc-strategy.cpp
@@ -25,6 +25,7 @@
 
 #include "ncc-strategy.hpp"
 #include "algorithm.hpp"
+#include "daemon/global.hpp"
 
 #include <ndn-cxx/util/random.hpp>
 
@@ -90,8 +91,7 @@
     deferRange = time::microseconds((deferFirst.count() + 1) / 2);
     --nUpstreams;
     this->sendInterest(pitEntry, FaceEndpoint(*bestFace, 0), interest);
-    pitEntryInfo->bestFaceTimeout = scheduler::schedule(
-      meInfo.prediction,
+    pitEntryInfo->bestFaceTimeout = getScheduler().schedule(meInfo.prediction,
       bind(&NccStrategy::timeoutOnBestFace, this, weak_ptr<pit::Entry>(pitEntry)));
   }
   else {
@@ -128,7 +128,7 @@
     // this maxInterval would be used to determine when the next doPropagate would happen.
     pitEntryInfo->maxInterval = deferFirst;
   }
-  pitEntryInfo->propagateTimer = scheduler::schedule(deferFirst,
+  pitEntryInfo->propagateTimer = getScheduler().schedule(deferFirst,
     bind(&NccStrategy::doPropagate, this, ingress.face.getId(), weak_ptr<pit::Entry>(pitEntry)));
 }
 
@@ -178,7 +178,7 @@
   if (isForwarded) {
     std::uniform_int_distribution<time::nanoseconds::rep> dist(0, pitEntryInfo->maxInterval.count() - 1);
     time::nanoseconds deferNext(dist(ndn::random::getRandomNumberEngine()));
-    pitEntryInfo->propagateTimer = scheduler::schedule(deferNext,
+    pitEntryInfo->propagateTimer = getScheduler().schedule(deferNext,
       bind(&NccStrategy::doPropagate, this, inFaceId, weak_ptr<pit::Entry>(pitEntry)));
   }
 }
@@ -233,14 +233,14 @@
 
   PitEntryInfo* pitEntryInfo = pitEntry->getStrategyInfo<PitEntryInfo>();
   if (pitEntryInfo != nullptr) {
-    scheduler::cancel(pitEntryInfo->propagateTimer);
+    pitEntryInfo->propagateTimer.cancel();
 
     // Verify that the best face satisfied the interest before canceling the timeout call
     MeasurementsEntryInfo& meInfo = this->getMeasurementsEntryInfo(pitEntry);
     shared_ptr<Face> bestFace = meInfo.getBestFace();
 
     if (bestFace.get() == &ingress.face)
-      scheduler::cancel(pitEntryInfo->bestFaceTimeout);
+      pitEntryInfo->bestFaceTimeout.cancel();
   }
 }
 
@@ -337,8 +337,8 @@
 
 NccStrategy::PitEntryInfo::~PitEntryInfo()
 {
-  scheduler::cancel(this->bestFaceTimeout);
-  scheduler::cancel(this->propagateTimer);
+  bestFaceTimeout.cancel();
+  propagateTimer.cancel();
 }
 
 } // namespace fw
diff --git a/daemon/fw/self-learning-strategy.cpp b/daemon/fw/self-learning-strategy.cpp
index 12e6176..f0eab59 100644
--- a/daemon/fw/self-learning-strategy.cpp
+++ b/daemon/fw/self-learning-strategy.cpp
@@ -27,7 +27,7 @@
 #include "algorithm.hpp"
 
 #include "core/logger.hpp"
-#include "core/global-io.hpp"
+#include "daemon/global.hpp"
 #include "rib/service.hpp"
 
 #include <ndn-cxx/lp/empty-value.hpp>
diff --git a/daemon/fw/strategy.hpp b/daemon/fw/strategy.hpp
index bb50556..cc1b2b8 100644
--- a/daemon/fw/strategy.hpp
+++ b/daemon/fw/strategy.hpp
@@ -51,7 +51,9 @@
     BOOST_ASSERT(strategyName.at(-1).isVersion());
     Registry& registry = getRegistry();
     BOOST_ASSERT(registry.count(strategyName) == 0);
-    registry[strategyName] = &make_unique<S, Forwarder&, const Name&>;
+    registry[strategyName] = [] (auto&&... args) {
+      return make_unique<S>(std::forward<decltype(args)>(args)...);
+    };
   }
 
   /** \return whether a strategy instance can be created from \p instanceName
@@ -81,9 +83,9 @@
   listRegistered();
 
 public: // constructor, destructor, strategy name
-  /** \brief construct a strategy instance
+  /** \brief Construct a strategy instance.
    *  \param forwarder a reference to the forwarder, used to enable actions and accessors.
-   *  \note Strategy subclass constructor should not retain a reference to the forwarder.
+   *  \note Strategy subclass constructor must not retain a reference to \p forwarder.
    */
   explicit
   Strategy(Forwarder& forwarder);
