diff --git a/src/util/dummy-client-face.cpp b/src/util/dummy-client-face.cpp
new file mode 100644
index 0000000..a7ab505
--- /dev/null
+++ b/src/util/dummy-client-face.cpp
@@ -0,0 +1,185 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2013-2014 Regents of the University of California.
+ *
+ * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-cxx library is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ */
+
+#include "dummy-client-face.hpp"
+#include "../transport/transport.hpp"
+#include "../management/nfd-controller.hpp"
+#include "../management/nfd-control-response.hpp"
+
+namespace ndn {
+namespace util {
+
+const DummyClientFace::Options DummyClientFace::DEFAULT_OPTIONS { true, false };
+
+class DummyClientFace::Transport : public ndn::Transport
+{
+public:
+  void
+  receive(const Block& block)
+  {
+    if (static_cast<bool>(m_receiveCallback))
+      m_receiveCallback(block);
+  }
+
+  virtual void
+  close()
+  {
+  }
+
+  virtual void
+  pause()
+  {
+  }
+
+  virtual void
+  resume()
+  {
+  }
+
+  virtual void
+  send(const Block& wire)
+  {
+    if (wire.type() == tlv::Interest) {
+      shared_ptr<Interest> interest = make_shared<Interest>(wire);
+      (*m_onInterest)(*interest);
+    }
+    else if (wire.type() == tlv::Data) {
+      shared_ptr<Data> data = make_shared<Data>(wire);
+      (*m_onData)(*data);
+    }
+  }
+
+  virtual void
+  send(const Block& header, const Block& payload)
+  {
+    this->send(payload);
+  }
+
+  boost::asio::io_service&
+  getIoService()
+  {
+    return *m_ioService;
+  }
+
+private:
+  friend class DummyClientFace;
+  EventEmitter<Interest>* m_onInterest;
+  EventEmitter<Data>* m_onData;
+};
+
+DummyClientFace::DummyClientFace(const Options& options, shared_ptr<Transport> transport)
+  : Face(transport)
+  , m_transport(transport)
+{
+  this->construct(options);
+}
+
+DummyClientFace::DummyClientFace(const Options& options, shared_ptr<Transport> transport,
+                                 boost::asio::io_service& ioService)
+  : Face(transport, ioService)
+  , m_transport(transport)
+{
+  this->construct(options);
+}
+
+void
+DummyClientFace::construct(const Options& options)
+{
+  m_transport->m_onInterest = &onInterest;
+  m_transport->m_onData     = &onData;
+
+  if (options.enablePacketLogging)
+    this->enablePacketLogging();
+
+  if (options.enableRegistrationReply)
+    this->enableRegistrationReply();
+}
+
+void
+DummyClientFace::enablePacketLogging()
+{
+  onInterest += [this] (const Interest& interest) { this->sentInterests.push_back(interest); };
+  onData     += [this] (const Data& data)         { this->sentDatas.push_back(data); };
+}
+
+void
+DummyClientFace::enableRegistrationReply()
+{
+  onInterest += [this] (const Interest& interest) {
+    static const Name localhostRegistration("/localhost/nfd/rib");
+    if (!localhostRegistration.isPrefixOf(interest.getName()))
+      return;
+
+    nfd::ControlParameters params(interest.getName().get(-5).blockFromValue());
+    params.setFaceId(1);
+    params.setOrigin(0);
+    if (interest.getName().get(3) == name::Component("register")) {
+      params.setCost(0);
+    }
+
+    nfd::ControlResponse resp;
+    resp.setCode(200);
+    resp.setBody(params.wireEncode());
+
+    shared_ptr<Data> data = make_shared<Data>(interest.getName());
+    data->setContent(resp.wireEncode());
+
+    KeyChain keyChain;
+    keyChain.signWithSha256(*data);
+
+    this->getIoService().post([this, data] { this->receive(*data); });
+  };
+}
+
+template<typename Packet>
+void
+DummyClientFace::receive(const Packet& packet)
+{
+  m_transport->receive(packet.wireEncode());
+}
+
+template void
+DummyClientFace::receive<Interest>(const Interest& packet);
+
+template void
+DummyClientFace::receive<Data>(const Data& packet);
+
+
+shared_ptr<DummyClientFace>
+makeDummyClientFace(const DummyClientFace::Options& options)
+{
+  // cannot use make_shared<DummyClientFace> before DummyClientFace constructor is private
+  return shared_ptr<DummyClientFace>(
+         new DummyClientFace(options, make_shared<DummyClientFace::Transport>()));
+}
+
+shared_ptr<DummyClientFace>
+makeDummyClientFace(boost::asio::io_service& ioService,
+                    const DummyClientFace::Options& options)
+{
+  // cannot use make_shared<DummyClientFace> before DummyClientFace constructor is private
+  return shared_ptr<DummyClientFace>(
+         new DummyClientFace(options, make_shared<DummyClientFace::Transport>(),
+                             ref(ioService)));
+}
+
+} // namespace util
+} // namespace ndn
diff --git a/src/util/dummy-client-face.hpp b/src/util/dummy-client-face.hpp
new file mode 100644
index 0000000..5ea9fab
--- /dev/null
+++ b/src/util/dummy-client-face.hpp
@@ -0,0 +1,133 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2013-2014 Regents of the University of California.
+ *
+ * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-cxx library is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ */
+
+#ifndef NDN_UTIL_DUMMY_CLIENT_FACE_HPP
+#define NDN_UTIL_DUMMY_CLIENT_FACE_HPP
+
+#include "../face.hpp"
+#include "event-emitter.hpp"
+
+namespace ndn {
+namespace util {
+
+/** \brief a client-side face for unit testing
+ */
+class DummyClientFace : public ndn::Face
+{
+public:
+  /** \brief options for DummyClientFace
+   */
+  struct Options
+  {
+    /** \brief if true, packets sent out of DummyClientFace will be appended to a container
+     */
+    bool enablePacketLogging;
+
+    /** \brief if true, prefix registration command will be automatically
+     *         replied with a successful response
+     */
+    bool enableRegistrationReply;
+  };
+
+  /** \brief cause the Face to receive a packet
+   *  \tparam Packet either Interest or Data
+   */
+  template<typename Packet>
+  void
+  receive(const Packet& packet);
+
+private: // constructors
+  class Transport;
+
+  // constructors are private; use makeDummyClientFace to create DummyClientFace
+
+  DummyClientFace(const Options& options, shared_ptr<Transport> transport);
+
+  DummyClientFace(const Options& options, shared_ptr<Transport> transport,
+                  boost::asio::io_service& ioService);
+
+  void
+  construct(const Options& options);
+
+  friend shared_ptr<DummyClientFace>
+  makeDummyClientFace(const DummyClientFace::Options& options);
+
+  friend shared_ptr<DummyClientFace>
+  makeDummyClientFace(boost::asio::io_service& ioService, const DummyClientFace::Options& options);
+
+private:
+  void
+  enablePacketLogging();
+
+  void
+  enableRegistrationReply();
+
+public:
+  /** \brief default options
+   *
+   *  enablePacketLogging=true
+   *  enableRegistrationReply=false
+   */
+  static const Options DEFAULT_OPTIONS;
+
+  /** \brief Interests sent out of this DummyClientFace
+   *
+   *  Sent Interests are appended to this container if options.enablePacketLogger is true.
+   *  User of this class is responsible for cleaning up the container, if necessary.
+   *  After .expressInterest, .processEvents must be called before the Interest would show up here.
+   */
+  std::vector<Interest> sentInterests;
+
+  /** \brief Data sent out of this DummyClientFace
+   *
+   *  Sent Data are appended to this container if options.enablePacketLogger is true.
+   *  User of this class is responsible for cleaning up the container, if necessary.
+   *  After .put, .processEvents must be called before the Data would show up here.
+   */
+  std::vector<Data> sentDatas;
+
+  /** \brief Event to be called whenever an Interest is received
+   *
+   *  After .expressInterest, .processEvents must be called before this event would be triggered.
+   */
+  util::EventEmitter<Interest> onInterest;
+
+  /** \brief Event to be called whenever a Data packet is received
+   *
+   *  After .put, .processEvents must be called before this event would be triggered.
+   */
+  util::EventEmitter<Data> onData;
+
+private:
+  shared_ptr<Transport> m_transport;
+};
+
+shared_ptr<DummyClientFace>
+makeDummyClientFace(const DummyClientFace::Options& options = DummyClientFace::DEFAULT_OPTIONS);
+
+shared_ptr<DummyClientFace>
+makeDummyClientFace(boost::asio::io_service& ioService,
+                    const DummyClientFace::Options& options = DummyClientFace::DEFAULT_OPTIONS);
+
+} // namespace util
+} // namespace ndn
+
+#endif // NDN_UTIL_DUMMY_CLIENT_FACE_HPP
diff --git a/tests/unit-tests/dummy-client-face.hpp b/tests/unit-tests/dummy-client-face.hpp
deleted file mode 100644
index 82d9c7c..0000000
--- a/tests/unit-tests/dummy-client-face.hpp
+++ /dev/null
@@ -1,217 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2014 Regents of the University of California.
- *
- * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
- *
- * ndn-cxx library is free software: you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free Software
- * Foundation, either version 3 of the License, or (at your option) any later version.
- *
- * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
- *
- * You should have received copies of the GNU General Public License and GNU Lesser
- * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
- * <http://www.gnu.org/licenses/>.
- *
- * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
- */
-
-#ifndef NDN_TESTS_UNIT_TESTS_DUMMY_CLIENT_FACE_HPP
-#define NDN_TESTS_UNIT_TESTS_DUMMY_CLIENT_FACE_HPP
-
-#include "face.hpp"
-#include "transport/transport.hpp"
-#include "management/nfd-controller.hpp"
-#include "management/nfd-control-response.hpp"
-#include "util/event-emitter.hpp"
-
-namespace ndn {
-namespace tests {
-
-class DummyClientTransport : public ndn::Transport
-{
-public:
-  void
-  receive(const Block& block)
-  {
-    if (static_cast<bool>(m_receiveCallback))
-      m_receiveCallback(block);
-  }
-
-  virtual void
-  close()
-  {
-  }
-
-  virtual void
-  pause()
-  {
-  }
-
-  virtual void
-  resume()
-  {
-  }
-
-  virtual void
-  send(const Block& wire)
-  {
-    if (wire.type() == tlv::Interest) {
-      shared_ptr<Interest> interest = make_shared<Interest>(wire);
-      (*m_onInterest)(*interest, this);
-    }
-    else if (wire.type() == tlv::Data) {
-      shared_ptr<Data> data = make_shared<Data>(wire);
-      (*m_onData)(*data, this);
-    }
-  }
-
-  virtual void
-  send(const Block& header, const Block& payload)
-  {
-    this->send(payload);
-  }
-
-  boost::asio::io_service&
-  getIoService()
-  {
-    return *m_ioService;
-  }
-
-private:
-  friend class DummyClientFace;
-  util::EventEmitter<Interest, DummyClientTransport*>* m_onInterest;
-  util::EventEmitter<Data, DummyClientTransport*>* m_onData;
-};
-
-
-/** \brief Callback to connect
- */
-inline void
-replyNfdRibCommands(const Interest& interest, DummyClientTransport* transport)
-{
-  static const Name localhostRegistration("/localhost/nfd/rib");
-  if (localhostRegistration.isPrefixOf(interest.getName())) {
-    shared_ptr<Data> okResponse = make_shared<Data>(interest.getName());
-    nfd::ControlParameters params(interest.getName().get(-5).blockFromValue());
-    params.setFaceId(1);
-    params.setOrigin(0);
-    if (interest.getName().get(3) == name::Component("register")) {
-      params.setCost(0);
-    }
-    nfd::ControlResponse resp;
-    resp.setCode(200);
-    resp.setBody(params.wireEncode());
-    okResponse->setContent(resp.wireEncode());
-    KeyChain keyChain;
-    keyChain.signWithSha256(*okResponse);
-
-    transport->getIoService().post(bind(&DummyClientTransport::receive, transport,
-                                        okResponse->wireEncode()));
-  }
-}
-
-/** \brief a client-side face for unit testing
- */
-class DummyClientFace : public ndn::Face
-{
-public:
-  explicit
-  DummyClientFace(shared_ptr<DummyClientTransport> transport)
-    : Face(transport)
-    , m_transport(transport)
-  {
-    m_transport->m_onInterest = &onInterest;
-    m_transport->m_onData     = &onData;
-
-    enablePacketLogging();
-  }
-
-  DummyClientFace(shared_ptr<DummyClientTransport> transport, boost::asio::io_service& ioService)
-    : Face(transport, ioService)
-    , m_transport(transport)
-  {
-    m_transport->m_onInterest = &onInterest;
-    m_transport->m_onData     = &onData;
-
-    enablePacketLogging();
-  }
-
-  /** \brief cause the Face to receive a packet
-   */
-  template<typename Packet>
-  void
-  receive(const Packet& packet)
-  {
-    m_transport->receive(packet.wireEncode());
-  }
-
-  void
-  enablePacketLogging()
-  {
-    // @todo Replace with C++11 lambdas
-
-    onInterest += bind(static_cast<void(std::vector<Interest>::*)(const Interest&)>(
-                         &std::vector<Interest>::push_back),
-                       &m_sentInterests, _1);
-
-    onData += bind(static_cast<void(std::vector<Data>::*)(const Data&)>(
-                     &std::vector<Data>::push_back),
-                   &m_sentDatas, _1);
-  }
-
-  void
-  enableRegistrationReply()
-  {
-    onInterest += &replyNfdRibCommands;
-  }
-
-public:
-  /** \brief sent Interests
-   *  \note After .expressInterest, .processEvents must be called before
-   *        the Interest would show up here.
-   */
-  std::vector<Interest> m_sentInterests;
-  /** \brief sent Datas
-   *  \note After .put, .processEvents must be called before
-   *        the Interest would show up here.
-   */
-  std::vector<Data>     m_sentDatas;
-
-public:
-  /** \brief Event to be called whenever an Interest is received
-   *  \note After .expressInterest, .processEvents must be called before
-   *        the Interest would show up here.
-   */
-  util::EventEmitter<Interest, DummyClientTransport*> onInterest;
-
-  /** \brief Event to be called whenever a Data packet is received
-   *  \note After .put, .processEvents must be called before
-   *        the Interest would show up here.
-   */
-  util::EventEmitter<Data, DummyClientTransport*> onData;
-
-private:
-  shared_ptr<DummyClientTransport> m_transport;
-};
-
-inline shared_ptr<DummyClientFace>
-makeDummyClientFace()
-{
-  return make_shared<DummyClientFace>(make_shared<DummyClientTransport>());
-}
-
-inline shared_ptr<DummyClientFace>
-makeDummyClientFace(boost::asio::io_service& ioService)
-{
-  return make_shared<DummyClientFace>(make_shared<DummyClientTransport>(), ref(ioService));
-}
-
-
-} // namespace tests
-} // namespace ndn
-
-#endif // NDN_TESTS_UNIT_TESTS_DUMMY_CLIENT_FACE_HPP
diff --git a/tests/unit-tests/face.cpp b/tests/unit-tests/face.cpp
index dcbff0b..1d45910 100644
--- a/tests/unit-tests/face.cpp
+++ b/tests/unit-tests/face.cpp
@@ -21,13 +21,16 @@
 
 #include "face.hpp"
 #include "security/key-chain.hpp"
