diff --git a/tests/unit/clients/iterative-query-controller.cpp b/tests/unit/clients/iterative-query-controller.cpp
index 254b4f3..a34375b 100644
--- a/tests/unit/clients/iterative-query-controller.cpp
+++ b/tests/unit/clients/iterative-query-controller.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014, Regents of the University of California.
+ * Copyright (c) 2014-2016, Regents of the University of California.
  *
  * This file is part of NDNS (Named Data Networking Domain Name Service).
  * See AUTHORS.md for complete list of NDNS authors and contributors.
@@ -37,25 +37,25 @@
 {
 public:
   QueryControllerFixture()
-    : producerFace(ndn::util::makeDummyClientFace(io, { false, true }))
-    , consumerFace(ndn::util::makeDummyClientFace(io, { false, true }))
-    , validator(*producerFace)
-    , top(m_root.getName(), m_certName, *producerFace, m_session, m_keyChain, validator)
-    , net(m_net.getName(), m_certName, *producerFace, m_session, m_keyChain, validator)
-    , ndnsim(m_ndnsim.getName(), m_certName, *producerFace, m_session, m_keyChain, validator)
+    : producerFace(io, {false, true})
+    , consumerFace(io, {false, true})
+    , validator(producerFace)
+    , top(m_root.getName(), m_certName, producerFace, m_session, m_keyChain, validator)
+    , net(m_net.getName(), m_certName, producerFace, m_session, m_keyChain, validator)
+    , ndnsim(m_ndnsim.getName(), m_certName, producerFace, m_session, m_keyChain, validator)
   {
     run();
-    producerFace->onSendInterest.connect([this] (const Interest& interest) {
-      io.post([=] { consumerFace->receive(interest); });
+    producerFace.onSendInterest.connect([this] (const Interest& interest) {
+      io.post([=] { consumerFace.receive(interest); });
     });
-    consumerFace->onSendInterest.connect([this] (const Interest& interest) {
-      io.post([=] { producerFace->receive(interest); });
+    consumerFace.onSendInterest.connect([this] (const Interest& interest) {
+      io.post([=] { producerFace.receive(interest); });
     });
-    producerFace->onSendData.connect([this] (const Data& data) {
-      io.post([=] { consumerFace->receive(data); });
+    producerFace.onSendData.connect([this] (const Data& data) {
+      io.post([=] { consumerFace.receive(data); });
     });
-    consumerFace->onSendData.connect([this] (const Data& data) {
-      io.post([=] { producerFace->receive(data); });
+    consumerFace.onSendData.connect([this] (const Data& data) {
+      io.post([=] { producerFace.receive(data); });
     });
   }
 
@@ -68,8 +68,8 @@
 
 public:
   boost::asio::io_service io;
-  shared_ptr<ndn::util::DummyClientFace> producerFace;
-  shared_ptr<ndn::util::DummyClientFace> consumerFace;
+  ndn::util::DummyClientFace producerFace;
+  ndn::util::DummyClientFace consumerFace;
 
   Name hint;
   Validator validator;
@@ -102,7 +102,7 @@
     [&hasDataBack] (uint32_t errCode, const std::string& errMsg) {
       BOOST_CHECK(false);
     },
-    *consumerFace);
+    consumerFace);
 
   // IterativeQueryController is a whole process
   // the tester should not send Interest one by one
diff --git a/tests/unit/daemon/name-server.cpp b/tests/unit/daemon/name-server.cpp
index 9e7a926..8944759 100644
--- a/tests/unit/daemon/name-server.cpp
+++ b/tests/unit/daemon/name-server.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014, Regents of the University of California.
+ * Copyright (c) 2014-2016, Regents of the University of California.
  *
  * This file is part of NDNS (Named Data Networking Domain Name Service).
  * See AUTHORS.md for complete list of NDNS authors and contributors.
@@ -40,10 +40,10 @@
 {
 public:
   NameServerFixture()
-    : face(ndn::util::makeDummyClientFace({ false, true }))
+    : face({false, true})
     , zone(m_root.getName())
-    , validator(*face)
-    , server(zone, m_certName, *face, m_session, m_keyChain, validator)
+    , validator(face)
+    , server(zone, m_certName, face, m_session, m_keyChain, validator)
   {
     // ensure prefix is registered
     run();
@@ -52,12 +52,12 @@
   void
   run()
   {
-    face->getIoService().poll();
-    face->getIoService().reset();
+    face.getIoService().poll();
+    face.getIoService().reset();
   }
 
 public:
-  shared_ptr<ndn::util::DummyClientFace> face;
+  ndn::util::DummyClientFace face;
   Name hint;
   const Name& zone;
   Validator validator;
@@ -74,7 +74,7 @@
 
   bool hasDataBack = false;
 
-  face->onSendData.connectSingleShot([&] (const Data& data) {
+  face.onSendData.connectSingleShot([&] (const Data& data) {
     hasDataBack = true;
     NDNS_LOG_TRACE("get Data back");
     BOOST_CHECK_EQUAL(data.getName().getPrefix(-1), q.toInterest().getName());
@@ -84,7 +84,7 @@
     BOOST_CHECK_EQUAL(resp.getNdnsType(), NDNS_RESP);
   });
 
-  face->receive(q.toInterest());
+  face.receive(q.toInterest());
 
   run();
 
@@ -100,7 +100,7 @@
   size_t nDataBack = 0;
 
   // will ask for non-existing record
-  face->onSendData.connectSingleShot([&] (const Data& data) {
+  face.onSendData.connectSingleShot([&] (const Data& data) {
     ++nDataBack;
     NDNS_LOG_TRACE("get Data back");
     BOOST_CHECK_EQUAL(data.getName().getPrefix(-1), q.toInterest().getName());
@@ -110,11 +110,11 @@
     BOOST_CHECK_EQUAL(resp.getNdnsType(), NDNS_NACK);
   });
 
-  face->receive(q.toInterest());
+  face.receive(q.toInterest());
   run();
 
   // will ask for the existing record (will have type NDNS_RAW, as it is certificate)
-  face->onSendData.connectSingleShot([&] (const Data& data) {
+  face.onSendData.connectSingleShot([&] (const Data& data) {
     ++nDataBack;
     NDNS_LOG_TRACE("get Data back");
     BOOST_CHECK_EQUAL(data.getName().getPrefix(-1), q.toInterest().getName());
@@ -126,15 +126,15 @@
 
   q.setRrLabel("dsk-1");
 
-  face->receive(q.toInterest());
+  face.receive(q.toInterest());
   run();
 
   BOOST_CHECK_EQUAL(nDataBack, 2);
 
   // explicit interest with correct version
-  face->receive(Interest("/test19/KEY/dsk-1/ID-CERT/%FDd"));
+  face.receive(Interest("/test19/KEY/dsk-1/ID-CERT/%FDd"));
 
-  face->onSendData.connectSingleShot([&] (const Data& data) {
+  face.onSendData.connectSingleShot([&] (const Data& data) {
     ++nDataBack;
 
     Response resp;
@@ -146,9 +146,9 @@
   BOOST_CHECK_EQUAL(nDataBack, 3);
 
   // explicit interest with wrong version
-  face->receive(Interest("/test19/KEY/dsk-1/ID-CERT/%FD010101010"));
+  face.receive(Interest("/test19/KEY/dsk-1/ID-CERT/%FD010101010"));
 
-  face->onSendData.connectSingleShot([&] (const Data& data) {
+  face.onSendData.connectSingleShot([&] (const Data& data) {
     ++nDataBack;
 
     Response resp;
@@ -187,7 +187,7 @@
 
   bool hasDataBack = false;
 
-  face->onSendData.connectSingleShot([&] (const Data& data) {
+  face.onSendData.connectSingleShot([&] (const Data& data) {
     hasDataBack = true;
     NDNS_LOG_TRACE("get Data back");
     BOOST_CHECK_EQUAL(data.getName().getPrefix(-1), q.toInterest().getName());
@@ -206,7 +206,7 @@
     BOOST_CHECK_EQUAL(ret, 0);
   });
 
-  face->receive(q.toInterest());
+  face.receive(q.toInterest());
   run();
 
   BOOST_CHECK_EQUAL(hasDataBack, true);
@@ -239,7 +239,7 @@
 
   bool hasDataBack = false;
 
-  face->onSendData.connectSingleShot([&] (const Data& data) {
+  face.onSendData.connectSingleShot([&] (const Data& data) {
     hasDataBack = true;
     NDNS_LOG_TRACE("get Data back");
     BOOST_CHECK_EQUAL(data.getName().getPrefix(-1), q.toInterest().getName());
@@ -258,7 +258,7 @@
     BOOST_CHECK_EQUAL(ret, 0);
   });
 
-  face->receive(q.toInterest());
+  face.receive(q.toInterest());
   run();
 
   BOOST_CHECK_EQUAL(hasDataBack, true);
@@ -316,12 +316,12 @@
   bool hasDataBack = false;
 
   // no data back, since the Update cannot pass verification
-  face->onSendData.connectSingleShot([&] (const Data& data) {
+  face.onSendData.connectSingleShot([&] (const Data& data) {
     hasDataBack = true;
     BOOST_FAIL("UNEXPECTED");
   });
 
-  face->receive(q.toInterest());
+  face.receive(q.toInterest());
   run();
 
   BOOST_CHECK_EQUAL(hasDataBack, false);
@@ -331,21 +331,21 @@
 {
 public:
   NameServerFixture2()
-    : face(ndn::util::makeDummyClientFace(io, { false, true }))
-    , validatorFace(ndn::util::makeDummyClientFace(io, { false, true }))
+    : face(io, m_keyChain, {false, true})
+    , validatorFace(io, m_keyChain, {false, true})
     , zone(m_root.getName())
-    , validator(*validatorFace) // different face for validator
-    , server(zone, m_certName, *face, m_session, m_keyChain, validator)
+    , validator(validatorFace) // different face for validator
+    , server(zone, m_certName, face, m_session, m_keyChain, validator)
   {
     // ensure prefix is registered
     run();
 
-    validatorFace->onSendInterest.connect([this] (const Interest& interest) {
+    validatorFace.onSendInterest.connect([this] (const Interest& interest) {
       NDNS_LOG_TRACE("validatorFace get Interest: " << interest.getName());
 
       shared_ptr<const Interest> i = interest.shared_from_this();
       io.post([i, this] {
-          face->receive(*i);
+          face.receive(*i);
         });
     });
   }
@@ -359,8 +359,8 @@
 
 public:
   boost::asio::io_service io;
-  shared_ptr<ndn::util::DummyClientFace> face;
-  shared_ptr<ndn::util::DummyClientFace> validatorFace;
+  ndn::util::DummyClientFace face;
+  ndn::util::DummyClientFace validatorFace;
   Name hint;
   const Name& zone;
   Validator validator;
@@ -419,11 +419,11 @@
   bool hasDataBack = false;
 
   shared_ptr<Regex> regex = make_shared<Regex>("(<>*)<KEY>(<>+)<ID-CERT><>");
-  face->onSendData.connect([&] (const Data& data) {
+  face.onSendData.connect([&] (const Data& data) {
     if (regex->match(data.getName())) {
       shared_ptr<const Data> d = data.shared_from_this();
       io.post([d, this] {
-          validatorFace->receive(*d); // It's data requested by validator
+          validatorFace.receive(*d); // It's data requested by validator
         });
     }
     else {
@@ -447,7 +447,7 @@
     }
   });
 
-  face->receive(q.toInterest());
+  face.receive(q.toInterest());
   run();
 
   BOOST_CHECK_EQUAL(hasDataBack, true);
diff --git a/tests/unit/validator.cpp b/tests/unit/validator.cpp
index 1ec16c6..b5fcfeb 100644
--- a/tests/unit/validator.cpp
+++ b/tests/unit/validator.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014, Regents of the University of California.
+ * Copyright (c) 2014-2016, Regents of the University of California.
  *
  * This file is part of NDNS (Named Data Networking Domain Name Service).
  * See AUTHORS.md for complete list of NDNS authors and contributors.
@@ -41,7 +41,7 @@
     , m_randomId("/test03")
     , m_keyChain("sqlite3", "file")
     , m_version(name::Component::fromVersion(0))
-    , m_face(ndn::util::makeDummyClientFace(ndn::util::DummyClientFace::Options { false, true }))
+    , m_face(m_keyChain, {false, true})
   {
     m_keyChain.deleteIdentity(m_testId1);
     m_keyChain.deleteIdentity(m_testId2);
@@ -60,13 +60,13 @@
     m_keyChain.addCertificate(*cert);
     NDNS_LOG_TRACE("add cert: " << cert->getName() << " to KeyChain");
 
-    m_face->onSendInterest.connect(bind(&Fixture::respondInterest, this, _1));
+    m_face.onSendInterest.connect(bind(&Fixture::respondInterest, this, _1));
   }
 
   ~Fixture()
   {
-    m_face->getIoService().stop();
-    m_face->shutdown();
+    m_face.getIoService().stop();
+    m_face.shutdown();
     m_keyChain.deleteIdentity(m_testId1);
     m_keyChain.deleteIdentity(m_testId2);
     m_keyChain.deleteIdentity(m_testId3);
@@ -133,8 +133,8 @@
     NDNS_LOG_TRACE("validator needs: " << certName);
     BOOST_CHECK_EQUAL(m_keyChain.doesCertificateExist(certName), true);
     auto cert = m_keyChain.getCertificate(certName);
-    m_face->getIoService().post([this, cert] {
-        m_face->receive<Data>(*cert);
+    m_face.getIoService().post([this, cert] {
+        m_face.receive<Data>(*cert);
       });
   }
 
@@ -158,14 +158,14 @@
 
   name::Component m_version;
 
-  shared_ptr<ndn::util::DummyClientFace> m_face;
+  ndn::util::DummyClientFace m_face;
 };
 
 
 BOOST_FIXTURE_TEST_CASE(Basic, Fixture)
 {
   // validator must be created after root key is saved to the target
-  ndns::Validator validator(*m_face, TEST_CONFIG_PATH "/" "validator.conf");
+  ndns::Validator validator(m_face, TEST_CONFIG_PATH "/" "validator.conf");
 
   Name dataName(m_testId3);
   dataName.append("NDNS")
@@ -186,7 +186,7 @@
                        BOOST_CHECK(false);
                      });
 
-  m_face->processEvents(time::milliseconds(-1));
+  m_face.processEvents(time::milliseconds(-1));
 
   BOOST_CHECK_EQUAL(hasValidated, true);
 
@@ -210,7 +210,7 @@
                        BOOST_CHECK(true);
                      });
 
-  m_face->processEvents(time::milliseconds(-1));
+  m_face.processEvents(time::milliseconds(-1));
   // cannot pass verification due to key's owner's name is longer than data owner's
   BOOST_CHECK_EQUAL(hasValidated, true);
 
@@ -234,7 +234,7 @@
                        BOOST_CHECK(true);
                      });
 
-  m_face->processEvents(time::milliseconds(-1));
+  m_face.processEvents(time::milliseconds(-1));
   // cannot pass due to self-sign cert is used
   BOOST_CHECK_EQUAL(hasValidated, true);
 
@@ -257,7 +257,7 @@
                        BOOST_CHECK(true);
                      });
 
-  m_face->processEvents(time::milliseconds(-1));
+  m_face.processEvents(time::milliseconds(-1));
   // cannot pass due to a totally mismatched key
   BOOST_CHECK_EQUAL(hasValidated, true);
 }
