diff --git a/src/clients/iterative-query-controller.cpp b/src/clients/iterative-query-controller.cpp
index b40ba9b..ccb9451 100644
--- a/src/clients/iterative-query-controller.cpp
+++ b/src/clients/iterative-query-controller.cpp
@@ -19,7 +19,8 @@
 
 #include "iterative-query-controller.hpp"
 #include "logger.hpp"
-#include <iostream>
+
+#include <sstream>
 
 namespace ndn {
 namespace ndns {
@@ -113,7 +114,7 @@
         oss << "In onDataValidated, absence of record can not be infered from DoE.";
         oss << " Last query:" << m_lastLabelType << " ";
         oss << *this;
-        BOOST_THROW_EXCEPTION(std::runtime_error(oss.str()));
+        NDN_THROW(std::runtime_error(oss.str()));
       }
     }
     else if (contentType == NDNS_LINK) {
@@ -255,8 +256,7 @@
     std::ostringstream oss;
     oss << *this;
     NDNS_LOG_WARN("unexpected state: " << oss.str());
-    BOOST_THROW_EXCEPTION(std::runtime_error("call makeLatestInterest() unexpected: "
-                                             + oss.str()));
+    NDN_THROW(std::runtime_error("call makeLatestInterest() unexpected: " + oss.str()));
   }
 
   m_lastLabelType = Name(query.getRrLabel()).append(query.getRrType());
diff --git a/src/clients/iterative-query-controller.hpp b/src/clients/iterative-query-controller.hpp
index cee2976..48c0871 100644
--- a/src/clients/iterative-query-controller.hpp
+++ b/src/clients/iterative-query-controller.hpp
@@ -21,17 +21,12 @@
 #define NDNS_CLIENTS_ITERATIVE_QUERY_CONTROLLER_HPP
 
 #include "ndns-enum.hpp"
-#include "common.hpp"
-#include "query.hpp"
 #include "query-controller.hpp"
 #include "response.hpp"
 #include "validator/validator.hpp"
 
-#include <ndn-cxx/data.hpp>
-#include <ndn-cxx/interest.hpp>
-#include <ndn-cxx/link.hpp>
-#include <ndn-cxx/name.hpp>
 #include <ndn-cxx/ims/in-memory-storage.hpp>
+#include <ndn-cxx/link.hpp>
 
 namespace ndn {
 namespace ndns {
@@ -63,15 +58,15 @@
                            Face& face, security::Validator* validator = nullptr,
                            ndn::InMemoryStorage* cache = nullptr);
 
-  virtual void
-  start();
+  void
+  start() override;
 
   /**
    * @brief return false if the current status is not QUEYR_STEP_QUERY_NS
    * or QUERY_STEP_QUERY_RR
    */
-  virtual bool
-  hasEnded();
+  bool
+  hasEnded() override;
 
 NDNS_PUBLIC_WITH_TESTS_ELSE_PRIVATE:
   void
@@ -110,7 +105,7 @@
 
 public:
   void
-  setStartComponentIndex(size_t finished)
+  setStartComponentIndex(size_t finished) override
   {
     m_nFinishedComps = finished;
   }
diff --git a/src/clients/query-controller.cpp b/src/clients/query-controller.cpp
index 9cd3559..81914ba 100644
--- a/src/clients/query-controller.cpp
+++ b/src/clients/query-controller.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California.
+/*
+ * Copyright (c) 2014-2020, Regents of the University of California.
  *
  * This file is part of NDNS (Named Data Networking Domain Name Service).
  * See AUTHORS.md for complete list of NDNS authors and contributors.
@@ -18,8 +18,6 @@
  */
 
 #include "query-controller.hpp"
-#include "logger.hpp"
-#include <iostream>
 
 namespace ndn {
 namespace ndns {
@@ -46,5 +44,6 @@
 
   return os;
 }
+
 } // namespace ndns
 } // namespace ndn
diff --git a/src/clients/query-controller.hpp b/src/clients/query-controller.hpp
index 8a84645..a78b5df 100644
--- a/src/clients/query-controller.hpp
+++ b/src/clients/query-controller.hpp
@@ -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-2020, Regents of the University of California.
  *
  * This file is part of NDNS (Named Data Networking Domain Name Service).
  * See AUTHORS.md for complete list of NDNS authors and contributors.
@@ -20,15 +20,14 @@
 #ifndef NDNS_CLIENTS_QUERY_CONTROLLER_HPP
 #define NDNS_CLIENTS_QUERY_CONTROLLER_HPP
 
+#include "common.hpp"
 #include "query.hpp"
 #include "response.hpp"
 
 #include <ndn-cxx/data.hpp>
 #include <ndn-cxx/interest.hpp>
-#include <ndn-cxx/name.hpp>
 #include <ndn-cxx/face.hpp>
 