-#include "dummy-client-face.hpp"
 
 #include "boost-test.hpp"
+#include "util/dummy-client-face.hpp"
 
 namespace ndn {
 namespace tests {
 
+using ndn::util::DummyClientFace;
+using ndn::util::makeDummyClientFace;
+
 BOOST_AUTO_TEST_SUITE(TestsFace)
 
 class Fixture
@@ -65,8 +68,8 @@
                         bind(&Fixture::onTimeout, this));
   face->processEvents(time::milliseconds(100));
 
-  BOOST_CHECK_EQUAL(face->m_sentInterests.size(), 1);
-  BOOST_CHECK_EQUAL(face->m_sentDatas.size(), 0);
+  BOOST_CHECK_EQUAL(face->sentInterests.size(), 1);
+  BOOST_CHECK_EQUAL(face->sentDatas.size(), 0);
 }
 
 BOOST_FIXTURE_TEST_CASE(RemovePendingInterest, Fixture)
diff --git a/tests/unit-tests/management/test-nfd-controller.cpp b/tests/unit-tests/management/test-nfd-controller.cpp
index 478fdaa..b93149f 100644
--- a/tests/unit-tests/management/test-nfd-controller.cpp
+++ b/tests/unit-tests/management/test-nfd-controller.cpp
@@ -25,13 +25,14 @@
 #include <boost/tuple/tuple.hpp>
 
 #include "boost-test.hpp"
