diff --git a/tools/ping/server/ping-server.cpp b/tools/ping/server/ping-server.cpp
index 0a94d0f..9b1403d 100644
--- a/tools/ping/server/ping-server.cpp
+++ b/tools/ping/server/ping-server.cpp
@@ -30,37 +30,36 @@
 
 PingServer::PingServer(Face& face, KeyChain& keyChain, const Options& options)
   : m_options(options)
-  , m_keyChain(keyChain)
-  , m_name(options.prefix)
-  , m_nPings(0)
   , m_face(face)
-  , m_registeredPrefixId(nullptr)
+  , m_keyChain(keyChain)
+  , m_nPings(0)
+  , m_regPrefixId(nullptr)
 {
-  shared_ptr<Buffer> b = make_shared<Buffer>();
+  auto b = make_shared<Buffer>();
   b->assign(m_options.payloadSize, 'a');
-  m_payload = Block(tlv::Content, b);
+  m_payload = Block(tlv::Content, std::move(b));
 }
 
 void
 PingServer::start()
 {
-  m_name.append("ping");
-  m_registeredPrefixId = m_face.setInterestFilter(m_name,
-                                                  bind(&PingServer::onInterest,
-                                                       this, _2),
-                                                  bind(&PingServer::onRegisterFailed,
-                                                       this, _2));
+  m_regPrefixId = m_face.setInterestFilter(
+                    Name(m_options.prefix).append("ping"),
+                    bind(&PingServer::onInterest, this, _2),
+                    [] (const auto&, const auto& reason) {
+                      BOOST_THROW_EXCEPTION(std::runtime_error("Failed to register prefix: " + reason));
+                    });
 }
 
 void
 PingServer::stop()
 {
-  if (m_registeredPrefixId != nullptr) {
-    m_face.unsetInterestFilter(m_registeredPrefixId);
+  if (m_regPrefixId != nullptr) {
+    m_face.unsetInterestFilter(m_regPrefixId);
   }
 }
 
-int
+size_t
 PingServer::getNPings() const
 {
   return m_nPings;
@@ -69,28 +68,20 @@
 void
 PingServer::onInterest(const Interest& interest)
 {
-  Name interestName = interest.getName();
+  afterReceive(interest.getName());
 
-  afterReceive(interestName);
-
-  shared_ptr<Data> data = make_shared<Data>(interestName);
+  auto data = make_shared<Data>(interest.getName());
   data->setFreshnessPeriod(m_options.freshnessPeriod);
   data->setContent(m_payload);
   m_keyChain.sign(*data, signingWithSha256());
   m_face.put(*data);
 
   ++m_nPings;
-  if (m_options.shouldLimitSatisfied && m_options.nMaxPings > 0 && m_options.nMaxPings == m_nPings) {
+  if (m_options.nMaxPings > 0 && m_options.nMaxPings == m_nPings) {
     afterFinish();
   }
 }
 
-void
-PingServer::onRegisterFailed(const std::string& reason)
-{
-  throw "Failed to register prefix in local hub's daemon, REASON: " + reason;
-}
-
 } // namespace server
 } // namespace ping
 } // namespace ndn