-
 namespace ndn {
 namespace ndns {
 
@@ -48,7 +47,7 @@
  * @brief a Query Controller interface
  *
  */
-class QueryController : noncopyable
+class QueryController : boost::noncopyable
 {
 public:
   QueryController(const Name& dstLabel, const name::Component& rrType,
diff --git a/src/clients/query.hpp b/src/clients/query.hpp
index 6f8222b..bd7ff25 100644
--- a/src/clients/query.hpp
+++ b/src/clients/query.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-2020, Regents of the University of California.
  *
  * This file is part of NDNS (Named Data Networking Domain Name Service).
  * See AUTHORS.md for complete list of NDNS authors and contributors.
@@ -36,7 +36,7 @@
  *
  *      <zone> [<NDNS>|<NDNS-R>] <rrLabel> <rrType>
  */
-class Query : noncopyable
+class Query : boost::noncopyable
 {
 public:
   Query();
diff --git a/src/clients/response.cpp b/src/clients/response.cpp
index 3da172b..b183b1d 100644
--- a/src/clients/response.cpp
+++ b/src/clients/response.cpp
@@ -97,7 +97,7 @@
 {
   wire.parse();
   if (wire.elements().size() != 2) {
-    BOOST_THROW_EXCEPTION(Error("Unexpected number of components while decoding DOE record"));
+    NDN_THROW(Error("Unexpected number of elements while decoding DOE record"));
   }
   return std::make_pair(Name(wire.elements().front()), Name(wire.elements().back()));
 }
diff --git a/src/common.hpp b/src/common.hpp
index 92f9dec..ef77270 100644
--- a/src/common.hpp
+++ b/src/common.hpp
@@ -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-2020, Regents of the University of California.
  *
  * This file is part of NDNS (Named Data Networking Domain Name Service).
  * See AUTHORS.md for complete list of NDNS authors and contributors.
@@ -35,10 +35,8 @@
 #endif
 
 #include <ndn-cxx/name.hpp>
+#include <ndn-cxx/util/exception.hpp>
 
-#include <functional>
-#include <map>
 #include <boost/noncopyable.hpp>
-#include <boost/property_tree/ptree.hpp>
 
 #endif // NDNS_COMMON_HPP
diff --git a/src/daemon/config-file.cpp b/src/daemon/config-file.cpp
index a03937f..636a69e 100644
--- a/src/daemon/config-file.cpp
+++ b/src/daemon/config-file.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-2020,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -43,8 +43,8 @@
                                        const ConfigSection& section,
                                        bool isDryRun)
 {
-  BOOST_THROW_EXCEPTION(Error("Error processing configuration file " + filename +
-                              ": no module subscribed for section \"" + sectionName + "\""));
+  NDN_THROW(Error("Error processing configuration file " + filename +
+                  ": no module subscribed for section \"" + sectionName + "\""));
 }
 
 void
@@ -69,8 +69,8 @@
     return false;
   }
 
-  BOOST_THROW_EXCEPTION(Error("Invalid value \"" + value + "\" for option \"" +
-                              key + "\" in \"" + sectionName + "\" section"));
+  NDN_THROW(Error("Invalid value \"" + value + "\" for option \"" +
+                  key + "\" in \"" + sectionName + "\" section"));
 }
 
 void
@@ -85,7 +85,7 @@
 {
   std::ifstream inputFile(filename);
   if (!inputFile.good() || !inputFile.is_open()) {
-    BOOST_THROW_EXCEPTION(Error("Failed to read configuration file " + filename));
+    NDN_THROW(Error("Failed to read configuration file " + filename));
   }
   parse(inputFile, isDryRun, filename);
   inputFile.close();
@@ -105,8 +105,8 @@
     boost::property_tree::read_info(input, m_global);
   }
   catch (const boost::property_tree::info_parser_error& error) {
-    BOOST_THROW_EXCEPTION(Error("Failed to parse configuration file " + filename +
-                                ": " + error.message() + " on line " + to_string(error.line())));
+    NDN_THROW_NESTED(Error("Failed to parse configuration file " + filename +
+                           ": " + error.message() + " on line " + to_string(error.line())));
   }
 
   process(isDryRun, filename);
diff --git a/src/daemon/config-file.hpp b/src/daemon/config-file.hpp
index a177bfa..b17dfe6 100644
--- a/src/daemon/config-file.hpp
+++ b/src/daemon/config-file.hpp
@@ -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-2020,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -28,6 +28,8 @@
 
 #include "common.hpp"
 
+#include <boost/property_tree/ptree.hpp>
+
 namespace ndn {
 namespace ndns {
 
@@ -54,17 +56,13 @@
 
 /** \brief configuration file parsing utility
  */
-class ConfigFile : noncopyable
+class ConfigFile : boost::noncopyable
 {
 public:
   class Error : public std::runtime_error
   {
   public:
-    explicit
-    Error(const std::string& what)
-      : std::runtime_error(what)
-    {
-    }
+    using std::runtime_error::runtime_error;
   };
 
   explicit
@@ -115,8 +113,8 @@
     if (value) {
       return *value;
     }
-    BOOST_THROW_EXCEPTION(Error("Invalid value \"" + node.get_value<std::string>() +
-                                "\" for option \"" + key + "\" in \"" + sectionName + "\" section"));
+    NDN_THROW(Error("Invalid value \"" + node.get_value<std::string>() +
+                    "\" for option \"" + key + "\" in \"" + sectionName + "\" section"));
   }
 
   template <typename T>
diff --git a/src/daemon/db-mgr.cpp b/src/daemon/db-mgr.cpp
index da40d58..49dcfa9 100644
--- a/src/daemon/db-mgr.cpp
+++ b/src/daemon/db-mgr.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-2020, Regents of the University of California.
  *
  * This file is part of NDNS (Named Data Networking Domain Name Service).
  * See AUTHORS.md for complete list of NDNS authors and contributors.
@@ -85,7 +85,7 @@
 
   if (res != SQLITE_OK) {
     NDNS_LOG_FATAL("Cannot open the db file: " << m_dbFile);
-    BOOST_THROW_EXCEPTION(ConnectError("Cannot open the db file: " + m_dbFile));
+    NDN_THROW(ConnectError("Cannot open the db file: " + m_dbFile));
   }
 
   // ignore any errors from DB creation (command will fail for the existing database, which is ok)
@@ -116,7 +116,7 @@
   // sqlite3_step cannot execute multiple SQL statements
   int rc = sqlite3_exec(m_conn, sql, nullptr, nullptr, nullptr);
   if (rc != SQLITE_OK) {
-    BOOST_THROW_EXCEPTION(ExecuteError(sql));
+    NDN_THROW(ExecuteError(sql));
   }
 
   NDNS_LOG_INFO("clear all the data in the database: " << m_dbFile);
@@ -142,7 +142,7 @@
     name::Component component;
     std::tie(hasDecodingSucceeded, component) = Block::fromBuffer(buffer, nBytesLeft);
     if (!hasDecodingSucceeded) {
-      BOOST_THROW_EXCEPTION(Error("Error while decoding name from the database"));
+      NDN_THROW(Error("Error while decoding name from the database"));
     }
     name.append(component);
     buffer += component.size();
@@ -166,7 +166,7 @@
   const char* sql = "INSERT INTO zones (name, ttl) VALUES (?, ?)";
   int rc = sqlite3_prepare_v2(m_conn, sql, -1, &stmt, nullptr);
   if (rc != SQLITE_OK) {
-    BOOST_THROW_EXCEPTION(PrepareError(sql));
+    NDN_THROW(PrepareError(sql));
   }
 
   saveName(zone.getName(), stmt, 1);
@@ -175,7 +175,7 @@
   rc = sqlite3_step(stmt);
   if (rc != SQLITE_DONE) {
     sqlite3_finalize(stmt);
-    BOOST_THROW_EXCEPTION(ExecuteError(sql));
+    NDN_THROW(ExecuteError(sql));
   }
 
   zone.setId(sqlite3_last_insert_rowid(m_conn));
@@ -188,18 +188,18 @@
                    const Block& value)
 {
   if (zone.getId() == 0) {
-    BOOST_THROW_EXCEPTION(Error("zone has not been initialized"));
+    NDN_THROW(Error("zone has not been initialized"));
   }
 
   if (key.length() > 10) {
-    BOOST_THROW_EXCEPTION(Error("key length should not exceed 10"));
+    NDN_THROW(Error("key length should not exceed 10"));
   }
 
   sqlite3_stmt* stmt;
   const char* sql = "INSERT OR REPLACE INTO zone_info (zone_id, key, value) VALUES (?, ?, ?)";
   int rc = sqlite3_prepare_v2(m_conn, sql, -1, &stmt, nullptr);
   if (rc != SQLITE_OK) {
-    BOOST_THROW_EXCEPTION(PrepareError(sql));
+    NDN_THROW(PrepareError(sql));
   }
 
   sqlite3_bind_int(stmt,  1, zone.getId());
@@ -209,7 +209,7 @@
   rc = sqlite3_step(stmt);
   if (rc != SQLITE_DONE) {
     sqlite3_finalize(stmt);
-    BOOST_THROW_EXCEPTION(ExecuteError(sql));
+    NDN_THROW(ExecuteError(sql));
   }
 
   sqlite3_finalize(stmt);
@@ -226,14 +226,14 @@
   }
 
   if (zone.getId() == 0) {
-    BOOST_THROW_EXCEPTION(Error("zone has not been initialized"));
+    NDN_THROW(Error("zone has not been initialized"));
   }
 
   sqlite3_stmt* stmt;
   const char* sql = "SELECT key, value FROM zone_info WHERE zone_id=?";
   int rc = sqlite3_prepare_v2(m_conn, sql, -1, &stmt, nullptr);
   if (rc != SQLITE_OK) {
-    BOOST_THROW_EXCEPTION(PrepareError(sql));
+    NDN_THROW(PrepareError(sql));
   }
 
   sqlite3_bind_int(stmt, 1, zone.getId());
@@ -255,7 +255,7 @@
   const char* sql = "SELECT id, ttl FROM zones WHERE name=?";
   int rc = sqlite3_prepare_v2(m_conn, sql, -1, &stmt, nullptr);
   if (rc != SQLITE_OK) {
-    BOOST_THROW_EXCEPTION(PrepareError(sql));
+    NDN_THROW(PrepareError(sql));
   }
 
   saveName(zone.getName(), stmt, 1);
@@ -280,7 +280,7 @@
   const char* sql = "SELECT id, name, ttl FROM zones";
   int rc = sqlite3_prepare_v2(m_conn, sql, -1, &stmt, nullptr);
   if (rc != SQLITE_OK) {
-    BOOST_THROW_EXCEPTION(PrepareError(sql));
+    NDN_THROW(PrepareError(sql));
   }
 
   std::vector<Zone> vec;
@@ -307,7 +307,7 @@
   const char* sql = "DELETE FROM zones where id=?";
   int rc = sqlite3_prepare_v2(m_conn, sql, -1, &stmt, nullptr);
   if (rc != SQLITE_OK) {
-    BOOST_THROW_EXCEPTION(PrepareError(sql));
+    NDN_THROW(PrepareError(sql));
   }
 
   sqlite3_bind_int64(stmt, 1, zone.getId());
@@ -315,7 +315,7 @@
   rc = sqlite3_step(stmt);
   if (rc != SQLITE_DONE) {
     sqlite3_finalize(stmt);
-    BOOST_THROW_EXCEPTION(ExecuteError(sql));
+    NDN_THROW(ExecuteError(sql));
   }
 
   sqlite3_finalize(stmt);
@@ -334,7 +334,7 @@
     return;
 
   if (rrset.getZone() == nullptr) {
-    BOOST_THROW_EXCEPTION(RrsetError("Rrset has not been assigned to a zone"));
+    NDN_THROW(RrsetError("Rrset has not been assigned to a zone"));
   }
 
   if (rrset.getZone()->getId() == 0) {
@@ -348,7 +348,7 @@
   sqlite3_stmt* stmt;
   int rc = sqlite3_prepare_v2(m_conn, sql, -1, &stmt, nullptr);
   if (rc != SQLITE_OK) {
-    BOOST_THROW_EXCEPTION(PrepareError(sql));
+    NDN_THROW(PrepareError(sql));
   }
 
   sqlite3_bind_int64(stmt, 1, rrset.getZone()->getId());
@@ -362,7 +362,7 @@
   rc = sqlite3_step(stmt);
   if (rc != SQLITE_DONE) {
     sqlite3_finalize(stmt);
-    BOOST_THROW_EXCEPTION(ExecuteError(sql));
+    NDN_THROW(ExecuteError(sql));
   }
 
   rrset.setId(sqlite3_last_insert_rowid(m_conn));
@@ -373,7 +373,7 @@
 DbMgr::find(Rrset& rrset)
 {
   if (rrset.getZone() == nullptr) {
-    BOOST_THROW_EXCEPTION(RrsetError("Rrset has not been assigned to a zone"));
+    NDN_THROW(RrsetError("Rrset has not been assigned to a zone"));
   }
 
   if (rrset.getZone()->getId() == 0) {
@@ -389,7 +389,7 @@
     "    WHERE zone_id=? and label=? and type=?";
   int rc = sqlite3_prepare_v2(m_conn, sql, -1, &stmt, nullptr);
   if (rc != SQLITE_OK) {
-    BOOST_THROW_EXCEPTION(PrepareError(sql));
+    NDN_THROW(PrepareError(sql));
   }
 
   sqlite3_bind_int64(stmt, 1, rrset.getZone()->getId());
@@ -417,7 +417,7 @@
 DbMgr::findLowerBound(Rrset& rrset)
 {
   if (rrset.getZone() == nullptr) {
-    BOOST_THROW_EXCEPTION(RrsetError("Rrset has not been assigned to a zone"));
+    NDN_THROW(RrsetError("Rrset has not been assigned to a zone"));
   }
 
   if (rrset.getZone()->getId() == 0) {
@@ -433,7 +433,7 @@
     "    WHERE zone_id=? and label<? and type=? ORDER BY label DESC";
   int rc = sqlite3_prepare_v2(m_conn, sql, -1, &stmt, nullptr);
   if (rc != SQLITE_OK) {
-    BOOST_THROW_EXCEPTION(PrepareError(sql));
+    NDN_THROW(PrepareError(sql));
   }
 
   sqlite3_bind_int64(stmt, 1, rrset.getZone()->getId());
@@ -464,7 +464,7 @@
     find(zone);
 
   if (zone.getId() == 0)
-    BOOST_THROW_EXCEPTION(RrsetError("Attempting to find all the rrsets with a zone does not in the database"));
+    NDN_THROW(RrsetError("Attempting to find all the rrsets with a zone does not in the database"));
 
   std::vector<Rrset> vec;
   sqlite3_stmt* stmt;
@@ -473,7 +473,7 @@
 
   int rc = sqlite3_prepare_v2(m_conn, sql, -1, &stmt, nullptr);
   if (rc != SQLITE_OK) {
-    BOOST_THROW_EXCEPTION(PrepareError(sql));
+    NDN_THROW(PrepareError(sql));
   }
   sqlite3_bind_int64(stmt, 1, zone.getId());
 
@@ -503,13 +503,13 @@
     find(zone);
 
   if (zone.getId() == 0)
-    BOOST_THROW_EXCEPTION(RrsetError("Attempting to find all the rrsets with a zone does not in the database"));
+    NDN_THROW(RrsetError("Attempting to find all the rrsets with a zone does not in the database"));
 
   sqlite3_stmt* stmt;
   const char* sql = "DELETE FROM rrsets WHERE zone_id = ? AND type = ?";
   int rc = sqlite3_prepare_v2(m_conn, sql, -1, &stmt, nullptr);
   if (rc != SQLITE_OK) {
-    BOOST_THROW_EXCEPTION(PrepareError(sql));
+    NDN_THROW(PrepareError(sql));
   }
 
   sqlite3_bind_int64(stmt, 1, zone.getId());
@@ -518,7 +518,7 @@
   rc = sqlite3_step(stmt);
   if (rc != SQLITE_DONE) {
     sqlite3_finalize(stmt);
-    BOOST_THROW_EXCEPTION(ExecuteError(sql));
+    NDN_THROW(ExecuteError(sql));
   }
   sqlite3_finalize(stmt);
 }
@@ -527,13 +527,13 @@
 DbMgr::remove(Rrset& rrset)
 {
   if (rrset.getId() == 0)
-    BOOST_THROW_EXCEPTION(RrsetError("Attempting to remove Rrset that has no assigned id"));
+    NDN_THROW(RrsetError("Attempting to remove Rrset that has no assigned id"));
 
   sqlite3_stmt* stmt;
   const char* sql = "DELETE FROM rrsets WHERE id=?";
   int rc = sqlite3_prepare_v2(m_conn, sql, -1, &stmt, nullptr);
   if (rc != SQLITE_OK) {
-    BOOST_THROW_EXCEPTION(PrepareError(sql));
+    NDN_THROW(PrepareError(sql));
   }
 
   sqlite3_bind_int64(stmt, 1, rrset.getId());
@@ -541,7 +541,7 @@
   rc = sqlite3_step(stmt);
   if (rc != SQLITE_DONE) {
     sqlite3_finalize(stmt);
-    BOOST_THROW_EXCEPTION(ExecuteError(sql));
+    NDN_THROW(ExecuteError(sql));
   }
 
   sqlite3_finalize(stmt);
@@ -553,18 +553,18 @@
 DbMgr::update(Rrset& rrset)
 {
   if (rrset.getId() == 0) {
-    BOOST_THROW_EXCEPTION(RrsetError("Attempting to replace Rrset that has no assigned id"));
+    NDN_THROW(RrsetError("Attempting to replace Rrset that has no assigned id"));
   }
 
   if (rrset.getZone() == nullptr) {
-    BOOST_THROW_EXCEPTION(RrsetError("Rrset has not been assigned to a zone"));
+    NDN_THROW(RrsetError("Rrset has not been assigned to a zone"));
   }
 
   sqlite3_stmt* stmt;
   const char* sql = "UPDATE rrsets SET ttl=?, version=?, data=? WHERE id=?";
   int rc = sqlite3_prepare_v2(m_conn, sql, -1, &stmt, nullptr);
   if (rc != SQLITE_OK) {
-    BOOST_THROW_EXCEPTION(PrepareError(sql));
+    NDN_THROW(PrepareError(sql));
   }
 
   sqlite3_bind_int64(stmt, 1, rrset.getTtl().count());
diff --git a/src/daemon/db-mgr.hpp b/src/daemon/db-mgr.hpp
index a41380a..81ae5ad 100644
--- a/src/daemon/db-mgr.hpp
+++ b/src/daemon/db-mgr.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-2020, Regents of the University of California.
  *
  * This file is part of NDNS (Named Data Networking Domain Name Service).
  * See AUTHORS.md for complete list of NDNS authors and contributors.
@@ -20,7 +20,7 @@
 #ifndef NDNS_DAEMON_DB_MGR_HPP
 #define NDNS_DAEMON_DB_MGR_HPP
 
-#include "config.hpp"
+#include "common.hpp"
 #include "rrset.hpp"
 #include "zone.hpp"
 
@@ -46,7 +46,7 @@
  *
  * @note Method names follow MongoDB convention: insert/remove/find/update
  */
-class DbMgr : noncopyable
+class DbMgr : boost::noncopyable
 {
 public:
   /**
diff --git a/src/daemon/name-server.cpp b/src/daemon/name-server.cpp
index c1d3bfa..4e40b17 100644
--- a/src/daemon/name-server.cpp
+++ b/src/daemon/name-server.cpp
@@ -44,7 +44,7 @@
 
   if (m_zone.getId() == 0) {
     NDNS_LOG_FATAL("m_zone does not exist: " << zoneName);
-    BOOST_THROW_EXCEPTION(Error("Zone " + zoneName.toUri() + " does not exist in the database"));
+    NDN_THROW(Error("Zone " + zoneName.toUri() + " does not exist in the database"));
   }
 
   m_ndnsPrefix.append(ndns::label::NDNS_ITERATIVE_QUERY);
@@ -101,7 +101,7 @@
     doe.setType(label::DOE_RR_TYPE);
     if (!m_dbMgr.findLowerBound(doe)) {
         NDNS_LOG_FATAL("fail to find DoE record of zone:" + m_zone.getName().toUri());
-        BOOST_THROW_EXCEPTION(std::runtime_error("fail to find DoE record of zone:" + m_zone.getName().toUri()));
+        NDN_THROW(std::runtime_error("fail to find DoE record of zone:" + m_zone.getName().toUri()));
     }
 
     answer->setContent(doe.getData());
@@ -133,9 +133,9 @@
     }
     m_validator.validate(*data,
                          bind(&NameServer::doUpdate, this, interest.shared_from_this(), data),
-                         [] (const Data& data, const security::ValidationError& msg) {
+                         [] (const Data&, const security::ValidationError&) {
                            NDNS_LOG_WARN("Ignoring update that did not pass the verification. "
-                                         << "Check the root certificate");
+                                         "Check the root certificate");
                          });
   }
 }
@@ -144,8 +144,8 @@
 NameServer::onRegisterFailed(const ndn::Name& prefix, const std::string& reason)
 {
   NDNS_LOG_FATAL("fail to register prefix=" << prefix << ". Due to: " << reason);
-  BOOST_THROW_EXCEPTION(Error("zone " + m_zone.getName().toUri() + " register prefix: " +
-                              prefix.toUri() + " fails. due to: " + reason));
+  NDN_THROW(Error("zone " + m_zone.getName().toUri() + " register prefix: " +
+                  prefix.toUri() + " fails. due to: " + reason));
 }
 
 void
diff --git a/src/daemon/name-server.hpp b/src/daemon/name-server.hpp
index fd820e5..8a84f42 100644
--- a/src/daemon/name-server.hpp
+++ b/src/daemon/name-server.hpp
@@ -26,14 +26,12 @@
 #include "ndns-label.hpp"
 #include "ndns-tlv.hpp"
 #include "validator/validator.hpp"
-#include "common.hpp"
 
 #include <ndn-cxx/security/key-chain.hpp>
 #include <ndn-cxx/face.hpp>
 
 #include <boost/asio.hpp>
 #include <boost/bind.hpp>
-#include <boost/noncopyable.hpp>
 
 #include <sstream>
 #include <stdexcept>
@@ -46,7 +44,7 @@
  *
  * The authoritative name server handles NDNS query and update.
  */
-class NameServer : noncopyable
+class NameServer : boost::noncopyable
 {
   DEFINE_ERROR(Error, std::runtime_error);
 
diff --git a/src/daemon/rrset-factory.cpp b/src/daemon/rrset-factory.cpp
index 029e3b0..d0938a1 100644
--- a/src/daemon/rrset-factory.cpp
+++ b/src/daemon/rrset-factory.cpp
@@ -52,7 +52,7 @@
   Name zoneIdentityName = Name(m_zone.getName()).append(label::NDNS_ITERATIVE_QUERY);
   if (m_dskCertName != DEFAULT_CERT &&
       !matchCertificate(m_dskCertName, zoneIdentityName)) {
-    BOOST_THROW_EXCEPTION(Error("Cannot verify certificate"));
+    NDN_THROW(Error("Cannot verify certificate"));
   }
 }
 
@@ -67,7 +67,7 @@
   DbMgr dbMgr(m_dbFile);
   const Name& zoneName = m_zone.getName();
   if (!dbMgr.find(m_zone)) {
-    BOOST_THROW_EXCEPTION(Error(zoneName.toUri() + " is not presented in the NDNS db"));
+    NDN_THROW(Error(zoneName.toUri() + " is not presented in the NDNS db"));
   }
 }
 
@@ -120,7 +120,7 @@
                               const ndn::DelegationList& delegations)
 {
   if (!m_checked) {
-    BOOST_THROW_EXCEPTION(Error("You have to call checkZoneKey before call generate functions"));
+    NDN_THROW(Error("You have to call checkZoneKey before call generate functions"));
   }
 
   if (ttl == DEFAULT_RR_TTL)
@@ -147,7 +147,7 @@
                                const std::vector<std::string>& strings)
 {
   if (!m_checked) {
-    BOOST_THROW_EXCEPTION(Error("You have to call checkZoneKey before call generate functions"));
+    NDN_THROW(Error("You have to call checkZoneKey before call generate functions"));
   }
 
   if (ttl == DEFAULT_RR_TTL)
@@ -181,7 +181,7 @@
                                 const ndn::security::Certificate& cert)
 {
   if (!m_checked) {
-    BOOST_THROW_EXCEPTION(Error("You have to call checkZoneKey before call generate functions"));
+    NDN_THROW(Error("You have to call checkZoneKey before call generate functions"));
   }
 
   if (ttl == DEFAULT_RR_TTL)
@@ -207,7 +207,7 @@
                                 time::seconds ttl)
 {
   if (!m_checked) {
-    BOOST_THROW_EXCEPTION(Error("You have to call checkZoneKey before call generate functions"));
+    NDN_THROW(Error("You have to call checkZoneKey before call generate functions"));
   }
 
   if (ttl == DEFAULT_RR_TTL)
@@ -234,7 +234,7 @@
                                const Name& upperLabel)
 {
   if (!m_checked) {
-    BOOST_THROW_EXCEPTION(Error("You have to call checkZoneKey before call generate functions"));
+    NDN_THROW(Error("You have to call checkZoneKey before call generate functions"));
   }
 
   if (ttl == DEFAULT_RR_TTL)
diff --git a/src/daemon/rrset-factory.hpp b/src/daemon/rrset-factory.hpp
index 1773fe0..bab99ca 100644
--- a/src/daemon/rrset-factory.hpp
+++ b/src/daemon/rrset-factory.hpp
@@ -20,7 +20,6 @@
 #ifndef NDNS_DAEMON_RRSET_FACTORY_HPP
 #define NDNS_DAEMON_RRSET_FACTORY_HPP
 
-#include "common.hpp"
 #include "rrset.hpp"
 #include "logger.hpp"
 #include "daemon/db-mgr.hpp"
@@ -29,9 +28,7 @@
 #include <ndn-cxx/link.hpp>
 #include <ndn-cxx/security/key-chain.hpp>
 
-#include <vector>
-#include <string>
-#include <boost/filesystem.hpp>
+#include <boost/filesystem/path.hpp>
 
 namespace ndn {
 namespace ndns {
@@ -44,10 +41,7 @@
   class Error : public std::runtime_error
   {
   public:
-    explicit
-    Error(const std::string& what) : std::runtime_error(what)
-    {
-    }
+    using std::runtime_error::runtime_error;
   };
 
 public:
@@ -138,4 +132,3 @@
 } // namespace ndn
 
 #endif // NDNS_DAEMON_RRSET_FACTORY_HPP
-
diff --git a/src/daemon/rrset.cpp b/src/daemon/rrset.cpp
index 75c4d81..5c95a8f 100644
--- a/src/daemon/rrset.cpp
+++ b/src/daemon/rrset.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-2020, Regents of the University of California.
  *
  * This file is part of NDNS (Named Data Networking Domain Name Service).
  * See AUTHORS.md for complete list of NDNS authors and contributors.
@@ -62,7 +62,7 @@
 {
   if (getZone() != other.getZone() ||
       (getZone() != nullptr && *getZone() != *other.getZone())) {
-    BOOST_THROW_EXCEPTION(std::runtime_error("Cannot compare Rrset that belong to different zones"));
+    NDN_THROW(std::runtime_error("Cannot compare Rrset that belong to different zones"));
   }
 
   bool isLess = getLabel() < other.getLabel();
diff --git a/src/daemon/zone.hpp b/src/daemon/zone.hpp
index e3a15d4..854523a 100644
--- a/src/daemon/zone.hpp
+++ b/src/daemon/zone.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California.
+/*
+ * Copyright (c) 2014-2020, Regents of the University of California.
  *
  * This file is part of NDNS (Named Data Networking Domain Name Service).
  * See AUTHORS.md for complete list of NDNS authors and contributors.
@@ -20,9 +20,7 @@
 #ifndef NDNS_DAEMON_ZONE_HPP
 #define NDNS_DAEMON_ZONE_HPP
 
-#include <ndn-cxx/name.hpp>
-
-#include <iostream>
+#include "common.hpp"
 
 namespace ndn {
 namespace ndns {
@@ -32,8 +30,8 @@
  * @see http://en.wikipedia.org/wiki/DNS_zone
  * @see http://irl.cs.ucla.edu/data/files/theses/afanasyev-thesis.pdf
  *
- * The class is copyable, since it may be assigned to another Zone instance
- *  when resolving Response or Query from database
+ * This class is copyable, since it may be assigned to another Zone instance
+ * when resolving Response or Query from database
  */
 class Zone
 {
diff --git a/src/mgmt/management-tool.cpp b/src/mgmt/management-tool.cpp
index 9f363dc..6d34997 100644
--- a/src/mgmt/management-tool.cpp
+++ b/src/mgmt/management-tool.cpp
@@ -23,8 +23,8 @@
 #include "ndns-tlv.hpp"
 #include "util/cert-helper.hpp"
 
-#include <string>
 #include <iomanip>
+#include <iostream>
 
 #include <boost/filesystem/operations.hpp>
 #include <boost/filesystem/path.hpp>
@@ -72,31 +72,31 @@
   //check preconditions
   Zone zone(zoneName, cacheTtl);
   if (m_dbMgr.find(zone)) {
-    BOOST_THROW_EXCEPTION(Error(zoneName.toUri() + " is already presented in the NDNS db"));
+    NDN_THROW(Error(zoneName.toUri() + " is already present in the NDNS db"));
   }
 
   if (!isRoot && parentZoneName.equals(zoneName)) {
-    BOOST_THROW_EXCEPTION(Error("Parent zone name can not be the zone itself"));
+    NDN_THROW(Error("Parent zone name can not be the zone itself"));
   }
 
   if (!isRoot && !parentZoneName.isPrefixOf(zoneName)) {
-    BOOST_THROW_EXCEPTION(Error(parentZoneName.toUri() + " is not a prefix of " + zoneName.toUri()));
+    NDN_THROW(Error(parentZoneName.toUri() + " is not a prefix of " + zoneName.toUri()));
   }
 
   // if dsk is provided, there is no need to check ksk
   if (dskCertName != DEFAULT_CERT) {
     if (!matchCertificate(dskCertName, zoneIdentityName)) {
-      BOOST_THROW_EXCEPTION(Error("Cannot verify DSK certificate"));
+      NDN_THROW(Error("Cannot verify DSK certificate"));
     }
   }
   else if (kskCertName != DEFAULT_CERT) {
     if (!matchCertificate(kskCertName, zoneIdentityName)) {
-      BOOST_THROW_EXCEPTION(Error("Cannot verify KSK certificate"));
+      NDN_THROW(Error("Cannot verify KSK certificate"));
     }
   }
 
   if (dkeyCertName == DEFAULT_CERT && isRoot) {
-    BOOST_THROW_EXCEPTION(Error("Cannot generate dkey for root zone"));
+    NDN_THROW(Error("Cannot generate dkey for root zone"));
   }
 
   // Generate a parentZone's identity to generate a D-Key.
@@ -196,7 +196,7 @@
   //check pre-conditions
   Zone zone(zoneName);
   if (!m_dbMgr.find(zone)) {
-    BOOST_THROW_EXCEPTION(Error(zoneName.toUri() + " is not presented in the NDNS db"));
+    NDN_THROW(Error(zoneName.toUri() + " is not present in the NDNS db"));
   }
 
   //first remove all rrsets of this zone from local ndns database
@@ -216,7 +216,7 @@
   security::Certificate cert;
   shared_ptr<Regex> regex = make_shared<Regex>("(<>*)<NDNS>(<>+)<CERT><>");
   if (!regex->match(certName)) {
-    BOOST_THROW_EXCEPTION(Error("Certificate name is illegal"));
+    NDN_THROW(Error("Certificate name is illegal"));
     return;
   }
 
@@ -232,7 +232,7 @@
     cert = security::Certificate(rrset.getData());
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("Cannot find the cert: " + certName.toUri()));
+    NDN_THROW(Error("Cannot find the cert: " + certName.toUri()));
   }
 
   if (outFile == DEFAULT_IO) {
@@ -260,7 +260,7 @@
     if (m_dbMgr.find(prefixNsRr)) {
       Data data(prefixNsRr.getData());
       if (data.getContentType() == NDNS_LINK) {
-        BOOST_THROW_EXCEPTION(Error("Cannot override " + boost::lexical_cast<std::string>(prefixNsRr) + " (NDNS_LINK)"));
+        NDN_THROW(Error("Cannot override " + boost::lexical_cast<std::string>(prefixNsRr) + " (NDNS_LINK)"));
       }
     }
   }
@@ -270,7 +270,7 @@
     Rrset rrsetCopy = rrset;
     if (m_dbMgr.find(rrsetCopy)) {
       if (Data(rrsetCopy.getData()).getContentType() == NDNS_AUTH) {
-        BOOST_THROW_EXCEPTION(Error("Cannot override " + boost::lexical_cast<std::string>(rrsetCopy) + " (NDNS_AUTH)"));
+        NDN_THROW(Error("Cannot override " + boost::lexical_cast<std::string>(rrsetCopy) + " (NDNS_AUTH)"));
       }
     }
   }
@@ -305,7 +305,7 @@
   rrsetCopy.setType(label::NS_RR_TYPE);
   if (m_dbMgr.find(rrsetCopy)) {
     if (Data(rrsetCopy.getData()).getContentType() == NDNS_AUTH) {
-      BOOST_THROW_EXCEPTION(Error("Can not add this Rrset: it overrides a NDNS_AUTH record"));
+      NDN_THROW(Error("Can not add this Rrset: it overrides a NDNS_AUTH record"));
     }
   }
 
@@ -327,7 +327,7 @@
   Zone zone(zoneName);
   Name zoneIdentityName = Name(zoneName).append(label::NDNS_ITERATIVE_QUERY);
   if (!m_dbMgr.find(zone)) {
-    BOOST_THROW_EXCEPTION(Error(zoneName.toUri() + " is not presented in the NDNS db"));
+    NDN_THROW(Error(zoneName.toUri() + " is not present in the NDNS db"));
   }
 
   Name dskName;
@@ -338,14 +338,14 @@
   }
   else {
     if (!matchCertificate(dskCertName, zoneIdentityName)) {
-      BOOST_THROW_EXCEPTION(Error("Cannot verify certificate"));
+      NDN_THROW(Error("Cannot verify certificate"));
     }
   }
 
   if (inFile != DEFAULT_IO) {
     boost::filesystem::path dir = boost::filesystem::path(inFile);
     if (!boost::filesystem::exists(dir) || boost::filesystem::is_directory(dir)) {
-      BOOST_THROW_EXCEPTION(Error("Data: " + inFile + " does not exist"));
+      NDN_THROW(Error("Data: " + inFile + " does not exist"));
     }
   }
 
@@ -357,7 +357,7 @@
     data = ndn::io::load<ndn::Data>(inFile, encoding);
 
   if (data == nullptr) {
-    BOOST_THROW_EXCEPTION(Error("input does not contain a valid Data packet"));
+    NDN_THROW(Error("input does not contain a valid Data packet"));
   }
 
   if (needResign) {
@@ -402,7 +402,7 @@
 {
   Zone zone(zoneName);
   if (!m_dbMgr.find(zone)) {
-    BOOST_THROW_EXCEPTION(Error("Zone " + zoneName.toUri() + " is not found in the database"));
+    NDN_THROW(Error("Zone " + zoneName.toUri() + " is not found in the database"));
   }
 
   //first output the zone name
@@ -593,8 +593,8 @@
   rrsetKey.setData(cert.wireEncode());
 
   if (m_dbMgr.find(rrsetKey)) {
-    BOOST_THROW_EXCEPTION(Error("CERT with label=" + label.toUri() +
-                                " is already presented in local NDNS databse"));
+    NDN_THROW(Error("CERT with label=" + label.toUri() +
+                    " is already present in local NDNS database"));
   }
 
   m_dbMgr.insert(rrsetKey);
@@ -606,8 +606,8 @@
 ManagementTool::addZone(Zone& zone)
 {
   if (m_dbMgr.find(zone)) {
-    BOOST_THROW_EXCEPTION(Error("Zone with Name=" + zone.getName().toUri() +
-                                " is already presented in local NDNS databse"));
+    NDN_THROW(Error("Zone with Name=" + zone.getName().toUri() +
+                    " is already present in local NDNS database"));
   }
   NDNS_LOG_INFO("Add zone with Name: " << zone.getName().toUri());
   m_dbMgr.insert(zone);
@@ -644,12 +644,10 @@
   if (m_dbMgr.find(originalRrset)) {
     // update only if rrset has a newer version
     if (originalRrset.getVersion() == rrset.getVersion()) {
-      BOOST_THROW_EXCEPTION(Error("Duplicate: "
-                                  + boost::lexical_cast<std::string>(originalRrset)));
+      NDN_THROW(Error("Duplicate: " + boost::lexical_cast<std::string>(originalRrset)));
     }
     else if (originalRrset.getVersion() > rrset.getVersion()) {
-      BOOST_THROW_EXCEPTION(Error("Newer version exists: "
-                                  + boost::lexical_cast<std::string>(originalRrset)));
+      NDN_THROW(Error("Newer version exists: " + boost::lexical_cast<std::string>(originalRrset)));
     }
 
     m_dbMgr.remove(originalRrset);
@@ -661,7 +659,7 @@
 {
   // check zone existence
   if (!m_dbMgr.find(zone)) {
-    BOOST_THROW_EXCEPTION(Error(zone.getName().toUri() + " is not presented in the NDNS db"));
+    NDN_THROW(Error(zone.getName().toUri() + " is not present in the NDNS db"));
   }
 
   // remove all the Doe records
diff --git a/src/mgmt/management-tool.hpp b/src/mgmt/management-tool.hpp
index 5b9b51e..ba00458 100644
--- a/src/mgmt/management-tool.hpp
+++ b/src/mgmt/management-tool.hpp
@@ -20,7 +20,6 @@
 #ifndef NDNS_MGMT_MANAGEMENT_TOOL_HPP
 #define NDNS_MGMT_MANAGEMENT_TOOL_HPP
 
-#include "config.hpp"
 #include "ndns-enum.hpp"
 #include "clients/response.hpp"
 #include "daemon/db-mgr.hpp"
@@ -49,7 +48,7 @@
  * @brief provides management tools to the NDNS system, such as zone creation, zone delegation, DSK
  * generation and root zone creation.
  */
-class ManagementTool : noncopyable
+class ManagementTool : boost::noncopyable
 {
 public:
   /** @brief Represents an error might be thrown during runtime
@@ -57,10 +56,7 @@
   class Error : public std::runtime_error
   {
   public:
-    explicit
-    Error(const std::string& what) : std::runtime_error(what)
-    {
-    }
+    using std::runtime_error::runtime_error;
   };
 
   /**
diff --git a/src/util/cert-helper.cpp b/src/util/cert-helper.cpp
index 164a34f..ae33e00 100644
--- a/src/util/cert-helper.cpp
+++ b/src/util/cert-helper.cpp
@@ -52,7 +52,7 @@
       }
     }
   }
-  BOOST_THROW_EXCEPTION(std::runtime_error(certName.toUri() + " does not exist"));
+  NDN_THROW(std::runtime_error(certName.toUri() + " does not exist"));
 }
 
 Name
@@ -64,7 +64,7 @@
       return certName.getPrefix(i);
     }
   }
-  BOOST_THROW_EXCEPTION(std::runtime_error(certName.toUri() + " is not a legal cert name"));
+  NDN_THROW(std::runtime_error(certName.toUri() + " is not a legal cert name"));
 }
 
 security::Certificate
diff --git a/src/validator/certificate-fetcher-ndns-appcert.cpp b/src/validator/certificate-fetcher-ndns-appcert.cpp
index 81f31c6..966f7de 100644
--- a/src/validator/certificate-fetcher-ndns-appcert.cpp
+++ b/src/validator/certificate-fetcher-ndns-appcert.cpp
@@ -45,21 +45,19 @@
                                    const ValidationContinuation& continueValidation)
 {
   const Name& key = certRequest->interest.getName();
-  auto query = make_shared<IterativeQueryController>(key,
-                                                     label::APPCERT_RR_TYPE,
-                                                     certRequest->interest.getInterestLifetime(),
-                                                     [=] (const Data& data, const Response& response) {
-                                                       onQuerySuccessCallback(data, certRequest, state, continueValidation);
-                                                     },
-                                                     [=] (uint32_t errCode, const std::string& errMsg) {
-                                                       onQueryFailCallback(errMsg, certRequest, state, continueValidation);
-                                                     },
-                                                     m_face,
-                                                     nullptr,
-                                                     m_nsCache);
+  auto query = std::make_shared<IterativeQueryController>(key, label::APPCERT_RR_TYPE,
+    certRequest->interest.getInterestLifetime(),
+    [=] (const Data& data, const Response&) {
+      onQuerySuccessCallback(data, certRequest, state, continueValidation);
+    },
+    [=] (uint32_t errCode, const std::string& errMsg) {
+      onQueryFailCallback(errMsg, certRequest, state, continueValidation);
+    },
+    m_face, nullptr, m_nsCache);
   query->setStartComponentIndex(m_startComponentIndex);
   query->start();
-  state->setTag(make_shared<IterativeQueryTag>(query));
+
+  state->setTag(std::make_shared<IterativeQueryTag>(query));
 }
 
 void
diff --git a/src/validator/certificate-fetcher-ndns-cert.cpp b/src/validator/certificate-fetcher-ndns-cert.cpp
index b1979b5..34c0774 100644
--- a/src/validator/certificate-fetcher-ndns-cert.cpp
+++ b/src/validator/certificate-fetcher-ndns-cert.cpp
@@ -57,22 +57,19 @@
     return;
   }
 
-  auto query = std::make_shared<IterativeQueryController>(domain,
-                                                          label::NS_RR_TYPE,
-                                                          certRequest->interest.getInterestLifetime(),
-                                                          [=] (const Data& data, const Response& response) {
-                                                            nsSuccessCallback(data, certRequest, state, continueValidation);
-                                                          },
-                                                          [=] (uint32_t errCode, const std::string& errMsg) {
-                                                            nsFailCallback(errMsg, certRequest, state, continueValidation);
-                                                          },
-                                                          m_face,
-                                                          nullptr,
-                                                          m_nsCache.get());
+  auto query = std::make_shared<IterativeQueryController>(domain, label::NS_RR_TYPE,
+    certRequest->interest.getInterestLifetime(),
+    [=] (const Data& data, const Response&) {
+      nsSuccessCallback(data, certRequest, state, continueValidation);
+    },
+    [=] (uint32_t errCode, const std::string& errMsg) {
+      nsFailCallback(errMsg, certRequest, state, continueValidation);
+    },
+    m_face, nullptr, m_nsCache.get());
   query->setStartComponentIndex(m_startComponentIndex);
   query->start();
-  auto queryTag = make_shared<IterativeQueryTag>(query);
-  state->setTag(queryTag);
+
+  state->setTag(std::make_shared<IterativeQueryTag>(query));
 }
 
 void
@@ -100,13 +97,13 @@
   }
 
   m_face.expressInterest(interest,
-                         [=] (const Interest& interest, const Data& data) {
+                         [=] (const Interest&, const Data& data) {
                            dataCallback(data, certRequest, state, continueValidation);
                          },
-                         [=] (const Interest& interest, const lp::Nack& nack) {
+                         [=] (const Interest&, const lp::Nack& nack) {
                            nackCallback(nack, certRequest, state, continueValidation);
                          },
-                         [=] (const Interest& interest) {
+                         [=] (const Interest&) {
                            timeoutCallback(certRequest, state, continueValidation);
                          });
 }
@@ -143,7 +140,7 @@
       return key.getPrefix(i);
     }
   }
-  BOOST_THROW_EXCEPTION(std::runtime_error(key.toUri() + " is not a legal NDNS certificate name"));
+  NDN_THROW(std::runtime_error(key.toUri() + " is not a legal NDNS certificate name"));
 }
 
 void