-#include "../dummy-client-face.hpp"
+#include "util/dummy-client-face.hpp"
 
 namespace ndn {
 namespace nfd {
 namespace tests {
 
-using namespace ::ndn::tests;
+using ndn::util::DummyClientFace;
+using ndn::util::makeDummyClientFace;
 
 BOOST_AUTO_TEST_SUITE(ManagementTestNfdController)
 
@@ -84,8 +85,8 @@
                        commandFailCallback));
   face->processEvents(time::milliseconds(1));
 
-  BOOST_REQUIRE_EQUAL(face->m_sentInterests.size(), 1);
-  const Interest& requestInterest = face->m_sentInterests[0];
+  BOOST_REQUIRE_EQUAL(face->sentInterests.size(), 1);
+  const Interest& requestInterest = face->sentInterests[0];
 
   FaceCreateCommand command;
   BOOST_CHECK(Name("/localhost/nfd/faces/create").isPrefixOf(requestInterest.getName()));
@@ -141,8 +142,8 @@
                          commandFailCallback));
   face->processEvents(time::milliseconds(1));
 
-  BOOST_REQUIRE_EQUAL(face->m_sentInterests.size(), 1);
-  const Interest& requestInterest = face->m_sentInterests[0];
+  BOOST_REQUIRE_EQUAL(face->sentInterests.size(), 1);
+  const Interest& requestInterest = face->sentInterests[0];
 
   ControlResponse responsePayload(401, "Not Authenticated");
 
