diff --git a/tools/ndn-autoconfig/multicast-discovery.cpp b/tools/ndn-autoconfig/multicast-discovery.cpp
index a474899..4efcec6 100644
--- a/tools/ndn-autoconfig/multicast-discovery.cpp
+++ b/tools/ndn-autoconfig/multicast-discovery.cpp
@@ -36,8 +36,8 @@
 MulticastDiscovery::MulticastDiscovery(Face& face, KeyChain& keyChain,
                                        const NextStageCallback& nextStageOnFailure)
   : Base(face, keyChain, nextStageOnFailure)
-  , nRequestedRegs(0)
-  , nFinishedRegs(0)
+  , m_nRequestedRegs(0)
+  , m_nFinishedRegs(0)
 {
 }
 
@@ -46,14 +46,11 @@
 {
   std::cerr << "Trying multicast discovery..." << std::endl;
 
-  util::SegmentFetcher::fetch(m_face, Interest("/localhost/nfd/faces/list"),
-                              m_validator,
-                              [this] (const ConstBufferPtr& data) {
-                                registerHubDiscoveryPrefix(data);
-                              },
-                              [this] (uint32_t code, const std::string& msg) {
-                                m_nextStageOnFailure(msg);
-                              });
+  util::SegmentFetcher::fetch(
+    m_face, Interest("/localhost/nfd/faces/list"),
+    m_validator,
+    [this] (const ConstBufferPtr& data) { registerHubDiscoveryPrefix(data); },
+    [this] (uint32_t code, const std::string& msg) { m_nextStageOnFailure(msg); });
 }
 
 void
@@ -73,9 +70,9 @@
 
     offset += block.size();
 
-    nfd::FaceStatus faceStatus(block);
+    ndn::nfd::FaceStatus faceStatus(block);
 
-    ndn::util::FaceUri uri(faceStatus.getRemoteUri());
+    FaceUri uri(faceStatus.getRemoteUri());
     if (uri.getScheme() == "udp4") {
       namespace ip = boost::asio::ip;
       boost::system::error_code ec;
@@ -93,22 +90,21 @@
     m_nextStageOnFailure("No multicast faces available, skipping multicast discovery stage");
   }
   else {
-    nfd::ControlParameters parameters;
+    ControlParameters parameters;
     parameters
       .setName(LOCALHOP_HUB_DISCOVERY_PREFIX)
       .setCost(1)
       .setExpirationPeriod(time::seconds(30));
 
-    nRequestedRegs = multicastFaces.size();
-    nFinishedRegs = 0;
+    m_nRequestedRegs = multicastFaces.size();
+    m_nFinishedRegs = 0;
 
     for (const auto& face : multicastFaces) {
       parameters.setFaceId(face);
-      m_controller.start<nfd::RibRegisterCommand>(parameters,
-                                                  bind(&MulticastDiscovery::onRegisterSuccess,
-                                                       this),
-                                                  bind(&MulticastDiscovery::onRegisterFailure,
-                                                       this, _1));
+      m_controller.start<ndn::nfd::RibRegisterCommand>(
+        parameters,
+        bind(&MulticastDiscovery::onRegisterSuccess, this),
+        bind(&MulticastDiscovery::onRegisterFailure, this, _1));
     }
   }
 }
@@ -116,23 +112,24 @@
 void
 MulticastDiscovery::onRegisterSuccess()
 {
-  ++nFinishedRegs;
+  ++m_nFinishedRegs;
 
-  if (nRequestedRegs == nFinishedRegs) {
+  if (m_nRequestedRegs == m_nFinishedRegs) {
     MulticastDiscovery::setStrategy();
   }
 }
 
 void
-MulticastDiscovery::onRegisterFailure(const nfd::ControlResponse& response)
+MulticastDiscovery::onRegisterFailure(const ControlResponse& response)
 {
   std::cerr << "ERROR: " << response.getText() << " (code: " << response.getCode() << ")" << std::endl;
-  --nRequestedRegs;
+  --m_nRequestedRegs;
 
-  if (nRequestedRegs == nFinishedRegs) {
-    if (nRequestedRegs > 0) {
+  if (m_nRequestedRegs == m_nFinishedRegs) {
+    if (m_nRequestedRegs > 0) {
       MulticastDiscovery::setStrategy();
-    } else {
+    }
+    else {
       m_nextStageOnFailure("Failed to register " + LOCALHOP_HUB_DISCOVERY_PREFIX.toUri() +
                            " for all multicast faces, skipping multicast discovery stage");
     }
@@ -142,19 +139,19 @@
 void
 MulticastDiscovery::setStrategy()
 {
-  nfd::ControlParameters parameters;
+  ControlParameters parameters;
   parameters
     .setName(LOCALHOP_HUB_DISCOVERY_PREFIX)
     .setStrategy("/localhost/nfd/strategy/multicast");
 
-  m_controller.start<nfd::StrategyChoiceSetCommand>(parameters,
-                                                    bind(&MulticastDiscovery::requestHubData, this),
-                                                    bind(&MulticastDiscovery::onSetStrategyFailure,
-                                                         this, _1));
+  m_controller.start<ndn::nfd::StrategyChoiceSetCommand>(
+    parameters,
+    bind(&MulticastDiscovery::requestHubData, this),
+    bind(&MulticastDiscovery::onSetStrategyFailure, this, _1));
 }
 
 void
-MulticastDiscovery::onSetStrategyFailure(const nfd::ControlResponse& response)
+MulticastDiscovery::onSetStrategyFailure(const ControlResponse& response)
 {
   m_nextStageOnFailure("Failed to set multicast strategy for " +
                        LOCALHOP_HUB_DISCOVERY_PREFIX.toUri() + " namespace (" + response.getText() + "). "
