diff --git a/tools/chunks/catchunks/data-fetcher.cpp b/tools/chunks/catchunks/data-fetcher.cpp
index 7600016..43d5076 100644
--- a/tools/chunks/catchunks/data-fetcher.cpp
+++ b/tools/chunks/catchunks/data-fetcher.cpp
@@ -126,13 +126,13 @@
       }
       case lp::NackReason::CONGESTION: {
         time::milliseconds backoffTime(static_cast<uint64_t>(std::pow(2, m_nCongestionRetries)));
-        if (backoffTime > MAX_CONGESTION_BACKOFF_TIME)
+        if (backoffTime > MAX_CONGESTION_BACKOFF_TIME) {
           backoffTime = MAX_CONGESTION_BACKOFF_TIME;
-        else
+        }
+        else {
           m_nCongestionRetries++;
-
-        m_scheduler.scheduleEvent(backoffTime, bind(&DataFetcher::expressInterest, this,
-                                                    newInterest, self));
+        }
+        m_scheduler.schedule(backoffTime, [=] { expressInterest(newInterest, self); });
         break;
       }
       default: {
diff --git a/tools/chunks/catchunks/pipeline-interests-adaptive.cpp b/tools/chunks/catchunks/pipeline-interests-adaptive.cpp
index 7e394ef..4ce277d 100644
--- a/tools/chunks/catchunks/pipeline-interests-adaptive.cpp
+++ b/tools/chunks/catchunks/pipeline-interests-adaptive.cpp
@@ -82,7 +82,7 @@
   }
 
   // schedule the event to check retransmission timer
-  m_checkRtoEvent = m_scheduler.scheduleEvent(m_options.rtoCheckInterval, [this] { checkRto(); });
+  m_checkRtoEvent = m_scheduler.schedule(m_options.rtoCheckInterval, [this] { checkRto(); });
 
   schedulePackets();
 }
@@ -120,7 +120,7 @@
   }
 
   // schedule the next check after predefined interval
-  m_checkRtoEvent = m_scheduler.scheduleEvent(m_options.rtoCheckInterval, [this] { checkRto(); });
+  m_checkRtoEvent = m_scheduler.schedule(m_options.rtoCheckInterval, [this] { checkRto(); });
 }
 
 void
diff --git a/tools/ping/client/ping.cpp b/tools/ping/client/ping.cpp
index b83c160..e3cb20f 100644
--- a/tools/ping/client/ping.cpp
+++ b/tools/ping/client/ping.cpp
@@ -58,25 +58,23 @@
 {
   BOOST_ASSERT((m_options.nPings < 0) || (m_nSent < m_options.nPings));
 
-  Name pingPacketName = makePingName(m_nextSeq);
-
-  Interest interest(pingPacketName);
+  Interest interest(makePingName(m_nextSeq));
   interest.setCanBePrefix(false);
   interest.setMustBeFresh(!m_options.shouldAllowStaleData);
   interest.setInterestLifetime(m_options.timeout);
 
   auto now = time::steady_clock::now();
   m_face.expressInterest(interest,
-                         bind(&Ping::onData, this, _1, _2, m_nextSeq, now),
-                         bind(&Ping::onNack, this, _1, _2, m_nextSeq, now),
-                         bind(&Ping::onTimeout, this, _1, m_nextSeq));
+                         bind(&Ping::onData, this, m_nextSeq, now),
+                         bind(&Ping::onNack, this, _2, m_nextSeq, now),
+                         bind(&Ping::onTimeout, this, m_nextSeq));
 
   ++m_nSent;
   ++m_nextSeq;
   ++m_nOutstanding;
 
   if ((m_options.nPings < 0) || (m_nSent < m_options.nPings)) {
-    m_nextPingEvent = m_scheduler.scheduleEvent(m_options.interval, bind(&Ping::performPing, this));
+    m_nextPingEvent = m_scheduler.schedule(m_options.interval, [this] { performPing(); });
   }
   else {
     finish();
@@ -84,36 +82,25 @@
 }
 
 void
-Ping::onData(const Interest& interest,
-             const Data& data,
-             uint64_t seq,
-             const time::steady_clock::TimePoint& sendTime)
+Ping::onData(uint64_t seq, const time::steady_clock::TimePoint& sendTime)
 {
   time::nanoseconds rtt = time::steady_clock::now() - sendTime;
-
   afterData(seq, rtt);
-
   finish();
 }
 
 void
-Ping::onNack(const Interest& interest,
-             const lp::Nack& nack,
-             uint64_t seq,
-             const time::steady_clock::TimePoint& sendTime)
+Ping::onNack(const lp::Nack& nack, uint64_t seq, const time::steady_clock::TimePoint& sendTime)
 {
   time::nanoseconds rtt = time::steady_clock::now() - sendTime;
-
   afterNack(seq, rtt, nack.getHeader());
-
   finish();
 }
 
 void
-Ping::onTimeout(const Interest& interest, uint64_t seq)
+Ping::onTimeout(uint64_t seq)
 {
   afterTimeout(seq);
-
   finish();
 }
 
@@ -123,7 +110,6 @@
   if (--m_nOutstanding >= 0) {
     return;
   }
-
   afterFinish();
 }
 
@@ -135,8 +121,7 @@
   if (!m_options.clientIdentifier.empty()) {
     name.append(m_options.clientIdentifier);
   }
-  name.append(std::to_string(seq));
-
+  name.append(to_string(seq));
   return name;
 }
 
diff --git a/tools/ping/client/ping.hpp b/tools/ping/client/ping.hpp
index f2a78d9..aeab96f 100644
--- a/tools/ping/client/ping.hpp
+++ b/tools/ping/client/ping.hpp
@@ -121,16 +121,11 @@
   /**
    * @brief Called when a Data packet is received in response to a ping
    *
-   * @param interest NDN interest
-   * @param data returned data
    * @param seq ping sequence number
    * @param sendTime time ping sent
    */
   void
-  onData(const Interest& interest,
-         const Data& data,
-         uint64_t seq,
-         const time::steady_clock::TimePoint& sendTime);
+  onData(uint64_t seq, const time::steady_clock::TimePoint& sendTime);
 
   /**
    * @brief Called when a Nack is received in response to a ping
@@ -141,9 +136,7 @@
    * @param sendTime time ping sent
    */
   void
-  onNack(const Interest& interest,
-         const lp::Nack& nack,
-         uint64_t seq,
+  onNack(const lp::Nack& nack, uint64_t seq,
          const time::steady_clock::TimePoint& sendTime);
 
   /**
@@ -153,7 +146,7 @@
    * @param seq ping sequence number
    */
   void
-  onTimeout(const Interest& interest, uint64_t seq);
+  onTimeout(uint64_t seq);
 
   /**
    * @brief Called after ping received or timed out
