diff --git a/src/adjacency-list.cpp b/src/adjacency-list.cpp
index 4b732a4..fd2fd46 100644
--- a/src/adjacency-list.cpp
+++ b/src/adjacency-list.cpp
@@ -235,8 +235,8 @@
 {
   std::list<Adjacent>::iterator it = std::find_if(m_adjList.begin(),
                                                   m_adjList.end(),
-                                                  ndn::bind(&Adjacent::compare,
-                                                            _1, ndn::cref(adjName)));
+                                                  std::bind(&Adjacent::compare,
+                                                            _1, std::cref(adjName)));
   return it;
 }
 
@@ -245,8 +245,8 @@
 {
   std::list<Adjacent>::iterator it = std::find_if(m_adjList.begin(),
                                                   m_adjList.end(),
-                                                  ndn::bind(&Adjacent::compare,
-                                                            _1, ndn::cref(adjName)));
+                                                  std::bind(&Adjacent::compare,
+                                                            _1, std::cref(adjName)));
   if (it != m_adjList.end()) {
     return &(*it);
   }
@@ -259,7 +259,7 @@
 {
   std::list<Adjacent>::iterator it = std::find_if(m_adjList.begin(),
                                                   m_adjList.end(),
-                                                  ndn::bind(&Adjacent::compareFaceId,
+                                                  std::bind(&Adjacent::compareFaceId,
                                                             _1, faceId));
   if (it != m_adjList.end()) {
     return &(*it);
@@ -273,7 +273,7 @@
 {
   std::list<Adjacent>::iterator it = std::find_if(m_adjList.begin(),
                                                   m_adjList.end(),
-                                                  ndn::bind(&Adjacent::compareFaceUri,
+                                                  std::bind(&Adjacent::compareFaceUri,
                                                             _1, faceUri));
   if (it != m_adjList.end()) {
     return it->getFaceId();
diff --git a/src/communication/sync-logic-handler.cpp b/src/communication/sync-logic-handler.cpp
index 7c00d37..0e40809 100644
--- a/src/communication/sync-logic-handler.cpp
+++ b/src/communication/sync-logic-handler.cpp
@@ -69,7 +69,7 @@
     int32_t lsaPosition = util::getNameComponentPosition(m_name, LSA_COMPONENT);
 
     if (nlsrPosition < 0 || lsaPosition < 0) {
-      throw Error("Cannot parse update name because expected components are missing");
+      BOOST_THROW_EXCEPTION(Error("Cannot parse update name because expected components are missing"));
     }
 
     ndn::Name networkName = m_name.getSubName(1, nlsrPosition-1);
@@ -154,12 +154,12 @@
 
   // The face's lifetime is managed in main.cpp; SyncSocket should not manage the memory
   // of the object
-  ndn::shared_ptr<ndn::Face> facePtr(&m_syncFace, NullDeleter<ndn::Face>());
+  std::shared_ptr<ndn::Face> facePtr(&m_syncFace, NullDeleter<ndn::Face>());
 
-  m_syncSocket = ndn::make_shared<Sync::SyncSocket>(m_syncPrefix, m_validator, facePtr,
-                                                    ndn::bind(&SyncLogicHandler::onNsyncUpdate,
+  m_syncSocket = std::make_shared<Sync::SyncSocket>(m_syncPrefix, m_validator, facePtr,
+                                                    std::bind(&SyncLogicHandler::onNsyncUpdate,
                                                               this, _1, _2),
-                                                    ndn::bind(&SyncLogicHandler::onNsyncRemoval,
+                                                    std::bind(&SyncLogicHandler::onNsyncRemoval,
                                                               this, _1));
 }
 
@@ -191,7 +191,7 @@
   try {
     originRouter = update.getOriginRouter();
   }
-  catch (std::exception& e) {
+  catch (const std::exception& e) {
     _LOG_WARN("Received malformed sync update");
     return;
   }
@@ -275,7 +275,7 @@
   if (m_syncSocket == nullptr) {
     _LOG_FATAL("Cannot publish routing update; SyncSocket does not exist");
 
-    throw SyncLogicHandler::Error("Cannot publish routing update; SyncSocket does not exist");
+    BOOST_THROW_EXCEPTION(SyncLogicHandler::Error("Cannot publish routing update; SyncSocket does not exist"));
   }
 
   m_sequencingManager.writeSeqNoToFile();
diff --git a/src/communication/sync-logic-handler.hpp b/src/communication/sync-logic-handler.hpp
index 955a9c1..5e0e6a8 100644
--- a/src/communication/sync-logic-handler.hpp
+++ b/src/communication/sync-logic-handler.hpp
@@ -29,6 +29,7 @@
 #include <iostream>
 #include <unistd.h>
 #include <boost/cstdint.hpp>
+#include <boost/throw_exception.hpp>
 
 #include "test-access-control.hpp"
 
@@ -90,9 +91,9 @@
   publishSyncUpdate(const ndn::Name& updatePrefix, uint64_t seqNo);
 
 private:
-  ndn::shared_ptr<ndn::ValidatorNull> m_validator;
+  std::shared_ptr<ndn::ValidatorNull> m_validator;
   ndn::Face& m_syncFace;
-  ndn::shared_ptr<Sync::SyncSocket> m_syncSocket;
+  std::shared_ptr<Sync::SyncSocket> m_syncSocket;
   ndn::Name m_syncPrefix;
 
 private:
@@ -111,4 +112,4 @@
 
 } // namespace nlsr
 
-#endif //NLSR_SYNC_LOGIC_HANDLER_HPP
+#endif // NLSR_SYNC_LOGIC_HANDLER_HPP
diff --git a/src/conf-file-processor.cpp b/src/conf-file-processor.cpp
index 8621a02..70600fb 100644
--- a/src/conf-file-processor.cpp
+++ b/src/conf-file-processor.cpp
@@ -45,7 +45,7 @@
 class ConfigurationVariable
 {
 public:
-  typedef ndn::function<void(T)> ConfParameterCallback;
+  typedef std::function<void(T)> ConfParameterCallback;
   typedef boost::property_tree::ptree ConfigSection;
 
   ConfigurationVariable(const std::string& key, const ConfParameterCallback& setter)
@@ -446,7 +446,7 @@
   // Event intervals
   // adj-lsa-build-interval
   ConfigurationVariable<uint32_t> adjLsaBuildInterval("adj-lsa-build-interval",
-                                                      bind(&ConfParameter::setAdjLsaBuildInterval,
+                                                      std::bind(&ConfParameter::setAdjLsaBuildInterval,
                                                       &m_nlsr.getConfParameter(), _1));
   adjLsaBuildInterval.setMinAndMaxValue(ADJ_LSA_BUILD_INTERVAL_MIN, ADJ_LSA_BUILD_INTERVAL_MAX);
   adjLsaBuildInterval.setOptional(ADJ_LSA_BUILD_INTERVAL_DEFAULT);
@@ -457,7 +457,7 @@
 
   // first-hello-interval
   ConfigurationVariable<uint32_t> firstHelloInterval("first-hello-interval",
-                                                     bind(&ConfParameter::setFirstHelloInterval,
+                                                     std::bind(&ConfParameter::setFirstHelloInterval,
                                                      &m_nlsr.getConfParameter(), _1));
   firstHelloInterval.setMinAndMaxValue(FIRST_HELLO_INTERVAL_MIN, FIRST_HELLO_INTERVAL_MAX);
   firstHelloInterval.setOptional(FIRST_HELLO_INTERVAL_DEFAULT);
@@ -569,7 +569,7 @@
 
   // routing-calc-interval
   ConfigurationVariable<uint32_t> routingCalcInterval("routing-calc-interval",
-                                                      bind(&ConfParameter::setRoutingCalcInterval,
+                                                      std::bind(&ConfParameter::setRoutingCalcInterval,
                                                       &m_nlsr.getConfParameter(), _1));
   routingCalcInterval.setMinAndMaxValue(ROUTING_CALC_INTERVAL_MIN, ROUTING_CALC_INTERVAL_MAX);
   routingCalcInterval.setOptional(ROUTING_CALC_INTERVAL_DEFAULT);
@@ -635,7 +635,7 @@
 
       std::string file = it->second.data();
       path certfilePath = absolute(file, path(m_confFileName).parent_path());
-      shared_ptr<ndn::IdentityCertificate> idCert =
+      std::shared_ptr<ndn::IdentityCertificate> idCert =
         ndn::io::load<ndn::IdentityCertificate>(certfilePath.string());
 
       if (idCert == nullptr) {
diff --git a/src/hello-protocol.cpp b/src/hello-protocol.cpp
index c8fc724..5e29223 100644
--- a/src/hello-protocol.cpp
+++ b/src/hello-protocol.cpp
@@ -42,10 +42,10 @@
   i.setInterestLifetime(ndn::time::seconds(seconds));
   i.setMustBeFresh(true);
   m_nlsr.getNlsrFace().expressInterest(i,
-                                       ndn::bind(&HelloProtocol::onContent,
+                                       std::bind(&HelloProtocol::onContent,
                                                  this,
                                                  _1, _2),
-                                       ndn::bind(&HelloProtocol::processInterestTimedOut,
+                                       std::bind(&HelloProtocol::processInterestTimedOut,
                                                  this, _1));
 }
 
@@ -57,7 +57,7 @@
        ++it) {
     // If this adjacency has a Face, just proceed as usual.
     if((*it).getFaceId() != 0) {
-      /* interest name: /<neighbor>/NLSR/INFO/<router> */
+      // interest name: /<neighbor>/NLSR/INFO/<router>
       ndn::Name interestName = (*it).getName() ;
       interestName.append(NLSR_COMPONENT);
       interestName.append(INFO_COMPONENT);
@@ -82,14 +82,14 @@
   _LOG_DEBUG("Scheduling HELLO Interests in " << ndn::time::seconds(seconds));
 
   m_scheduler.scheduleEvent(ndn::time::seconds(seconds),
-                            ndn::bind(&HelloProtocol::sendScheduledInterest, this, seconds));
+                            std::bind(&HelloProtocol::sendScheduledInterest, this, seconds));
 }
 
 void
 HelloProtocol::processInterest(const ndn::Name& name,
                                const ndn::Interest& interest)
 {
-  /* interest name: /<neighbor>/NLSR/INFO/<router> */
+  // interest name: /<neighbor>/NLSR/INFO/<router>
   const ndn::Name interestName = interest.getName();
   _LOG_DEBUG("Interest Received for Name: " << interestName);
   if (interestName.get(-2).toUri() != INFO_COMPONENT) {
@@ -99,7 +99,7 @@
   neighbor.wireDecode(interestName.get(-1).blockFromValue());
   _LOG_DEBUG("Neighbor: " << neighbor);
   if (m_nlsr.getAdjacencyList().isNeighbor(neighbor)) {
-    ndn::shared_ptr<ndn::Data> data = ndn::make_shared<ndn::Data>();
+    std::shared_ptr<ndn::Data> data = std::make_shared<ndn::Data>();
     data->setName(ndn::Name(interest.getName()).appendVersion());
     data->setFreshnessPeriod(ndn::time::seconds(10)); // 10 sec
     data->setContent(reinterpret_cast<const uint8_t*>(INFO_COMPONENT.c_str()),
@@ -112,7 +112,7 @@
     if (adjacent->getStatus() == Adjacent::STATUS_INACTIVE) {
       // We can only do that if the neighbor currently has a face.
       if(adjacent->getFaceId() != 0){
-        /* interest name: /<neighbor>/NLSR/INFO/<router> */
+        // interest name: /<neighbor>/NLSR/INFO/<router>
         ndn::Name interestName(neighbor);
         interestName.append(NLSR_COMPONENT);
         interestName.append(INFO_COMPONENT);
@@ -133,7 +133,7 @@
 void
 HelloProtocol::processInterestTimedOut(const ndn::Interest& interest)
 {
-  /* interest name: /<neighbor>/NLSR/INFO/<router> */
+  // interest name: /<neighbor>/NLSR/INFO/<router>
   const ndn::Name interestName(interest.getName());
   _LOG_DEBUG("Interest timed out for Name: " << interestName);
   if (interestName.get(-2).toUri() != INFO_COMPONENT) {
@@ -150,7 +150,7 @@
   _LOG_DEBUG("Status: " << status);
   _LOG_DEBUG("Info Interest Timed out: " << infoIntTimedOutCount);
   if ((infoIntTimedOutCount < m_nlsr.getConfParameter().getInterestRetryNumber())) {
-    /* interest name: /<neighbor>/NLSR/INFO/<router> */
+    // interest name: /<neighbor>/NLSR/INFO/<router>
     ndn::Name interestName(neighbor);
     interestName.append(NLSR_COMPONENT);
     interestName.append(INFO_COMPONENT);
@@ -179,8 +179,8 @@
     }
   }
   m_nlsr.getValidator().validate(data,
-                                 ndn::bind(&HelloProtocol::onContentValidated, this, _1),
-                                 ndn::bind(&HelloProtocol::onContentValidationFailed,
+                                 std::bind(&HelloProtocol::onContentValidated, this, _1),
+                                 std::bind(&HelloProtocol::onContentValidationFailed,
                                            this, _1, _2));
 }
 
@@ -190,9 +190,9 @@
   // LSA. If there was a change in status, we schedule an adjacency
   // LSA build.
 void
-HelloProtocol::onContentValidated(const ndn::shared_ptr<const ndn::Data>& data)
+HelloProtocol::onContentValidated(const std::shared_ptr<const ndn::Data>& data)
 {
-  /* data name: /<neighbor>/NLSR/INFO/<router>/<version> */
+  // data name: /<neighbor>/NLSR/INFO/<router>/<version>
   ndn::Name dataName = data->getName();
   _LOG_DEBUG("Data validation successful for INFO(name): " << dataName);
   if (dataName.get(-3).toUri() == INFO_COMPONENT) {
@@ -220,7 +220,7 @@
   // Simply logs a debug message that the content could not be
   // validated (and is implicitly being discarded as a result).
 void
-HelloProtocol::onContentValidationFailed(const ndn::shared_ptr<const ndn::Data>& data,
+HelloProtocol::onContentValidationFailed(const std::shared_ptr<const ndn::Data>& data,
                                          const std::string& msg)
 {
   _LOG_DEBUG("Validation Error: " << msg);
@@ -235,9 +235,9 @@
 {
   m_nlsr.getFib().registerPrefix(adjName, faceUri, linkCost, timeout,
                                  ndn::nfd::ROUTE_FLAG_CAPTURE, 0,
-                                 ndn::bind(&HelloProtocol::onRegistrationSuccess,
+                                 std::bind(&HelloProtocol::onRegistrationSuccess,
                                            this, _1, adjName,timeout),
-                                 ndn::bind(&HelloProtocol::onRegistrationFailure,
+                                 std::bind(&HelloProtocol::onRegistrationFailure,
                                            this, _1, adjName));
 }
 
@@ -266,7 +266,7 @@
                                  ndn::nfd::ROUTE_FLAG_CAPTURE, 0);
 
     // Sends a Hello Interest to determine status before the next scheduled.
-    /* interest name: /<neighbor>/NLSR/INFO/<router> */
+    // interest name: /<neighbor>/NLSR/INFO/<router>
     ndn::Name interestName(neighbor);
     interestName.append(NLSR_COMPONENT);
     interestName.append(INFO_COMPONENT);
diff --git a/src/hello-protocol.hpp b/src/hello-protocol.hpp
index c0a489a..1817850 100644
--- a/src/hello-protocol.hpp
+++ b/src/hello-protocol.hpp
@@ -102,11 +102,11 @@
 
 PUBLIC_WITH_TESTS_ELSE_PRIVATE:
   void
-  onContentValidated(const ndn::shared_ptr<const ndn::Data>& data);
+  onContentValidated(const std::shared_ptr<const ndn::Data>& data);
 
 private:
   void
-  onContentValidationFailed(const ndn::shared_ptr<const ndn::Data>& data,
+  onContentValidationFailed(const std::shared_ptr<const ndn::Data>& data,
                             const std::string& msg);
 
   void
diff --git a/src/lsdb.cpp b/src/lsdb.cpp
index 179751a..1d20d72 100644
--- a/src/lsdb.cpp
+++ b/src/lsdb.cpp
@@ -107,7 +107,7 @@
 void
 Lsdb::afterFetchLsa(const ndn::ConstBufferPtr& bufferPtr, ndn::Name& interestName)
 {
-  shared_ptr<ndn::Data> data = make_shared<ndn::Data>(ndn::Name(interestName));
+  std::shared_ptr<ndn::Data> data = std::make_shared<ndn::Data>(ndn::Name(interestName));
   data->setContent(bufferPtr);
 
   _LOG_DEBUG("Received data for LSA(name): " << data->getName());
@@ -161,7 +161,7 @@
 {
   std::list<NameLsa>::iterator it = std::find_if(m_nameLsdb.begin(),
                                                  m_nameLsdb.end(),
-                                                 bind(nameLsaCompareByKey, _1, key));
+                                                 std::bind(nameLsaCompareByKey, _1, key));
   if (it != m_nameLsdb.end()) {
     return &(*it);
   }
@@ -190,7 +190,7 @@
                                 const ndn::time::seconds& expTime)
 {
   return m_scheduler.scheduleEvent(expTime + GRACE_PERIOD,
-                                   ndn::bind(&Lsdb::exprireOrRefreshNameLsa, this, key, seqNo));
+                                   std::bind(&Lsdb::exprireOrRefreshNameLsa, this, key, seqNo));
 }
 
 bool
@@ -294,7 +294,7 @@
 {
   std::list<NameLsa>::iterator it = std::find_if(m_nameLsdb.begin(),
                                                  m_nameLsdb.end(),
-                                                 bind(nameLsaCompareByKey, _1,
+                                                 std::bind(nameLsaCompareByKey, _1,
                                                       nlsa.getKey()));
   if (it == m_nameLsdb.end()) {
     m_nameLsdb.push_back(nlsa);
@@ -308,7 +308,7 @@
 {
   std::list<NameLsa>::iterator it = std::find_if(m_nameLsdb.begin(),
                                                  m_nameLsdb.end(),
-                                                 ndn::bind(nameLsaCompareByKey, _1, key));
+                                                 std::bind(nameLsaCompareByKey, _1, key));
   if (it != m_nameLsdb.end()) {
     _LOG_DEBUG("Deleting Name Lsa");
     (*it).writeLog();
@@ -336,7 +336,7 @@
 {
   std::list<NameLsa>::iterator it = std::find_if(m_nameLsdb.begin(),
                                                  m_nameLsdb.end(),
-                                                 ndn::bind(nameLsaCompareByKey, _1, key));
+                                                 std::bind(nameLsaCompareByKey, _1, key));
   if (it == m_nameLsdb.end()) {
     return false;
   }
@@ -396,7 +396,7 @@
 {
   std::list<CoordinateLsa>::iterator it = std::find_if(m_corLsdb.begin(),
                                                        m_corLsdb.end(),
-                                                       ndn::bind(corLsaCompareByKey, _1, key));
+                                                       std::bind(corLsaCompareByKey, _1, key));
   if (it != m_corLsdb.end()) {
     return &(*it);
   }
@@ -429,7 +429,7 @@
                                       const ndn::time::seconds& expTime)
 {
   return m_scheduler.scheduleEvent(expTime + GRACE_PERIOD,
-                                   ndn::bind(&Lsdb::exprireOrRefreshCoordinateLsa,
+                                   std::bind(&Lsdb::exprireOrRefreshCoordinateLsa,
                                              this, key, seqNo));
 }
 
@@ -500,7 +500,7 @@
 {
   std::list<CoordinateLsa>::iterator it = std::find_if(m_corLsdb.begin(),
                                                        m_corLsdb.end(),
-                                                       ndn::bind(corLsaCompareByKey, _1,
+                                                       std::bind(corLsaCompareByKey, _1,
                                                                  clsa.getKey()));
   if (it == m_corLsdb.end()) {
     m_corLsdb.push_back(clsa);
@@ -514,7 +514,7 @@
 {
   std::list<CoordinateLsa>::iterator it = std::find_if(m_corLsdb.begin(),
                                                        m_corLsdb.end(),
-                                                       ndn::bind(corLsaCompareByKey,
+                                                       std::bind(corLsaCompareByKey,
                                                                  _1, key));
   if (it != m_corLsdb.end()) {
     _LOG_DEBUG("Deleting Coordinate Lsa");
@@ -535,7 +535,7 @@
 {
   std::list<CoordinateLsa>::iterator it = std::find_if(m_corLsdb.begin(),
                                                        m_corLsdb.end(),
-                                                       ndn::bind(corLsaCompareByKey,
+                                                       std::bind(corLsaCompareByKey,
                                                                  _1, key));
   if (it == m_corLsdb.end()) {
     return false;
@@ -584,7 +584,7 @@
   if (m_nlsr.getIsBuildAdjLsaSheduled() == false) {
     _LOG_DEBUG("Scheduling Adjacency LSA build in " << m_adjLsaBuildInterval);
 
-    m_scheduler.scheduleEvent(m_adjLsaBuildInterval, ndn::bind(&Lsdb::buildAdjLsa, this));
+    m_scheduler.scheduleEvent(m_adjLsaBuildInterval, std::bind(&Lsdb::buildAdjLsa, this));
     m_nlsr.setIsBuildAdjLsaSheduled(true);
   }
 }
@@ -611,7 +611,7 @@
       // router from refreshing the LSA, eventually causing other
       // routers to delete it, too.
       else {
-        _LOG_DEBUG("Removing own Adj LSA; no ACTIVE neighbors")
+        _LOG_DEBUG("Removing own Adj LSA; no ACTIVE neighbors");
         // Get this router's key
         ndn::Name key = m_nlsr.getConfParameter().getRouterPrefix();
         key.append(AdjLsa::TYPE_STRING);
@@ -634,7 +634,7 @@
     int schedulingTime = m_nlsr.getConfParameter().getInterestRetryNumber() *
                          m_nlsr.getConfParameter().getInterestResendTime();
     m_scheduler.scheduleEvent(ndn::time::seconds(schedulingTime),
-                              ndn::bind(&Lsdb::buildAdjLsa, this));
+                              std::bind(&Lsdb::buildAdjLsa, this));
   }
 }
 
@@ -643,7 +643,7 @@
 {
   std::list<AdjLsa>::iterator it = std::find_if(m_adjLsdb.begin(),
                                                 m_adjLsdb.end(),
-                                                bind(adjLsaCompareByKey, _1,
+                                                std::bind(adjLsaCompareByKey, _1,
                                                      alsa.getKey()));
   if (it == m_adjLsdb.end()) {
     m_adjLsdb.push_back(alsa);
@@ -657,7 +657,7 @@
 {
   std::list<AdjLsa>::iterator it = std::find_if(m_adjLsdb.begin(),
                                                 m_adjLsdb.end(),
-                                                bind(adjLsaCompareByKey, _1, key));
+                                                std::bind(adjLsaCompareByKey, _1, key));
   if (it != m_adjLsdb.end()) {
     return &(*it);
   }
@@ -686,7 +686,7 @@
                                const ndn::time::seconds& expTime)
 {
   return m_scheduler.scheduleEvent(expTime + GRACE_PERIOD,
-                                   ndn::bind(&Lsdb::exprireOrRefreshAdjLsa, this, key, seqNo));
+                                   std::bind(&Lsdb::exprireOrRefreshAdjLsa, this, key, seqNo));
 }
 
 bool
@@ -766,7 +766,7 @@
 {
   std::list<AdjLsa>::iterator it = std::find_if(m_adjLsdb.begin(),
                                                 m_adjLsdb.end(),
-                                                ndn::bind(adjLsaCompareByKey, _1, key));
+                                                std::bind(adjLsaCompareByKey, _1, key));
   if (it != m_adjLsdb.end()) {
     _LOG_DEBUG("Deleting Adj Lsa");
     (*it).writeLog();
@@ -782,7 +782,7 @@
 {
   std::list<AdjLsa>::iterator it = std::find_if(m_adjLsdb.begin(),
                                                 m_adjLsdb.end(),
-                                                bind(adjLsaCompareByKey, _1, key));
+                                                std::bind(adjLsaCompareByKey, _1, key));
   if (it == m_adjLsdb.end()) {
     return false;
   }
@@ -979,8 +979,8 @@
   _LOG_DEBUG("Fetching Data for LSA: " << interestName << " Seq number: " << seqNo);
   ndn::util::SegmentFetcher::fetch(m_nlsr.getNlsrFace(), interest,
                                    m_nlsr.getValidator(),
-                                   ndn::bind(&Lsdb::afterFetchLsa, this, _1, interestName),
-                                   ndn::bind(&Lsdb::onFetchLsaError, this, _1, _2, interestName,
+                                   std::bind(&Lsdb::afterFetchLsa, this, _1, interestName),
+                                   std::bind(&Lsdb::onFetchLsaError, this, _1, _2, interestName,
                                              timeoutCount, deadline, lsaName, seqNo));
 }
 
@@ -1101,7 +1101,7 @@
 }
 
 void
-Lsdb::onContentValidated(const ndn::shared_ptr<const ndn::Data>& data)
+Lsdb::onContentValidated(const std::shared_ptr<const ndn::Data>& data)
 {
   const ndn::Name& dataName = data->getName();
   _LOG_DEBUG("Data validation successful for LSA: " << dataName);
diff --git a/src/lsdb.hpp b/src/lsdb.hpp
index c4283a1..a2d42cd 100644
--- a/src/lsdb.hpp
+++ b/src/lsdb.hpp
@@ -303,7 +303,7 @@
                                   const ndn::Name& lsaKey,
                                   uint64_t seqNo);
   void
-  onContentValidated(const ndn::shared_ptr<const ndn::Data>& data);
+  onContentValidated(const std::shared_ptr<const ndn::Data>& data);
 
   void
   processContentNameLsa(const ndn::Name& lsaKey,
@@ -387,4 +387,4 @@
 
 } // namespace nlsr
 
-#endif //NLSR_LSDB_HPP
+#endif // NLSR_LSDB_HPP
diff --git a/src/name-prefix-list.cpp b/src/name-prefix-list.cpp
index 188d5f3..37c66dc 100644
--- a/src/name-prefix-list.cpp
+++ b/src/name-prefix-list.cpp
@@ -53,8 +53,8 @@
 {
   std::list<ndn::Name>::iterator it = std::find_if(m_nameList.begin(),
                                                    m_nameList.end(),
-                                                   ndn::bind(&nameCompare, _1 ,
-                                                             ndn::cref(name)));
+                                                   std::bind(&nameCompare, _1 ,
+                                                   std::cref(name)));
   if (it != m_nameList.end()) {
     return false;
   }
@@ -67,8 +67,8 @@
 {
   std::list<ndn::Name>::iterator it = std::find_if(m_nameList.begin(),
                                                    m_nameList.end(),
-                                                   ndn::bind(&nameCompare, _1 ,
-                                                   ndn::cref(name)));
+                                                   std::bind(&nameCompare, _1 ,
+                                                   std::cref(name)));
   if (it != m_nameList.end()) {
     m_nameList.erase(it);
     return true;
diff --git a/src/nlsr.cpp b/src/nlsr.cpp
index 132f297..2a57e0f 100644
--- a/src/nlsr.cpp
+++ b/src/nlsr.cpp
@@ -76,15 +76,15 @@
   , m_faceMonitor(m_nlsrFace)
   , m_firstHelloInterval(FIRST_HELLO_INTERVAL_DEFAULT)
 {
-  m_faceMonitor.onNotification.connect(bind(&Nlsr::onFaceEventNotification, this, _1));
+  m_faceMonitor.onNotification.connect(std::bind(&Nlsr::onFaceEventNotification, this, _1));
   m_faceMonitor.start();
 }
 
 void
 Nlsr::registrationFailed(const ndn::Name& name)
 {
-  std::cerr << "ERROR: Failed to register prefix in local hub's daemon" << endl;
-  throw Error("Error: Prefix registration failed");
+  std::cerr << "ERROR: Failed to register prefix in local hub's daemon" << std::endl;
+  BOOST_THROW_EXCEPTION(Error("Error: Prefix registration failed"));
 }
 
 void
@@ -157,7 +157,7 @@
   process_id = fork();
   if (process_id < 0){
     std::cerr << "Daemonization failed!" << std::endl;
-    throw Error("Error: Daemonization process- fork failed!");
+    BOOST_THROW_EXCEPTION(Error("Error: Daemonization process- fork failed!"));
   }
   if (process_id > 0) {
     _LOG_DEBUG("Process daemonized. Process id: " << process_id);
@@ -167,11 +167,11 @@
   umask(0);
   sid = setsid();
   if(sid < 0) {
-    throw Error("Error: Daemonization process- setting id failed!");
+    BOOST_THROW_EXCEPTION(Error("Error: Daemonization process- setting id failed!"));
   }
 
   if (chdir("/") < 0) {
-    throw Error("Error: Daemonization process-chdir failed!");
+    BOOST_THROW_EXCEPTION(Error("Error: Daemonization process-chdir failed!"));
   }
 }
 
@@ -189,11 +189,11 @@
 
   m_syncLogicHandler.createSyncSocket(m_confParam.getChronosyncPrefix());
 
-  /* Logging start */
+  // Logging start
   m_confParam.writeLog();
   m_adjacencyList.writeLog();
   m_namePrefixList.writeLog();
-  /* Logging end */
+  // Logging end
   initializeKey();
   setStrategies();
   _LOG_DEBUG("Default NLSR identity: " << m_signingInfo.getSignerName());
@@ -237,15 +237,15 @@
   try {
     m_keyChain.deleteIdentity(defaultIdentity);
   }
-  catch (std::exception& e) {
+  catch (const std::exception& e) {
   }
   m_signingInfo = ndn::security::SigningInfo(ndn::security::SigningInfo::SIGNER_TYPE_ID, defaultIdentity);
 
   ndn::Name keyName = m_keyChain.generateRsaKeyPairAsDefault(defaultIdentity, true);
 
-  ndn::shared_ptr<ndn::IdentityCertificate> certificate =
-    ndn::make_shared<ndn::IdentityCertificate>();
-  ndn::shared_ptr<ndn::PublicKey> pubKey = m_keyChain.getPublicKey(keyName);
+  std::shared_ptr<ndn::IdentityCertificate> certificate =
+    std::make_shared<ndn::IdentityCertificate>();
+  std::shared_ptr<ndn::PublicKey> pubKey = m_keyChain.getPublicKey(keyName);
   Name certificateName = keyName.getPrefix(-1);
   certificateName.append("KEY").append(keyName.get(-1)).append("ID-CERT").appendVersion();
   certificate->setName(certificateName);
@@ -310,12 +310,12 @@
   else if (certName[-1].toUri() != "ID-CERT")
     return; //Wrong key interest.
 
-  ndn::shared_ptr<const ndn::IdentityCertificate> cert = getCertificate(certName);
+  std::shared_ptr<const ndn::IdentityCertificate> cert = getCertificate(certName);
 
   if (!static_cast<bool>(cert))
     return; // cert is not found
 
-  ndn::shared_ptr<ndn::Data> data = ndn::make_shared<ndn::Data>();
+  std::shared_ptr<ndn::Data> data = std::make_shared<ndn::Data>();
   data->setName(interestName);
   data->setContent(cert->wireEncode());
   m_keyChain.signWithSha256(*data);
@@ -337,7 +337,7 @@
 Nlsr::onDestroyFaceFailure(const ndn::nfd::ControlResponse& response)
 {
   std::cerr << response.getText() << " (code: " << response.getCode() << ")";
-  throw Error("Error: Face destruction failed");
+  BOOST_THROW_EXCEPTION(Error("Error: Face destruction failed"));
 }
 
 void
diff --git a/src/nlsr.hpp b/src/nlsr.hpp
index 705cc76..5399ed8 100644
--- a/src/nlsr.hpp
+++ b/src/nlsr.hpp
@@ -19,11 +19,12 @@
  * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
  **/
 
-#ifndef NLSR_HPP
-#define NLSR_HPP
+#ifndef NLSR_NLSR_HPP
+#define NLSR_NLSR_HPP
 
 #include <boost/cstdint.hpp>
 #include <stdexcept>
+#include <boost/throw_exception.hpp>
 
 #include <ndn-cxx/face.hpp>
 #include <ndn-cxx/security/key-chain.hpp>
@@ -253,12 +254,12 @@
   }
 
   void
-  loadCertToPublish(ndn::shared_ptr<ndn::IdentityCertificate> certificate)
+  loadCertToPublish(std::shared_ptr<ndn::IdentityCertificate> certificate)
   {
     m_certStore.insert(certificate);
   }
 
-  ndn::shared_ptr<const ndn::IdentityCertificate>
+  std::shared_ptr<const ndn::IdentityCertificate>
   getCertificate(const ndn::Name& certificateNameWithoutVersion)
   {
     shared_ptr<const ndn::IdentityCertificate> cert =
@@ -317,7 +318,7 @@
 
 PUBLIC_WITH_TESTS_ELSE_PRIVATE:
   void
-  addCertificateToCache(ndn::shared_ptr<ndn::IdentityCertificate> certificate)
+  addCertificateToCache(std::shared_ptr<ndn::IdentityCertificate> certificate)
   {
     if (certificate != nullptr) {
       m_certificateCache->insertCertificate(certificate);
@@ -386,7 +387,7 @@
   HelloProtocol m_helloProtocol;
 
 private:
-  ndn::shared_ptr<ndn::CertificateCacheTtl> m_certificateCache;
+  std::shared_ptr<ndn::CertificateCacheTtl> m_certificateCache;
   security::CertificateStore m_certStore;
   Validator m_validator;
   ndn::security::SigningInfo m_signingInfo;
@@ -401,4 +402,4 @@
 
 } // namespace nlsr
 
-#endif //NLSR_HPP
+#endif // NLSR_NLSR_HPP
diff --git a/src/publisher/segment-publisher.hpp b/src/publisher/segment-publisher.hpp
index 43c2efb..82109eb 100644
--- a/src/publisher/segment-publisher.hpp
+++ b/src/publisher/segment-publisher.hpp
@@ -32,10 +32,10 @@
 namespace nlsr {
 
 /*! \brief provides a publisher of Status Dataset or other segmented octet stream
-    \sa http://redmine.named-data.net/projects/nfd/wiki/StatusDataset
+    \sa https://redmine.named-data.net/projects/nfd/wiki/StatusDataset
  */
 template <class FaceBase>
-class SegmentPublisher : ndn::noncopyable
+class SegmentPublisher : boost::noncopyable
 {
 public:
   SegmentPublisher(FaceBase& face,
@@ -91,7 +91,7 @@
       ndn::Name segmentName(segmentPrefix);
       segmentName.appendSegment(segmentNo);
 
-      ndn::shared_ptr<ndn::Data> data = ndn::make_shared<ndn::Data>(segmentName);
+      std::shared_ptr<ndn::Data> data = std::make_shared<ndn::Data>(segmentName);
       data->setContent(segmentBegin, segmentEnd - segmentBegin);
       data->setFreshnessPeriod(m_freshnessPeriod);
 
@@ -113,7 +113,7 @@
 
 private:
   void
-  publishSegment(ndn::shared_ptr<ndn::Data>& data, const ndn::security::SigningInfo& signingInfo)
+  publishSegment(std::shared_ptr<ndn::Data>& data, const ndn::security::SigningInfo& signingInfo)
   {
     m_keyChain.sign(*data, signingInfo);
     m_face.put(*data);
diff --git a/src/route/fib.cpp b/src/route/fib.cpp
index d12109d..5de9929 100644
--- a/src/route/fib.cpp
+++ b/src/route/fib.cpp
@@ -53,7 +53,7 @@
   _LOG_DEBUG("Fib::scheduleEntryExpiration Called");
   _LOG_INFO("Name: " << name << " Seq Num: " << feSeqNum);
 
-  return m_scheduler.scheduleEvent(expTime, ndn::bind(&Fib::remove, this, name));
+  return m_scheduler.scheduleEvent(expTime, std::bind(&Fib::remove, this, name));
 }
 
 void
@@ -117,7 +117,7 @@
     // See if the nexthop is installed in NFD's FIB
     NexthopList::const_iterator foundIt = std::find_if(installedHops.cbegin(),
                                                        installedHops.cend(),
-                                                       bind(&compareFaceUri, _1, faceUri));
+                                                       std::bind(&compareFaceUri, _1, faceUri));
 
     // The next hop is not installed
     if (foundIt == installedHops.cend()) {
@@ -287,7 +287,7 @@
                  const CommandFailCallback& onFailure)
 {
   createFace(faceUri,
-             ndn::bind(&Fib::destroyFaceInNfd, this, _1, onSuccess, onFailure),
+             std::bind(&Fib::destroyFaceInNfd, this, _1, onSuccess, onFailure),
              onFailure);
 }
 
@@ -353,7 +353,7 @@
     .setExpirationPeriod(timeout)
     .setOrigin(ndn::nfd::ROUTE_ORIGIN_NLSR);
   createFace(faceUri,
-             ndn::bind(static_cast<RegisterPrefixCallback>(&Fib::registerPrefixInNfd),
+             std::bind(static_cast<RegisterPrefixCallback>(&Fib::registerPrefixInNfd),
                        this, _1, parameters, times, onSuccess, onFailure),
              onFailure);
 }
@@ -364,10 +364,10 @@
                          uint8_t times)
 {
   m_controller.start<ndn::nfd::RibRegisterCommand>(parameters,
-                                                   ndn::bind(&Fib::onRegistration, this, _1,
+                                                   std::bind(&Fib::onRegistration, this, _1,
                                                              "Successful in name registration",
                                                              faceUri),
-                                                   ndn::bind(&Fib::onRegistrationFailure,
+                                                   std::bind(&Fib::onRegistrationFailure,
                                                              this, _1,
                                                              "Failed in name registration",
                                                              parameters,
@@ -406,9 +406,9 @@
       .setFaceId(faceId)
       .setOrigin(ndn::nfd::ROUTE_ORIGIN_NLSR);
     m_controller.start<ndn::nfd::RibUnregisterCommand>(controlParameters,
-                                                     ndn::bind(&Fib::onUnregistration, this, _1,
+                                                     std::bind(&Fib::onUnregistration, this, _1,
                                                                "Successful in unregistering name"),
-                                                     ndn::bind(&Fib::onUnregistrationFailure,
+                                                     std::bind(&Fib::onUnregistrationFailure,
                                                                this, _1,
                                                                "Failed in unregistering name"));
   }
@@ -423,9 +423,9 @@
     .setStrategy(strategy);
 
   m_controller.start<ndn::nfd::StrategyChoiceSetCommand>(parameters,
-                                                         bind(&Fib::onSetStrategySuccess, this, _1,
+                                                         std::bind(&Fib::onSetStrategySuccess, this, _1,
                                                               "Successfully set strategy choice"),
-                                                         bind(&Fib::onSetStrategyFailure, this, _1,
+                                                         std::bind(&Fib::onSetStrategyFailure, this, _1,
                                                               parameters,
                                                               count,
                                                               "Failed to set strategy choice"));
diff --git a/src/route/map.cpp b/src/route/map.cpp
index 229b23b..a97be11 100644
--- a/src/route/map.cpp
+++ b/src/route/map.cpp
@@ -62,7 +62,7 @@
   //cout << mpe;
   std::list<MapEntry>::iterator it = std::find_if(m_table.begin(),
                                                   m_table.end(),
-                                                  ndn::bind(&mapEntryCompareByRouter,
+                                                  std::bind(&mapEntryCompareByRouter,
                                                             _1, mpe.getRouter()));
   if (it == m_table.end()) {
     m_table.push_back(mpe);
@@ -76,7 +76,7 @@
 {
   std::list<MapEntry>::iterator it = std::find_if(m_table.begin(),
                                                   m_table.end(),
-                                                  ndn::bind(&mapEntryCompareByMappingNo,
+                                                  std::bind(&mapEntryCompareByMappingNo,
                                                             _1, mn));
   if (it != m_table.end()) {
     return (*it).getRouter();
@@ -89,7 +89,7 @@
 {
   std::list<MapEntry>::iterator it = std::find_if(m_table.begin(),
                                                   m_table.end(),
-                                                  ndn::bind(&mapEntryCompareByRouter,
+                                                  std::bind(&mapEntryCompareByRouter,
                                                             _1, rName));
   if (it != m_table.end()) {
     return (*it).getMappingNumber();
diff --git a/src/route/name-prefix-table-entry.cpp b/src/route/name-prefix-table-entry.cpp
index 922b24c..1abc87b 100644
--- a/src/route/name-prefix-table-entry.cpp
+++ b/src/route/name-prefix-table-entry.cpp
@@ -43,7 +43,7 @@
 }
 
 uint64_t
-NamePrefixTableEntry::removeRoutingTableEntry(shared_ptr<RoutingTablePoolEntry>
+NamePrefixTableEntry::removeRoutingTableEntry(std::shared_ptr<RoutingTablePoolEntry>
                                               rtpePtr)
 {
   auto rtpeItr = std::find(m_rteList.begin(), m_rteList.end(), rtpePtr);
@@ -60,7 +60,7 @@
 }
 
 void
-NamePrefixTableEntry::addRoutingTableEntry(shared_ptr<RoutingTablePoolEntry>
+NamePrefixTableEntry::addRoutingTableEntry(std::shared_ptr<RoutingTablePoolEntry>
                                            rtpePtr)
 {
   auto rtpeItr = std::find(m_rteList.begin(), m_rteList.end(), rtpePtr);
@@ -105,7 +105,7 @@
 {
   os << "Name: " << entry.getNamePrefix() << "\n";
 
-  for (const shared_ptr<RoutingTablePoolEntry> rtpePtr : entry.getRteList()) {
+  for (const std::shared_ptr<RoutingTablePoolEntry> rtpePtr : entry.getRteList()) {
     os << "Destination: " << rtpePtr->getDestination() << "\n";
   }
 
diff --git a/src/route/name-prefix-table.cpp b/src/route/name-prefix-table.cpp
index 3c98c0a..6467790 100644
--- a/src/route/name-prefix-table.cpp
+++ b/src/route/name-prefix-table.cpp
@@ -141,7 +141,7 @@
   // Ensure that the entry exists
   NptEntryList::iterator nameItr = std::find_if(m_table.begin(),
                                            m_table.end(),
-                                           bind(&npteCompare, _1, name));
+                                           std::bind(&npteCompare, _1, name));
   if (nameItr != m_table.end()) {
     _LOG_TRACE("Removing origin: " << rtpePtr->getDestination()
                << " from prefix: " << *nameItr);
diff --git a/src/route/nexthop-list.cpp b/src/route/nexthop-list.cpp
index 2d150dd..c2e5fa6 100644
--- a/src/route/nexthop-list.cpp
+++ b/src/route/nexthop-list.cpp
@@ -81,7 +81,7 @@
 {
   std::set<NextHop, NextHopComparator>::iterator it = std::find_if(m_nexthopList.begin(),
                                                  m_nexthopList.end(),
-                                                 ndn::bind(&nexthopAddCompare, _1, nh));
+                                                 std::bind(&nexthopAddCompare, _1, nh));
   if (it == m_nexthopList.end()) {
     m_nexthopList.insert(nh);
   }
@@ -96,7 +96,7 @@
 {
   std::set<NextHop, NextHopComparator>::iterator it = std::find_if(m_nexthopList.begin(),
                                                  m_nexthopList.end(),
-                                                 ndn::bind(&nexthopRemoveCompare, _1, nh));
+                                                 std::bind(&nexthopRemoveCompare, _1, nh));
   if (it != m_nexthopList.end()) {
     m_nexthopList.erase(it);
   }
diff --git a/src/route/routing-table-entry.hpp b/src/route/routing-table-entry.hpp
index d5d01b9..b553fa1 100644
--- a/src/route/routing-table-entry.hpp
+++ b/src/route/routing-table-entry.hpp
@@ -81,4 +81,4 @@
 
 } // namespace nlsr
 
-#endif //NLSR_ROUTING_TABLE_ENTRY_HPP
+#endif // NLSR_ROUTING_TABLE_ENTRY_HPP
diff --git a/src/route/routing-table.cpp b/src/route/routing-table.cpp
index e61d4d0..b1e02dc 100644
--- a/src/route/routing-table.cpp
+++ b/src/route/routing-table.cpp
@@ -130,7 +130,7 @@
 
   LinkStateRoutingTableCalculator calculator(nRouters);
 
-  calculator.calculatePath(map, ndn::ref(*this), nlsr);
+  calculator.calculatePath(map, std::ref(*this), nlsr);
 }
 
 void
@@ -145,7 +145,7 @@
   HyperbolicRoutingCalculator calculator(nRouters, false,
                                          nlsr.getConfParameter().getRouterPrefix());
 
-  calculator.calculatePaths(map, ndn::ref(*this),
+  calculator.calculatePaths(map, std::ref(*this),
                             nlsr.getLsdb(), nlsr.getAdjacencyList());
 }
 
@@ -161,7 +161,7 @@
   HyperbolicRoutingCalculator calculator(nRouters, true,
                                          nlsr.getConfParameter().getRouterPrefix());
 
-  calculator.calculatePaths(map, ndn::ref(*this),
+  calculator.calculatePaths(map, std::ref(*this),
                             nlsr.getLsdb(), nlsr.getAdjacencyList());
 }
 
@@ -172,7 +172,7 @@
     _LOG_DEBUG("Scheduling routing table calculation in " << m_routingCalcInterval);
 
     m_scheduler.scheduleEvent(m_routingCalcInterval,
-                              ndn::bind(&RoutingTable::calculate, this, ndn::ref(pnlsr)));
+                              std::bind(&RoutingTable::calculate, this, std::ref(pnlsr)));
 
     pnlsr.setIsRouteCalculationScheduled(true);
   }
@@ -205,7 +205,7 @@
 {
   std::list<RoutingTableEntry>::iterator it = std::find_if(m_rTable.begin(),
                                                            m_rTable.end(),
-                                                           ndn::bind(&routingTableEntryCompare,
+                                                           std::bind(&routingTableEntryCompare,
                                                                      _1, destRouter));
   if (it != m_rTable.end()) {
     return &(*it);
@@ -242,7 +242,7 @@
 
   std::list<RoutingTableEntry>::iterator it = std::find_if(m_dryTable.begin(),
                                                            m_dryTable.end(),
-                                                           ndn::bind(&routingTableEntryCompare,
+                                                           std::bind(&routingTableEntryCompare,
                                                                      _1, destRouter));
   if (it == m_dryTable.end()) {
     RoutingTableEntry rte(destRouter);
diff --git a/src/security/certificate-store.hpp b/src/security/certificate-store.hpp
index a90fc70..a45f0c4 100644
--- a/src/security/certificate-store.hpp
+++ b/src/security/certificate-store.hpp
@@ -35,7 +35,7 @@
 {
 public:
   void
-  insert(shared_ptr<ndn::IdentityCertificate> certificate)
+  insert(std::shared_ptr<ndn::IdentityCertificate> certificate)
   {
     if (certificate != nullptr) {
       // Key is cert name without version
@@ -43,7 +43,7 @@
     }
   }
 
-  shared_ptr<const ndn::IdentityCertificate>
+  std::shared_ptr<const ndn::IdentityCertificate>
   find(const ndn::Name& certificateNameWithoutVersion) const
   {
     CertMap::const_iterator it = m_certificates.find(certificateNameWithoutVersion);
@@ -63,7 +63,7 @@
   }
 
 private:
-  typedef std::map<ndn::Name, shared_ptr<ndn::IdentityCertificate>> CertMap;
+  typedef std::map<ndn::Name, std::shared_ptr<ndn::IdentityCertificate>> CertMap;
   CertMap m_certificates;
 };
 
diff --git a/src/tlv/lsa-info.cpp b/src/tlv/lsa-info.cpp
index 79addb3..8b36ff0 100644
--- a/src/tlv/lsa-info.cpp
+++ b/src/tlv/lsa-info.cpp
@@ -26,7 +26,7 @@
 #include <ndn-cxx/encoding/block-helpers.hpp>
 
 namespace nlsr {
-namespace tlv  {
+namespace tlv {
 
 BOOST_CONCEPT_ASSERT((ndn::WireEncodable<LsaInfo>));
 BOOST_CONCEPT_ASSERT((ndn::WireDecodable<LsaInfo>));
@@ -109,7 +109,7 @@
     std::stringstream error;
     error << "Expected LsaInfo Block, but Block is of a different type: #"
           << m_wire.type();
-    throw Error(error.str());
+    BOOST_THROW_EXCEPTION(Error(error.str()));
   }
 
   m_wire.parse();
@@ -124,13 +124,13 @@
       m_originRouter.wireDecode(*it);
     }
     else {
-      throw Error("OriginRouter: Missing required Name field");
+      BOOST_THROW_EXCEPTION(Error("OriginRouter: Missing required Name field"));
     }
 
     ++val;
   }
   else {
-    throw Error("Missing required OriginRouter field");
+    BOOST_THROW_EXCEPTION(Error("Missing required OriginRouter field"));
   }
 
   if (val != m_wire.elements_end() && val->type() == ndn::tlv::nlsr::SequenceNumber) {
@@ -138,7 +138,7 @@
     ++val;
   }
   else {
-    throw Error("Missing required SequenceNumber field");
+    BOOST_THROW_EXCEPTION(Error("Missing required SequenceNumber field"));
   }
 
   if (val != m_wire.elements_end() && val->type() == ndn::tlv::nlsr::ExpirationPeriod) {
diff --git a/src/tlv/lsa-info.hpp b/src/tlv/lsa-info.hpp
index c39694b..ef2142a 100644
--- a/src/tlv/lsa-info.hpp
+++ b/src/tlv/lsa-info.hpp
@@ -27,6 +27,7 @@
 #include <ndn-cxx/encoding/encoding-buffer.hpp>
 #include <ndn-cxx/encoding/tlv.hpp>
 #include <ndn-cxx/name.hpp>
+#include <boost/throw_exception.hpp>
 
 #include "lsa.hpp"
 
@@ -41,7 +42,7 @@
                 SequenceNumber
                 ExpirationPeriod?
 
-   \sa http://redmine.named-data.net/projects/nlsr/wiki/LSDB_DataSet
+   \sa https://redmine.named-data.net/projects/nlsr/wiki/LSDB_DataSet
  */
 class LsaInfo
 {
diff --git a/src/update/prefix-update-processor.cpp b/src/update/prefix-update-processor.cpp
index 8f3104a..e0c8f3b 100644
--- a/src/update/prefix-update-processor.cpp
+++ b/src/update/prefix-update-processor.cpp
@@ -43,7 +43,7 @@
                                              SyncLogicHandler& sync,
                                              const ndn::Name broadcastPrefix,
                                              ndn::KeyChain& keyChain,
-                                             ndn::shared_ptr<ndn::CertificateCacheTtl> certificateCache,
+                                             std::shared_ptr<ndn::CertificateCacheTtl> certificateCache,
                                              security::CertificateStore& certStore)
   : m_face(face)
   , m_namePrefixList(namePrefixList)
@@ -61,7 +61,7 @@
 {
   _LOG_DEBUG("Setting Interest filter for: " << COMMAND_PREFIX);
 
-  m_face.setInterestFilter(COMMAND_PREFIX, bind(&PrefixUpdateProcessor::onInterest, this, _2));
+  m_face.setInterestFilter(COMMAND_PREFIX, std::bind(&PrefixUpdateProcessor::onInterest, this, _2));
 }
 
 void
@@ -75,8 +75,8 @@
   }
 
   m_validator.validate(request,
-                       bind(&PrefixUpdateProcessor::onCommandValidated, this, _1),
-                       bind(&PrefixUpdateProcessor::onCommandValidationFailed, this, _1, _2));
+                       std::bind(&PrefixUpdateProcessor::onCommandValidated, this, _1),
+                       std::bind(&PrefixUpdateProcessor::onCommandValidationFailed, this, _1, _2));
 }
 
 void
@@ -197,7 +197,7 @@
   ndn::MetaInfo metaInfo;
   metaInfo.setType(ndn::tlv::ContentType_Nack);
 
-  shared_ptr<ndn::Data> responseData = std::make_shared<ndn::Data>(request.getName());
+  std::shared_ptr<ndn::Data> responseData = std::make_shared<ndn::Data>(request.getName());
   responseData->setMetaInfo(metaInfo);
 
   m_keyChain.sign(*responseData);
diff --git a/src/update/prefix-update-processor.hpp b/src/update/prefix-update-processor.hpp
index e91fd1f..b1347b8 100644
--- a/src/update/prefix-update-processor.hpp
+++ b/src/update/prefix-update-processor.hpp
@@ -69,7 +69,7 @@
                         SyncLogicHandler& sync,
                         const ndn::Name broadcastPrefix,
                         ndn::KeyChain& keyChain,
-                        ndn::shared_ptr<ndn::CertificateCacheTtl> certificateCache,
+                        std::shared_ptr<ndn::CertificateCacheTtl> certificateCache,
                         security::CertificateStore& certStore);
 
   void
diff --git a/src/utility/face-controller.cpp b/src/utility/face-controller.cpp
index 8e680d3..62778cd 100644
--- a/src/utility/face-controller.cpp
+++ b/src/utility/face-controller.cpp
@@ -41,8 +41,8 @@
   FaceUri uri(request);
 
   _LOG_TRACE("Converting " << uri << " to canonical form");
-  uri.canonize(bind(&FaceController::onCanonizeSuccess, this, _1, onSuccess, onFailure, uri),
-               bind(&FaceController::onCanonizeFailure, this, _1, onSuccess, onFailure, uri),
+  uri.canonize(std::bind(&FaceController::onCanonizeSuccess, this, _1, onSuccess, onFailure, uri),
+               std::bind(&FaceController::onCanonizeFailure, this, _1, onSuccess, onFailure, uri),
                m_ioService, TIME_ALLOWED_FOR_CANONIZATION);
 }
 
diff --git a/src/validator.hpp b/src/validator.hpp
index ebcd3d0..04b2ea5 100644
--- a/src/validator.hpp
+++ b/src/validator.hpp
@@ -45,7 +45,7 @@
   explicit
   Validator(ndn::Face& face,
             const ndn::Name broadcastPrefix,
-            const ndn::shared_ptr<ndn::CertificateCache>& cache,
+            const std::shared_ptr<ndn::CertificateCache>& cache,
             security::CertificateStore& certStore,
             const int stepLimit = 10)
     : ndn::ValidatorConfig(face, cache, ndn::ValidatorConfig::DEFAULT_GRACE_INTERVAL, stepLimit)
@@ -73,7 +73,7 @@
   }
 
 protected:
-  typedef std::vector<ndn::shared_ptr<ndn::ValidationRequest>> NextSteps;
+  typedef std::vector<std::shared_ptr<ndn::ValidationRequest>> NextSteps;
 
   virtual void
   afterCheckPolicy(const NextSteps& nextSteps,
@@ -84,16 +84,16 @@
       return;
     }
 
-    for (const shared_ptr<ndn::ValidationRequest>& request : nextSteps) {
+    for (const std::shared_ptr<ndn::ValidationRequest>& request : nextSteps) {
 
       ndn::Interest& interest = request->m_interest;
 
       // Look for certificate in permanent storage
-      shared_ptr<const ndn::IdentityCertificate> cert = m_certStore.find(interest.getName());
+      std::shared_ptr<const ndn::IdentityCertificate> cert = m_certStore.find(interest.getName());
 
       if (cert != nullptr) {
         // If the certificate is found, no reason to express interest
-        shared_ptr<ndn::Data> data = make_shared<ndn::Data>(interest.getName());
+        std::shared_ptr<ndn::Data> data = std::make_shared<ndn::Data>(interest.getName());
         data->setContent(cert->wireEncode());
 
         Validator::onData(interest, *data, request);
@@ -106,8 +106,8 @@
 
         // Attempt to fetch the certificate
         m_face->expressInterest(interest,
-                                bind(&Validator::onData, this, _1, _2, request),
-                                bind(&Validator::onTimeout,
+                                std::bind(&Validator::onData, this, _1, _2, request),
+                                std::bind(&Validator::onTimeout,
                                      this, _1, request->m_nRetries,
                                      onFailure,
                                      request));
@@ -115,10 +115,10 @@
     }
   }
 
-  virtual ndn::shared_ptr<const ndn::Data>
+  virtual std::shared_ptr<const ndn::Data>
   preCertificateValidation(const ndn::Data& data)
   {
-    ndn::shared_ptr<ndn::Data> internalData = ndn::make_shared<ndn::Data>();
+    std::shared_ptr<ndn::Data> internalData = std::make_shared<ndn::Data>();
     internalData->wireDecode(data.getContent().blockFromValue());
     return internalData;
   }