@@ -168,8 +169,8 @@
                          commandFailCallback));
   face->processEvents(time::milliseconds(1));
 
-  BOOST_REQUIRE_EQUAL(face->m_sentInterests.size(), 1);
-  const Interest& requestInterest = face->m_sentInterests[0];
+  BOOST_REQUIRE_EQUAL(face->sentInterests.size(), 1);
+  const Interest& requestInterest = face->sentInterests[0];
 
   ControlParameters responseBody;
   responseBody.setUri("tcp4://192.0.2.1:6363")
@@ -204,8 +205,8 @@
                        options));
   face->processEvents(time::milliseconds(1));
 
-  BOOST_REQUIRE_EQUAL(face->m_sentInterests.size(), 1);
-  const Interest& requestInterest = face->m_sentInterests[0];
+  BOOST_REQUIRE_EQUAL(face->sentInterests.size(), 1);
+  const Interest& requestInterest = face->sentInterests[0];
 
   FaceCreateCommand command;
   BOOST_CHECK(Name("/localhop/net/example/router1/nfd/rib/register").isPrefixOf(
diff --git a/tests/unit-tests/test-faces.cpp b/tests/unit-tests/test-faces.cpp
index f5b45f1..3fcae2e 100644
--- a/tests/unit-tests/test-faces.cpp
+++ b/tests/unit-tests/test-faces.cpp
@@ -24,18 +24,19 @@
 #include "security/key-chain.hpp"
 
 #include "boost-test.hpp"
-
-#include "dummy-client-face.hpp"
+#include "util/dummy-client-face.hpp"
 
 namespace ndn {
 namespace tests {
 
+using ndn::util::DummyClientFace;
+using ndn::util::makeDummyClientFace;
+
 class FacesFixture
 {
 public:
-  FacesFixture()
-    : face(makeDummyClientFace(io))
-    , nData(0)
+  FacesFixture(bool enableRegistrationReply = true)
+    : nData(0)
     , nTimeouts(0)
     , nInInterests(0)
     , nInInterests2(0)
@@ -44,6 +45,8 @@
     , nUnregSuccesses(0)
     , nUnregFailures(0)
   {
+    DummyClientFace::Options options { true, enableRegistrationReply };
+    this->face = makeDummyClientFace(io, options);
   }
 
   void
@@ -133,12 +136,19 @@
   uint32_t nUnregFailures;
 };
 
+class FacesNoRegistrationReplyFixture : public FacesFixture
+{
+public:
+  FacesNoRegistrationReplyFixture()
+    : FacesFixture(false)
+  {
+  }
+};
+
 BOOST_FIXTURE_TEST_SUITE(TestFaces, FacesFixture)
 
 BOOST_AUTO_TEST_CASE(ExpressInterestData)
 {
-  face->enableRegistrationReply();
-
   face->expressInterest(Interest("/Hello/World", time::milliseconds(50)),
                         bind(&FacesFixture::onData, this),
                         bind(&FacesFixture::onTimeout, this));
@@ -154,8 +164,6 @@
 
 BOOST_AUTO_TEST_CASE(ExpressInterestTimeout)
 {
-  face->enableRegistrationReply();
-
   face->expressInterest(Interest("/Hello/World", time::milliseconds(50)),
                         bind(&FacesFixture::onData, this),
                         bind(&FacesFixture::onTimeout, this));
@@ -168,8 +176,6 @@
 
 BOOST_AUTO_TEST_CASE(SetFilter)
 {
-  face->enableRegistrationReply();
-
   face->setInterestFilter("/Hello/World",
                           bind(&FacesFixture::onInterest, this, ref(*face), _1, _2),
                           RegisterPrefixSuccessCallback(),
@@ -184,7 +190,7 @@
   BOOST_CHECK_EQUAL(nInInterests, 1);
 }
 
-BOOST_AUTO_TEST_CASE(SetFilterFail)
+BOOST_FIXTURE_TEST_CASE(SetFilterFail, FacesNoRegistrationReplyFixture)
 {
   // don't enable registration reply
 
@@ -200,8 +206,6 @@
 
 BOOST_AUTO_TEST_CASE(SetUnsetInterestFilter)
 {
-  face->enableRegistrationReply();
-
   const RegisteredPrefixId* regPrefixId =
     face->setInterestFilter(InterestFilter("/Hello/World"),
                             bind(&FacesFixture::onInterest, this,
@@ -234,8 +238,6 @@
 
 BOOST_AUTO_TEST_CASE(RegisterUnregisterPrefix)
 {
-  face->enableRegistrationReply();
-
   const RegisteredPrefixId* regPrefixId =
     face->registerPrefix("/Hello/World",
                          bind(&FacesFixture::onRegSucceeded, this),
@@ -257,8 +259,6 @@
 
 BOOST_AUTO_TEST_CASE(SeTwoSimilarFilters)
 {
-  face->enableRegistrationReply();
-
   face->setInterestFilter("/Hello/World",
                           bind(&FacesFixture::onInterest, this, ref(*face), _1, _2),
                           RegisterPrefixSuccessCallback(),
@@ -282,8 +282,6 @@
 
 BOOST_AUTO_TEST_CASE(SetTwoDifferentFilters)
 {
-  face->enableRegistrationReply();
-
   face->setInterestFilter("/Hello/World",
                           bind(&FacesFixture::onInterest, this, ref(*face), _1, _2),
                           RegisterPrefixSuccessCallback(),
@@ -307,8 +305,6 @@
 
 BOOST_AUTO_TEST_CASE(SetRegexFilterError)
 {
-  face->enableRegistrationReply();
-
   face->setInterestFilter(InterestFilter("/Hello/World", "<><b><c>?"),
                           bind(&FacesFixture::onInterestRegexError, this,
                                ref(*face), _1, _2),
@@ -322,8 +318,6 @@
 
 BOOST_AUTO_TEST_CASE(SetRegexFilter)
 {
-  face->enableRegistrationReply();
-
   face->setInterestFilter(InterestFilter("/Hello/World", "<><b><c>?"),
                           bind(&FacesFixture::onInterestRegex, this,
                                ref(*face), _1, _2),
@@ -348,8 +342,6 @@
 
 BOOST_AUTO_TEST_CASE(SetRegexFilterAndRegister)
 {
-  face->enableRegistrationReply();
-
   face->setInterestFilter(InterestFilter("/Hello/World", "<><b><c>?"),
                           bind(&FacesFixture::onInterestRegex, this,
                                ref(*face), _1, _2));
diff --git a/tests/unit-tests/util/notification-stream.cpp b/tests/unit-tests/util/notification-stream.cpp
index 0378bd1..adba5c7 100644
--- a/tests/unit-tests/util/notification-stream.cpp
+++ b/tests/unit-tests/util/notification-stream.cpp
@@ -49,9 +49,10 @@
 #include "simple-notification.hpp"
 
 #include "boost-test.hpp"
-#include "../dummy-client-face.hpp"
+#include "util/dummy-client-face.hpp"
 
 namespace ndn {
+namespace util {
 namespace tests {
 
 BOOST_AUTO_TEST_SUITE(UtilNotificationStream)
@@ -66,25 +67,26 @@
   SimpleNotification event1("msg1");
   notificationStream.postNotification(event1);
   face->processEvents();
-  BOOST_REQUIRE_EQUAL(face->m_sentDatas.size(), 1);
-  BOOST_CHECK_EQUAL(face->m_sentDatas[0].getName(),
+  BOOST_REQUIRE_EQUAL(face->sentDatas.size(), 1);
+  BOOST_CHECK_EQUAL(face->sentDatas[0].getName(),
                     "/localhost/nfd/NotificationStreamTest/%FE%00");
   SimpleNotification decoded1;
-  BOOST_CHECK_NO_THROW(decoded1.wireDecode(face->m_sentDatas[0].getContent().blockFromValue()));
+  BOOST_CHECK_NO_THROW(decoded1.wireDecode(face->sentDatas[0].getContent().blockFromValue()));
   BOOST_CHECK_EQUAL(decoded1.getMessage(), "msg1");
 
   SimpleNotification event2("msg2");
   notificationStream.postNotification(event2);
   face->processEvents();
-  BOOST_REQUIRE_EQUAL(face->m_sentDatas.size(), 2);
-  BOOST_CHECK_EQUAL(face->m_sentDatas[1].getName(),
+  BOOST_REQUIRE_EQUAL(face->sentDatas.size(), 2);
+  BOOST_CHECK_EQUAL(face->sentDatas[1].getName(),
                     "/localhost/nfd/NotificationStreamTest/%FE%01");
   SimpleNotification decoded2;
-  BOOST_CHECK_NO_THROW(decoded2.wireDecode(face->m_sentDatas[1].getContent().blockFromValue()));
+  BOOST_CHECK_NO_THROW(decoded2.wireDecode(face->sentDatas[1].getContent().blockFromValue()));
   BOOST_CHECK_EQUAL(decoded2.getMessage(), "msg2");
 }
 
 BOOST_AUTO_TEST_SUITE_END()
 
 } // namespace tests
+} // namespace util
 } // namespace ndn
diff --git a/tests/unit-tests/util/notification-subscriber.cpp b/tests/unit-tests/util/notification-subscriber.cpp
index 092a601..9d7ab65 100644
--- a/tests/unit-tests/util/notification-subscriber.cpp
+++ b/tests/unit-tests/util/notification-subscriber.cpp
@@ -50,9 +50,11 @@
 #include "simple-notification.hpp"
 
 #include "boost-test.hpp"
-#include "../dummy-client-face.hpp"
+#include <boost/asio.hpp>
+#include "util/dummy-client-face.hpp"
 
 namespace ndn {
+namespace util {
 namespace tests {
 
 BOOST_AUTO_TEST_SUITE(UtilNotificationSubscriber)
@@ -74,18 +76,18 @@
   void
   deliverNotification(const std::string& msg)
   {
-    publisherFace->m_sentDatas.clear();
+    publisherFace->sentDatas.clear();
     SimpleNotification notification(msg);
     notificationStream.postNotification(notification);
 
     publisherFace->processEvents(time::milliseconds(100));
 
-    BOOST_REQUIRE_EQUAL(publisherFace->m_sentDatas.size(), 1);
+    BOOST_REQUIRE_EQUAL(publisherFace->sentDatas.size(), 1);
 
-    lastDeliveredSeqNo = publisherFace->m_sentDatas[0].getName().at(-1).toSequenceNumber();
+    lastDeliveredSeqNo = publisherFace->sentDatas[0].getName().at(-1).toSequenceNumber();
 
     lastNotification.setMessage("");
-    subscriberFace->receive(publisherFace->m_sentDatas[0]);
+    subscriberFace->receive(publisherFace->sentDatas[0]);
   }
 
   void
@@ -117,10 +119,10 @@
   bool
   hasInitialRequest() const
   {
-    if (subscriberFace->m_sentInterests.empty())
+    if (subscriberFace->sentInterests.empty())
       return 0;
 
-    const Interest& interest = subscriberFace->m_sentInterests[0];
+    const Interest& interest = subscriberFace->sentInterests[0];
     return interest.getName() == streamPrefix &&
            interest.getChildSelector() == 1 &&
            interest.getMustBeFresh() &&
@@ -133,10 +135,10 @@
   uint64_t
   getRequestSeqNo() const
   {
-    if (subscriberFace->m_sentInterests.size() != 1)
+    if (subscriberFace->sentInterests.size() != 1)
       return 0;
 
-    const Interest& interest = subscriberFace->m_sentInterests[0];
+    const Interest& interest = subscriberFace->sentInterests[0];
     const Name& name = interest.getName();
     if (streamPrefix.isPrefixOf(name) &&
         name.size() == streamPrefix.size() + 1 &&
@@ -178,30 +180,30 @@
   this->deliverNotification("n1");
   subscriberFace->processEvents(time::milliseconds(100));
   BOOST_CHECK(lastNotification.getMessage().empty());
-  BOOST_CHECK_EQUAL(subscriberFace->m_sentInterests.size(), 0);
+  BOOST_CHECK_EQUAL(subscriberFace->sentInterests.size(), 0);
 
-  subscriberFace->m_sentInterests.clear();
+  subscriberFace->sentInterests.clear();
   subscriber.start();
   subscriberFace->processEvents(time::milliseconds(-100));
   BOOST_REQUIRE_EQUAL(subscriber.isRunning(), true);
   BOOST_CHECK(this->hasInitialRequest());
 
   // respond to initial request
-  subscriberFace->m_sentInterests.clear();
+  subscriberFace->sentInterests.clear();
   this->deliverNotification("n2");
   subscriberFace->processEvents(time::milliseconds(-100));
   BOOST_CHECK_EQUAL(lastNotification.getMessage(), "n2");
   BOOST_CHECK_EQUAL(this->getRequestSeqNo(), lastDeliveredSeqNo + 1);
 
   // respond to continuation request
-  subscriberFace->m_sentInterests.clear();
+  subscriberFace->sentInterests.clear();
   this->deliverNotification("n3");
   subscriberFace->processEvents(time::milliseconds(-100));
   BOOST_CHECK_EQUAL(lastNotification.getMessage(), "n3");
   BOOST_CHECK_EQUAL(this->getRequestSeqNo(), lastDeliveredSeqNo + 1);
 
   // timeout
-  subscriberFace->m_sentInterests.clear();
+  subscriberFace->sentInterests.clear();
   lastNotification.setMessage("");
   subscriberFace->processEvents(2 * subscriber.getInterestLifetime());
   BOOST_CHECK(lastNotification.getMessage().empty());
@@ -214,7 +216,7 @@
   Data wrongData(wrongName);
   publisherKeyChain.sign(wrongData);
   subscriberFace->receive(wrongData);
-  subscriberFace->m_sentInterests.clear();
+  subscriberFace->sentInterests.clear();
   lastNotification.setMessage("");
   subscriberFace->processEvents(time::milliseconds(-100));
   BOOST_CHECK(lastNotification.getMessage().empty());
@@ -222,7 +224,7 @@
   BOOST_CHECK(this->hasInitialRequest());
 
   // decode error in payload
-  subscriberFace->m_sentInterests.clear();
+  subscriberFace->sentInterests.clear();
   lastNotification.setMessage("");
   this->deliverNotification("\x07n4");
   subscriberFace->processEvents(time::milliseconds(-100));
@@ -231,13 +233,14 @@
 
   // stop if handlers are cleared
   subscriber.onNotification += bind(&EndToEndFixture::clearNotificationHandlers, this);
-  subscriberFace->m_sentInterests.clear();
+  subscriberFace->sentInterests.clear();
   this->deliverNotification("n5");
   subscriberFace->processEvents(time::milliseconds(-100));
-  BOOST_CHECK_EQUAL(subscriberFace->m_sentInterests.size(), 0);
+  BOOST_CHECK_EQUAL(subscriberFace->sentInterests.size(), 0);
 }
 
 BOOST_AUTO_TEST_SUITE_END()
 
 } // namespace tests
+} // namespace util
 } // namespace ndn
diff --git a/tests/unit-tests/util/segment-fetcher.cpp b/tests/unit-tests/util/segment-fetcher.cpp
index f5d274d..3a9fc5f 100644
--- a/tests/unit-tests/util/segment-fetcher.cpp
+++ b/tests/unit-tests/util/segment-fetcher.cpp
@@ -22,7 +22,7 @@
 #include "util/segment-fetcher.hpp"
 
 #include "boost-test.hpp"
-#include "../dummy-client-face.hpp"
+#include "util/dummy-client-face.hpp"
 #include "security/key-chain.hpp"
 
 namespace ndn {
@@ -35,7 +35,7 @@
 {
 public:
   Fixture()
-    : face(::ndn::tests::makeDummyClientFace())
+    : face(makeDummyClientFace())
     , nErrors(0)
     , nDatas(0)
     , dataSize(0)
@@ -73,7 +73,7 @@
 
 
 public:
-  shared_ptr<ndn::tests::DummyClientFace> face;
+  shared_ptr<DummyClientFace> face;
   KeyChain keyChain;
 
   uint32_t nErrors;
@@ -94,10 +94,10 @@
   BOOST_CHECK_EQUAL(nErrors, 1);
   BOOST_CHECK_EQUAL(lastError, static_cast<uint32_t>(SegmentFetcher::INTEREST_TIMEOUT));
   BOOST_CHECK_EQUAL(nDatas, 0);
-  BOOST_REQUIRE_EQUAL(face->m_sentInterests.size(), 1);
-  BOOST_CHECK_EQUAL(face->m_sentDatas.size(), 0);
+  BOOST_REQUIRE_EQUAL(face->sentInterests.size(), 1);
+  BOOST_CHECK_EQUAL(face->sentDatas.size(), 0);
 
-  const Interest& interest = face->m_sentInterests[0];
+  const Interest& interest = face->sentInterests[0];
   BOOST_CHECK_EQUAL(interest.getName(), "/hello/world");
   BOOST_CHECK_EQUAL(interest.getMustBeFresh(), true);
   BOOST_CHECK_EQUAL(interest.getChildSelector(), 1);
@@ -122,10 +122,10 @@
 
   BOOST_CHECK_EQUAL(dataSize, 14);
 
-  BOOST_REQUIRE_EQUAL(face->m_sentInterests.size(), 1);
-  BOOST_CHECK_EQUAL(face->m_sentDatas.size(), 0);
+  BOOST_REQUIRE_EQUAL(face->sentInterests.size(), 1);
+  BOOST_CHECK_EQUAL(face->sentDatas.size(), 0);
 
-  const Interest& interest = face->m_sentInterests[0];
+  const Interest& interest = face->sentInterests[0];
   BOOST_CHECK_EQUAL(interest.getName(), "/hello/world");
   BOOST_CHECK_EQUAL(interest.getMustBeFresh(), true);
   BOOST_CHECK_EQUAL(interest.getChildSelector(), 1);
@@ -204,25 +204,25 @@
 
   BOOST_CHECK_EQUAL(dataSize, 42);
 
-  BOOST_REQUIRE_EQUAL(face->m_sentInterests.size(), 3);
-  BOOST_CHECK_EQUAL(face->m_sentDatas.size(), 0);
+  BOOST_REQUIRE_EQUAL(face->sentInterests.size(), 3);
+  BOOST_CHECK_EQUAL(face->sentDatas.size(), 0);
 
   {
-    const Interest& interest = face->m_sentInterests[0];
+    const Interest& interest = face->sentInterests[0];
     BOOST_CHECK_EQUAL(interest.getName(), "/hello/world");
     BOOST_CHECK_EQUAL(interest.getMustBeFresh(), true);
     BOOST_CHECK_EQUAL(interest.getChildSelector(), 1);
   }
 
   {
-    const Interest& interest = face->m_sentInterests[1];
+    const Interest& interest = face->sentInterests[1];
     BOOST_CHECK_EQUAL(interest.getName(), "/hello/world/version0/%00%01");
     BOOST_CHECK_EQUAL(interest.getMustBeFresh(), false);
     BOOST_CHECK_EQUAL(interest.getChildSelector(), 0);
   }
 
   {
-    const Interest& interest = face->m_sentInterests[2];
+    const Interest& interest = face->sentInterests[2];
     BOOST_CHECK_EQUAL(interest.getName(),  "/hello/world/version0/%00%02");
     BOOST_CHECK_EQUAL(interest.getMustBeFresh(), false);
     BOOST_CHECK_EQUAL(interest.getChildSelector(), 0);
@@ -257,32 +257,32 @@
 
   BOOST_CHECK_EQUAL(dataSize, 42);
 
-  BOOST_REQUIRE_EQUAL(face->m_sentInterests.size(), 4);
-  BOOST_CHECK_EQUAL(face->m_sentDatas.size(), 0);
+  BOOST_REQUIRE_EQUAL(face->sentInterests.size(), 4);
+  BOOST_CHECK_EQUAL(face->sentDatas.size(), 0);
 
   {
-    const Interest& interest = face->m_sentInterests[0];
+    const Interest& interest = face->sentInterests[0];
     BOOST_CHECK_EQUAL(interest.getName(), "/hello/world");
     BOOST_CHECK_EQUAL(interest.getMustBeFresh(), true);
     BOOST_CHECK_EQUAL(interest.getChildSelector(), 1);
   }
 
   {
-    const Interest& interest = face->m_sentInterests[1];
+    const Interest& interest = face->sentInterests[1];
     BOOST_CHECK_EQUAL(interest.getName(), "/hello/world/version0/%00%00");
     BOOST_CHECK_EQUAL(interest.getMustBeFresh(), false);
     BOOST_CHECK_EQUAL(interest.getChildSelector(), 0);
   }
 
   {
-    const Interest& interest = face->m_sentInterests[2];
+    const Interest& interest = face->sentInterests[2];
     BOOST_CHECK_EQUAL(interest.getName(), "/hello/world/version0/%00%01");
     BOOST_CHECK_EQUAL(interest.getMustBeFresh(), false);
     BOOST_CHECK_EQUAL(interest.getChildSelector(), 0);
   }
 
   {
-    const Interest& interest = face->m_sentInterests[3];
+    const Interest& interest = face->sentInterests[3];
     BOOST_CHECK_EQUAL(interest.getName(),  "/hello/world/version0/%00%02");
     BOOST_CHECK_EQUAL(interest.getMustBeFresh(), false);
     BOOST_CHECK_EQUAL(interest.getChildSelector(), 0);
diff --git a/tests/unit-tests/util/simple-notification.hpp b/tests/unit-tests/util/simple-notification.hpp
index 2def4bb..e90e374 100644
--- a/tests/unit-tests/util/simple-notification.hpp
+++ b/tests/unit-tests/util/simple-notification.hpp
@@ -54,6 +54,7 @@
 #include "security/key-chain.hpp"
 
 namespace ndn {
+namespace util {
 namespace tests {
 
 class SimpleNotification
@@ -118,6 +119,7 @@
 };
 
 } // namespace tests
+} // namespace util
 } // namespace ndn
 
 #endif // NDN_UNIT_TESTS_UTIL_CORE_SIMPLE_NOTIFICATION_HPP
