diff --git a/tests/daemon/fw/client-control-strategy.t.cpp b/tests/daemon/fw/client-control-strategy.t.cpp
index 8f0870b..e180ec9 100644
--- a/tests/daemon/fw/client-control-strategy.t.cpp
+++ b/tests/daemon/fw/client-control-strategy.t.cpp
@@ -44,10 +44,10 @@
   typedef StrategyTester<fw::ClientControlStrategy> ClientControlStrategyTester;
   ClientControlStrategyTester strategy(forwarder);
 
-  shared_ptr<DummyFace> face1 = make_shared<DummyFace>();
-  shared_ptr<DummyFace> face2 = make_shared<DummyFace>();
-  shared_ptr<DummyFace> face3 = make_shared<DummyFace>();
-  shared_ptr<DummyLocalFace> face4 = make_shared<DummyLocalFace>();
+  auto face1 = make_shared<DummyFace>();
+  auto face2 = make_shared<DummyFace>();
+  auto face3 = make_shared<DummyFace>();
+  auto face4 = make_shared<DummyFace>("dummy://", "dummy://", ndn::nfd::FACE_SCOPE_LOCAL);
   forwarder.addFace(face1);
   forwarder.addFace(face2);
   forwarder.addFace(face3);
diff --git a/tests/daemon/fw/face-table.t.cpp b/tests/daemon/fw/face-table.t.cpp
index 6610034..59bb7c8 100644
--- a/tests/daemon/fw/face-table.t.cpp
+++ b/tests/daemon/fw/face-table.t.cpp
@@ -32,52 +32,49 @@
 namespace nfd {
 namespace tests {
 
-BOOST_FIXTURE_TEST_SUITE(FwFaceTable, BaseFixture)
+BOOST_AUTO_TEST_SUITE(Fw)
+BOOST_FIXTURE_TEST_SUITE(TestFaceTable, BaseFixture)
 
 BOOST_AUTO_TEST_CASE(AddRemove)
 {
   Forwarder forwarder;
 
   FaceTable& faceTable = forwarder.getFaceTable();
-  std::vector<FaceId> onAddHistory;
-  std::vector<FaceId> onRemoveHistory;
-  faceTable.onAdd.connect([&] (shared_ptr<Face> face) {
-    onAddHistory.push_back(face->getId());
-  });
-  faceTable.onRemove.connect([&] (shared_ptr<Face> face) {
-    onRemoveHistory.push_back(face->getId());
-  });
+  std::vector<FaceId> addHistory;
+  std::vector<FaceId> removeHistory;
+  faceTable.afterAdd.connect([&] (shared_ptr<Face> face) { addHistory.push_back(face->getId()); });
+  faceTable.beforeRemove.connect([&] (shared_ptr<Face> face) { removeHistory.push_back(face->getId()); });
 
   shared_ptr<Face> face1 = make_shared<DummyFace>();
   shared_ptr<Face> face2 = make_shared<DummyFace>();
 
-  BOOST_CHECK_EQUAL(face1->getId(), INVALID_FACEID);
-  BOOST_CHECK_EQUAL(face2->getId(), INVALID_FACEID);
+  BOOST_CHECK_EQUAL(face1->getId(), face::INVALID_FACEID);
+  BOOST_CHECK_EQUAL(face2->getId(), face::INVALID_FACEID);
 
   forwarder.addFace(face1);
   forwarder.addFace(face2);
 
-  BOOST_CHECK_NE(face1->getId(), INVALID_FACEID);
-  BOOST_CHECK_NE(face2->getId(), INVALID_FACEID);
+  BOOST_CHECK_NE(face1->getId(), face::INVALID_FACEID);
+  BOOST_CHECK_NE(face2->getId(), face::INVALID_FACEID);
   BOOST_CHECK_NE(face1->getId(), face2->getId());
-  BOOST_CHECK_GT(face1->getId(), FACEID_RESERVED_MAX);
-  BOOST_CHECK_GT(face2->getId(), FACEID_RESERVED_MAX);
+  BOOST_CHECK_GT(face1->getId(), face::FACEID_RESERVED_MAX);
+  BOOST_CHECK_GT(face2->getId(), face::FACEID_RESERVED_MAX);
 
   FaceId oldId1 = face1->getId();
   faceTable.add(face1);
   BOOST_CHECK_EQUAL(face1->getId(), oldId1);
   BOOST_CHECK_EQUAL(faceTable.size(), 2);
 
-  BOOST_REQUIRE_EQUAL(onAddHistory.size(), 2);
-  BOOST_CHECK_EQUAL(onAddHistory[0], face1->getId());
-  BOOST_CHECK_EQUAL(onAddHistory[1], face2->getId());
+  BOOST_REQUIRE_EQUAL(addHistory.size(), 2);
+  BOOST_CHECK_EQUAL(addHistory[0], face1->getId());
+  BOOST_CHECK_EQUAL(addHistory[1], face2->getId());
 
   face1->close();
 
-  BOOST_CHECK_EQUAL(face1->getId(), INVALID_FACEID);
+  BOOST_CHECK_EQUAL(face1->getId(), face::INVALID_FACEID);
 
-  BOOST_REQUIRE_EQUAL(onRemoveHistory.size(), 1);
-  BOOST_CHECK_EQUAL(onRemoveHistory[0], onAddHistory[0]);
+  BOOST_REQUIRE_EQUAL(removeHistory.size(), 1);
+  BOOST_CHECK_EQUAL(removeHistory[0], addHistory[0]);
 }
 
 BOOST_AUTO_TEST_CASE(AddReserved)
@@ -86,7 +83,7 @@
   FaceTable& faceTable = forwarder.getFaceTable();
 
   shared_ptr<Face> face1 = make_shared<DummyFace>();
-  BOOST_CHECK_EQUAL(face1->getId(), INVALID_FACEID);
+  BOOST_CHECK_EQUAL(face1->getId(), face::INVALID_FACEID);
 
   faceTable.addReserved(face1, 5);
   BOOST_CHECK_EQUAL(face1->getId(), 5);
@@ -146,7 +143,8 @@
   BOOST_CHECK(hasFace2);
 }
 
-BOOST_AUTO_TEST_SUITE_END()
+BOOST_AUTO_TEST_SUITE_END() // TestFaceTable
+BOOST_AUTO_TEST_SUITE_END() // Fw
 
 } // namespace tests
 } // namespace nfd
diff --git a/tests/daemon/fw/forwarder.t.cpp b/tests/daemon/fw/forwarder.t.cpp
index 67bce49..cfa5f71 100644
--- a/tests/daemon/fw/forwarder.t.cpp
+++ b/tests/daemon/fw/forwarder.t.cpp
@@ -25,8 +25,6 @@
 
 #include "fw/forwarder.hpp"
 #include "tests/daemon/face/dummy-face.hpp"
-#include "tests/daemon/face/dummy-lp-face.hpp"
-#include "face/lp-face-wrapper.hpp"
 #include "dummy-strategy.hpp"
 
 #include "tests/test-common.hpp"
@@ -51,10 +49,10 @@
   interestAB->setInterestLifetime(time::seconds(4));
   shared_ptr<Data> dataABC = makeData(nameABC);
 
-  shared_ptr<DummyFace> face1 = make_shared<DummyFace>();
-  shared_ptr<DummyFace> face2 = make_shared<DummyFace>();
-  face1->afterSend.connect(afterOp);
-  face2->afterSend.connect(afterOp);
+  auto face1 = make_shared<DummyFace>();
+  auto face2 = make_shared<DummyFace>();
+  face1->afterSend.connect(bind(afterOp));
+  face2->afterSend.connect(bind(afterOp));
   forwarder.addFace(face1);
   forwarder.addFace(face2);
 
@@ -66,10 +64,10 @@
   BOOST_CHECK_EQUAL(forwarder.getCounters().nOutInterests, 0);
   g_io.post([&] { face1->receiveInterest(*interestAB); });
   BOOST_CHECK_EQUAL(limitedIo.run(1, time::seconds(1)), LimitedIo::EXCEED_OPS);
-  BOOST_REQUIRE_EQUAL(face2->m_sentInterests.size(), 1);
-  BOOST_CHECK_EQUAL(face2->m_sentInterests[0].getName(), nameAB);
-  BOOST_REQUIRE(face2->m_sentInterests[0].getTag<lp::IncomingFaceIdTag>() != nullptr);
-  BOOST_CHECK_EQUAL(*face2->m_sentInterests[0].getTag<lp::IncomingFaceIdTag>(), face1->getId());
+  BOOST_REQUIRE_EQUAL(face2->sentInterests.size(), 1);
+  BOOST_CHECK_EQUAL(face2->sentInterests[0].getName(), nameAB);
+  BOOST_REQUIRE(face2->sentInterests[0].getTag<lp::IncomingFaceIdTag>() != nullptr);
+  BOOST_CHECK_EQUAL(*face2->sentInterests[0].getTag<lp::IncomingFaceIdTag>(), face1->getId());
   BOOST_CHECK_EQUAL(forwarder.getCounters().nInInterests, 1);
   BOOST_CHECK_EQUAL(forwarder.getCounters().nOutInterests, 1);
 
@@ -77,10 +75,10 @@
   BOOST_CHECK_EQUAL(forwarder.getCounters().nOutData, 0);
   g_io.post([&] { face2->receiveData(*dataABC); });
   BOOST_CHECK_EQUAL(limitedIo.run(1, time::seconds(1)), LimitedIo::EXCEED_OPS);
-  BOOST_REQUIRE_EQUAL(face1->m_sentDatas.size(), 1);
-  BOOST_CHECK_EQUAL(face1->m_sentDatas[0].getName(), nameABC);
-  BOOST_REQUIRE(face1->m_sentDatas[0].getTag<lp::IncomingFaceIdTag>() != nullptr);
-  BOOST_CHECK_EQUAL(*face1->m_sentDatas[0].getTag<lp::IncomingFaceIdTag>(), face2->getId());
+  BOOST_REQUIRE_EQUAL(face1->sentData.size(), 1);
+  BOOST_CHECK_EQUAL(face1->sentData[0].getName(), nameABC);
+  BOOST_REQUIRE(face1->sentData[0].getTag<lp::IncomingFaceIdTag>() != nullptr);
+  BOOST_CHECK_EQUAL(*face1->sentData[0].getTag<lp::IncomingFaceIdTag>(), face2->getId());
   BOOST_CHECK_EQUAL(forwarder.getCounters().nInData, 1);
   BOOST_CHECK_EQUAL(forwarder.getCounters().nOutData, 1);
 }
@@ -90,9 +88,9 @@
   LimitedIo limitedIo;
   Forwarder forwarder;
 
-  shared_ptr<DummyFace> face1 = make_shared<DummyFace>();
-  shared_ptr<DummyFace> face2 = make_shared<DummyFace>();
-  shared_ptr<DummyFace> face3 = make_shared<DummyFace>();
+  auto face1 = make_shared<DummyFace>();
+  auto face2 = make_shared<DummyFace>();
+  auto face3 = make_shared<DummyFace>();
   forwarder.addFace(face1);
   forwarder.addFace(face2);
   forwarder.addFace(face3);
@@ -115,12 +113,12 @@
   face1->receiveInterest(*interestA);
   limitedIo.run(LimitedIo::UNLIMITED_OPS, time::milliseconds(5));
   // Interest matching ContentStore should not be forwarded
-  BOOST_REQUIRE_EQUAL(face2->m_sentInterests.size(), 0);
+  BOOST_REQUIRE_EQUAL(face2->sentInterests.size(), 0);
 
-  BOOST_REQUIRE_EQUAL(face1->m_sentDatas.size(), 1);
+  BOOST_REQUIRE_EQUAL(face1->sentData.size(), 1);
   // IncomingFaceId field should be reset to represent CS
-  BOOST_REQUIRE(face1->m_sentDatas[0].getTag<lp::IncomingFaceIdTag>() != nullptr);
-  BOOST_CHECK_EQUAL(*face1->m_sentDatas[0].getTag<lp::IncomingFaceIdTag>(), FACEID_CONTENT_STORE);
+  BOOST_REQUIRE(face1->sentData[0].getTag<lp::IncomingFaceIdTag>() != nullptr);
+  BOOST_CHECK_EQUAL(*face1->sentData[0].getTag<lp::IncomingFaceIdTag>(), face::FACEID_CONTENT_STORE);
 
   limitedIo.run(LimitedIo::UNLIMITED_OPS, time::milliseconds(500));
   // PIT entry should not be left behind
@@ -155,8 +153,8 @@
 BOOST_AUTO_TEST_CASE(ScopeLocalhostIncoming)
 {
   ScopeLocalhostIncomingTestForwarder forwarder;
-  shared_ptr<Face> face1 = make_shared<DummyLocalFace>();
-  shared_ptr<Face> face2 = make_shared<DummyFace>();
+  auto face1 = make_shared<DummyFace>("dummy://", "dummy://", ndn::nfd::FACE_SCOPE_LOCAL);
+  auto face2 = make_shared<DummyFace>();
   forwarder.addFace(face1);
   forwarder.addFace(face2);
 
@@ -212,9 +210,9 @@
 BOOST_AUTO_TEST_CASE(ScopeLocalhostOutgoing)
 {
   Forwarder forwarder;
-  shared_ptr<DummyLocalFace> face1 = make_shared<DummyLocalFace>();
-  shared_ptr<DummyFace>      face2 = make_shared<DummyFace>();
-  shared_ptr<Face>           face3 = make_shared<DummyLocalFace>();
+  auto face1 = make_shared<DummyFace>("dummy://", "dummy://", ndn::nfd::FACE_SCOPE_LOCAL);
+  auto face2 = make_shared<DummyFace>();
+  auto face3 = make_shared<DummyFace>("dummy://", "dummy://", ndn::nfd::FACE_SCOPE_LOCAL);
   forwarder.addFace(face1);
   forwarder.addFace(face2);
   forwarder.addFace(face3);
@@ -224,62 +222,62 @@
   shared_ptr<Interest> interestA1 = makeInterest("/localhost/A1");
   shared_ptr<pit::Entry> pitA1 = pit.insert(*interestA1).first;
   pitA1->insertOrUpdateInRecord(face3, *interestA1);
-  face1->m_sentInterests.clear();
+  face1->sentInterests.clear();
   forwarder.onOutgoingInterest(pitA1, *face1);
-  BOOST_CHECK_EQUAL(face1->m_sentInterests.size(), 1);
+  BOOST_CHECK_EQUAL(face1->sentInterests.size(), 1);
 
   // non-local face, /localhost: violate
   shared_ptr<Interest> interestA2 = makeInterest("/localhost/A2");
   shared_ptr<pit::Entry> pitA2 = pit.insert(*interestA2).first;
   pitA2->insertOrUpdateInRecord(face3, *interestA2);
-  face2->m_sentInterests.clear();
+  face2->sentInterests.clear();
   forwarder.onOutgoingInterest(pitA2, *face2);
-  BOOST_CHECK_EQUAL(face2->m_sentInterests.size(), 0);
+  BOOST_CHECK_EQUAL(face2->sentInterests.size(), 0);
 
   // local face, non-/localhost: OK
   shared_ptr<Interest> interestA3 = makeInterest("/A3");
   shared_ptr<pit::Entry> pitA3 = pit.insert(*interestA3).first;
   pitA3->insertOrUpdateInRecord(face3, *interestA3);
-  face1->m_sentInterests.clear();
+  face1->sentInterests.clear();
   forwarder.onOutgoingInterest(pitA3, *face1);
-  BOOST_CHECK_EQUAL(face1->m_sentInterests.size(), 1);
+  BOOST_CHECK_EQUAL(face1->sentInterests.size(), 1);
 
   // non-local face, non-/localhost: OK
   shared_ptr<Interest> interestA4 = makeInterest("/A4");
   shared_ptr<pit::Entry> pitA4 = pit.insert(*interestA4).first;
   pitA4->insertOrUpdateInRecord(face3, *interestA4);
-  face2->m_sentInterests.clear();
+  face2->sentInterests.clear();
   forwarder.onOutgoingInterest(pitA4, *face2);
-  BOOST_CHECK_EQUAL(face2->m_sentInterests.size(), 1);
+  BOOST_CHECK_EQUAL(face2->sentInterests.size(), 1);
 
   // local face, /localhost: OK
-  face1->m_sentDatas.clear();
+  face1->sentData.clear();
   forwarder.onOutgoingData(Data("/localhost/B1"), *face1);
-  BOOST_CHECK_EQUAL(face1->m_sentDatas.size(), 1);
+  BOOST_CHECK_EQUAL(face1->sentData.size(), 1);
 
   // non-local face, /localhost: OK
-  face2->m_sentDatas.clear();
+  face2->sentData.clear();
   forwarder.onOutgoingData(Data("/localhost/B2"), *face2);
-  BOOST_CHECK_EQUAL(face2->m_sentDatas.size(), 0);
+  BOOST_CHECK_EQUAL(face2->sentData.size(), 0);
 
   // local face, non-/localhost: OK
-  face1->m_sentDatas.clear();
+  face1->sentData.clear();
   forwarder.onOutgoingData(Data("/B3"), *face1);
-  BOOST_CHECK_EQUAL(face1->m_sentDatas.size(), 1);
+  BOOST_CHECK_EQUAL(face1->sentData.size(), 1);
 
   // non-local face, non-/localhost: OK
-  face2->m_sentDatas.clear();
+  face2->sentData.clear();
   forwarder.onOutgoingData(Data("/B4"), *face2);
-  BOOST_CHECK_EQUAL(face2->m_sentDatas.size(), 1);
+  BOOST_CHECK_EQUAL(face2->sentData.size(), 1);
 }
 
 BOOST_AUTO_TEST_CASE(ScopeLocalhopOutgoing)
 {
   Forwarder forwarder;
-  shared_ptr<DummyLocalFace> face1 = make_shared<DummyLocalFace>();
-  shared_ptr<DummyFace>      face2 = make_shared<DummyFace>();
-  shared_ptr<DummyLocalFace> face3 = make_shared<DummyLocalFace>();
-  shared_ptr<DummyFace>      face4 = make_shared<DummyFace>();
+  auto face1 = make_shared<DummyFace>("dummy://", "dummy://", ndn::nfd::FACE_SCOPE_LOCAL);
+  auto face2 = make_shared<DummyFace>();
+  auto face3 = make_shared<DummyFace>("dummy://", "dummy://", ndn::nfd::FACE_SCOPE_LOCAL);
+  auto face4 = make_shared<DummyFace>();
   forwarder.addFace(face1);
   forwarder.addFace(face2);
   forwarder.addFace(face3);
@@ -290,59 +288,59 @@
   shared_ptr<Interest> interest1 = makeInterest("/localhop/1");
   shared_ptr<pit::Entry> pit1 = pit.insert(*interest1).first;
   pit1->insertOrUpdateInRecord(face1, *interest1);
-  face3->m_sentInterests.clear();
+  face3->sentInterests.clear();
   forwarder.onOutgoingInterest(pit1, *face3);
-  BOOST_CHECK_EQUAL(face3->m_sentInterests.size(), 1);
+  BOOST_CHECK_EQUAL(face3->sentInterests.size(), 1);
 
   // from non-local face, to local face: OK
   shared_ptr<Interest> interest2 = makeInterest("/localhop/2");
   shared_ptr<pit::Entry> pit2 = pit.insert(*interest2).first;
   pit2->insertOrUpdateInRecord(face2, *interest2);
-  face3->m_sentInterests.clear();
+  face3->sentInterests.clear();
   forwarder.onOutgoingInterest(pit2, *face3);
-  BOOST_CHECK_EQUAL(face3->m_sentInterests.size(), 1);
+  BOOST_CHECK_EQUAL(face3->sentInterests.size(), 1);
 
   // from local face, to non-local face: OK
   shared_ptr<Interest> interest3 = makeInterest("/localhop/3");
   shared_ptr<pit::Entry> pit3 = pit.insert(*interest3).first;
   pit3->insertOrUpdateInRecord(face1, *interest3);
-  face4->m_sentInterests.clear();
+  face4->sentInterests.clear();
   forwarder.onOutgoingInterest(pit3, *face4);
-  BOOST_CHECK_EQUAL(face4->m_sentInterests.size(), 1);
+  BOOST_CHECK_EQUAL(face4->sentInterests.size(), 1);
 
   // from non-local face, to non-local face: violate
   shared_ptr<Interest> interest4 = makeInterest("/localhop/4");
   shared_ptr<pit::Entry> pit4 = pit.insert(*interest4).first;
   pit4->insertOrUpdateInRecord(face2, *interest4);
-  face4->m_sentInterests.clear();
+  face4->sentInterests.clear();
   forwarder.onOutgoingInterest(pit4, *face4);
-  BOOST_CHECK_EQUAL(face4->m_sentInterests.size(), 0);
+  BOOST_CHECK_EQUAL(face4->sentInterests.size(), 0);
 
   // from local face and non-local face, to local face: OK
   shared_ptr<Interest> interest5 = makeInterest("/localhop/5");
   shared_ptr<pit::Entry> pit5 = pit.insert(*interest5).first;
   pit5->insertOrUpdateInRecord(face1, *interest5);
   pit5->insertOrUpdateInRecord(face2, *interest5);
-  face3->m_sentInterests.clear();
+  face3->sentInterests.clear();
   forwarder.onOutgoingInterest(pit5, *face3);
-  BOOST_CHECK_EQUAL(face3->m_sentInterests.size(), 1);
+  BOOST_CHECK_EQUAL(face3->sentInterests.size(), 1);
 
   // from local face and non-local face, to non-local face: OK
   shared_ptr<Interest> interest6 = makeInterest("/localhop/6");
   shared_ptr<pit::Entry> pit6 = pit.insert(*interest6).first;
   pit6->insertOrUpdateInRecord(face1, *interest6);
   pit6->insertOrUpdateInRecord(face2, *interest6);
-  face4->m_sentInterests.clear();
+  face4->sentInterests.clear();
   forwarder.onOutgoingInterest(pit6, *face4);
-  BOOST_CHECK_EQUAL(face4->m_sentInterests.size(), 1);
+  BOOST_CHECK_EQUAL(face4->sentInterests.size(), 1);
 }
 
 BOOST_AUTO_TEST_CASE(IncomingInterestStrategyDispatch)
 {
   LimitedIo limitedIo;
   Forwarder forwarder;
-  shared_ptr<Face> face1 = make_shared<DummyFace>();
-  shared_ptr<Face> face2 = make_shared<DummyFace>();
+  auto face1 = make_shared<DummyFace>();
+  auto face2 = make_shared<DummyFace>();
   forwarder.addFace(face1);
   forwarder.addFace(face2);
 
@@ -398,10 +396,10 @@
 {
   LimitedIo limitedIo;
   Forwarder forwarder;
-  shared_ptr<DummyFace> face1 = make_shared<DummyFace>();
-  shared_ptr<DummyFace> face2 = make_shared<DummyFace>();
-  shared_ptr<DummyFace> face3 = make_shared<DummyFace>();
-  shared_ptr<DummyFace> face4 = make_shared<DummyFace>();
+  auto face1 = make_shared<DummyFace>();
+  auto face2 = make_shared<DummyFace>();
+  auto face3 = make_shared<DummyFace>();
+  auto face4 = make_shared<DummyFace>();
   forwarder.addFace(face1);
   forwarder.addFace(face2);
   forwarder.addFace(face3);
@@ -424,10 +422,10 @@
   forwarder.onIncomingData(*face3, *dataD);
   limitedIo.run(LimitedIo::UNLIMITED_OPS, time::milliseconds(5));
 
-  BOOST_CHECK_EQUAL(face1->m_sentDatas.size(), 1);
-  BOOST_CHECK_EQUAL(face2->m_sentDatas.size(), 1);
-  BOOST_CHECK_EQUAL(face3->m_sentDatas.size(), 0);
-  BOOST_CHECK_EQUAL(face4->m_sentDatas.size(), 1);
+  BOOST_CHECK_EQUAL(face1->sentData.size(), 1);
+  BOOST_CHECK_EQUAL(face2->sentData.size(), 1);
+  BOOST_CHECK_EQUAL(face3->sentData.size(), 0);
+  BOOST_CHECK_EQUAL(face4->sentData.size(), 1);
 }
 
 BOOST_AUTO_TEST_CASE(IncomingNack)
@@ -435,11 +433,10 @@
   Forwarder forwarder;
   auto face1 = make_shared<DummyFace>();
   auto face2 = make_shared<DummyFace>();
-  auto face3 = make_shared<face::LpFaceWrapper>(make_unique<DummyLpFace>(
-               "dummy://", "dummy://",
-               ndn::nfd::FACE_SCOPE_NON_LOCAL,
-               ndn::nfd::FACE_PERSISTENCY_PERSISTENT,
-               ndn::nfd::LINK_TYPE_MULTI_ACCESS));
+  auto face3 = make_shared<DummyFace>("dummy://", "dummy://",
+                                      ndn::nfd::FACE_SCOPE_NON_LOCAL,
+                                      ndn::nfd::FACE_PERSISTENCY_PERSISTENT,
+                                      ndn::nfd::LINK_TYPE_MULTI_ACCESS);
   forwarder.addFace(face1);
   forwarder.addFace(face2);
   forwarder.addFace(face3);
@@ -524,20 +521,15 @@
 BOOST_AUTO_TEST_CASE(OutgoingNack)
 {
   Forwarder forwarder;
-  auto face1w = make_shared<face::LpFaceWrapper>(make_unique<DummyLpFace>());
-  auto face1 = static_cast<DummyLpFace*>(face1w->getLpFace());
-  auto face2w = make_shared<face::LpFaceWrapper>(make_unique<DummyLpFace>());
-  auto face2 = static_cast<DummyLpFace*>(face2w->getLpFace());
-  auto face3w = make_shared<face::LpFaceWrapper>(make_unique<DummyLpFace>(
-                "dummy://", "dummy://",
-                ndn::nfd::FACE_SCOPE_NON_LOCAL,
-                ndn::nfd::FACE_PERSISTENCY_PERSISTENT,
-                ndn::nfd::LINK_TYPE_MULTI_ACCESS));
-  auto face3 = static_cast<DummyLpFace*>(face3w->getLpFace());
-  forwarder.addFace(face1w);
-  forwarder.addFace(face2w);
-  forwarder.addFace(face3w);
-  // TODO#3172 eliminate wrapper
+  auto face1 = make_shared<DummyFace>();
+  auto face2 = make_shared<DummyFace>();
+  auto face3 = make_shared<DummyFace>("dummy://", "dummy://",
+                                      ndn::nfd::FACE_SCOPE_NON_LOCAL,
+                                      ndn::nfd::FACE_PERSISTENCY_PERSISTENT,
+                                      ndn::nfd::LINK_TYPE_MULTI_ACCESS);
+  forwarder.addFace(face1);
+  forwarder.addFace(face2);
+  forwarder.addFace(face3);
 
   Pit& pit = forwarder.getPit();
 
@@ -547,68 +539,63 @@
   // don't send Nack if there's no in-record
   shared_ptr<Interest> interest1 = makeInterest("/fM5IVEtC", 719);
   shared_ptr<pit::Entry> pit1 = pit.insert(*interest1).first;
-  pit1->insertOrUpdateInRecord(face1w, *interest1);
+  pit1->insertOrUpdateInRecord(face1, *interest1);
 
   face2->sentNacks.clear();
-  forwarder.onOutgoingNack(pit1, *face2w, nackHeader);
+  forwarder.onOutgoingNack(pit1, *face2, nackHeader);
   BOOST_CHECK_EQUAL(face2->sentNacks.size(), 0);
 
   // send Nack with correct Nonce
   shared_ptr<Interest> interest2a = makeInterest("/Vi8tRm9MG3", 152);
   shared_ptr<pit::Entry> pit2 = pit.insert(*interest2a).first;
-  pit2->insertOrUpdateInRecord(face1w, *interest2a);
+  pit2->insertOrUpdateInRecord(face1, *interest2a);
   shared_ptr<Interest> interest2b = makeInterest("/Vi8tRm9MG3", 808);
-  pit2->insertOrUpdateInRecord(face2w, *interest2b);
+  pit2->insertOrUpdateInRecord(face2, *interest2b);
 
   face1->sentNacks.clear();
-  forwarder.onOutgoingNack(pit2, *face1w, nackHeader);
+  forwarder.onOutgoingNack(pit2, *face1, nackHeader);
   BOOST_REQUIRE_EQUAL(face1->sentNacks.size(), 1);
   BOOST_CHECK_EQUAL(face1->sentNacks.back().getReason(), lp::NackReason::CONGESTION);
   BOOST_CHECK_EQUAL(face1->sentNacks.back().getInterest().getNonce(), 152);
 
   // erase in-record
-  pit::InRecordCollection::const_iterator inRecord2a = pit2->getInRecord(*face1w);
+  pit::InRecordCollection::const_iterator inRecord2a = pit2->getInRecord(*face1);
   BOOST_CHECK(inRecord2a == pit2->getInRecords().end());
 
   // send Nack with correct Nonce
   face2->sentNacks.clear();
-  forwarder.onOutgoingNack(pit2, *face2w, nackHeader);
+  forwarder.onOutgoingNack(pit2, *face2, nackHeader);
   BOOST_REQUIRE_EQUAL(face2->sentNacks.size(), 1);
   BOOST_CHECK_EQUAL(face2->sentNacks.back().getReason(), lp::NackReason::CONGESTION);
   BOOST_CHECK_EQUAL(face2->sentNacks.back().getInterest().getNonce(), 808);
 
   // erase in-record
-  pit::InRecordCollection::const_iterator inRecord2b = pit2->getInRecord(*face1w);
+  pit::InRecordCollection::const_iterator inRecord2b = pit2->getInRecord(*face1);
   BOOST_CHECK(inRecord2b == pit2->getInRecords().end());
 
   // don't send Nack to multi-access face
   shared_ptr<Interest> interest2c = makeInterest("/Vi8tRm9MG3", 228);
-  pit2->insertOrUpdateInRecord(face3w, *interest2c);
+  pit2->insertOrUpdateInRecord(face3, *interest2c);
 
   face3->sentNacks.clear();
-  forwarder.onOutgoingNack(pit1, *face3w, nackHeader);
+  forwarder.onOutgoingNack(pit1, *face3, nackHeader);
   BOOST_CHECK_EQUAL(face3->sentNacks.size(), 0);
 }
 
 BOOST_AUTO_TEST_CASE(InterestLoopNack)
 {
   Forwarder forwarder;
-  auto face1w = make_shared<face::LpFaceWrapper>(make_unique<DummyLpFace>());
-  auto face1 = static_cast<DummyLpFace*>(face1w->getLpFace());
-  auto face2w = make_shared<face::LpFaceWrapper>(make_unique<DummyLpFace>());
-  auto face2 = static_cast<DummyLpFace*>(face2w->getLpFace());
-  auto face3w = make_shared<face::LpFaceWrapper>(make_unique<DummyLpFace>(
-                "dummy://", "dummy://",
-                ndn::nfd::FACE_SCOPE_NON_LOCAL,
-                ndn::nfd::FACE_PERSISTENCY_PERSISTENT,
-                ndn::nfd::LINK_TYPE_MULTI_ACCESS));
-  auto face3 = static_cast<DummyLpFace*>(face3w->getLpFace());
+  auto face1 = make_shared<DummyFace>();
+  auto face2 = make_shared<DummyFace>();
+  auto face3 = make_shared<DummyFace>("dummy://", "dummy://",
+                                      ndn::nfd::FACE_SCOPE_NON_LOCAL,
+                                      ndn::nfd::FACE_PERSISTENCY_PERSISTENT,
+                                      ndn::nfd::LINK_TYPE_MULTI_ACCESS);
   auto face4 = make_shared<DummyFace>();
-  forwarder.addFace(face1w);
-  forwarder.addFace(face2w);
-  forwarder.addFace(face3w);
+  forwarder.addFace(face1);
+  forwarder.addFace(face2);
+  forwarder.addFace(face3);
   forwarder.addFace(face4);
-  // TODO#3172 eliminate wrapper
 
   Fib& fib = forwarder.getFib();
   shared_ptr<fib::Entry> fibEntry = fib.insert(Name("/zT4XwK0Hnx")).first;
@@ -658,8 +645,11 @@
   forwarder.addFace(face2);
 
   // cause an Interest sent out of face2 to loop back into face1 after a delay
-  face2->onSendInterest.connect([&face1] (const Interest& interest) {
-    scheduler::schedule(time::milliseconds(170), [&] { face1->receiveInterest(interest); });
+  face2->afterSend.connect([face1, face2] (uint32_t pktType) {
+    if (pktType == tlv::Interest) {
+      auto interest = make_shared<Interest>(face2->sentInterests.back());
+      scheduler::schedule(time::milliseconds(170), [face1, interest] { face1->receiveInterest(*interest); });
+    }
   });
 
   Fib& fib = forwarder.getFib();
@@ -676,7 +666,7 @@
   BOOST_ASSERT(time::milliseconds(25) * 40 < forwarder.getDeadNonceList().getLifetime());
   this->advanceClocks(time::milliseconds(25), 40);
 
-  BOOST_CHECK_EQUAL(face2->m_sentInterests.size(), 1);
+  BOOST_CHECK_EQUAL(face2->sentInterests.size(), 1);
 
   // It's unnecessary to check that Interest with duplicate Nonce can be forwarded again
   // after it's gone from Dead Nonce List, because the entry lifetime of Dead Nonce List
diff --git a/tests/daemon/fw/strategy.t.cpp b/tests/daemon/fw/strategy.t.cpp
index 44fead2..90654d7 100644
--- a/tests/daemon/fw/strategy.t.cpp
+++ b/tests/daemon/fw/strategy.t.cpp
@@ -36,7 +36,8 @@
 
 using namespace nfd::tests;
 
-BOOST_FIXTURE_TEST_SUITE(FwStrategy, BaseFixture)
+BOOST_AUTO_TEST_SUITE(Fw)
+BOOST_FIXTURE_TEST_SUITE(TestStrategy, BaseFixture)
 
 class FaceTableAccessTestStrategy : public DummyStrategy
 {
@@ -58,7 +59,7 @@
   {
     auto enumerable = this->getFaceTable() |
                       boost::adaptors::filtered([] (shared_ptr<Face> face) {
-                        return face->isLocal();
+                        return face->getScope() == ndn::nfd::FACE_SCOPE_LOCAL;
                       });
 
     std::vector<FaceId> results;
@@ -79,7 +80,7 @@
   FaceTableAccessTestStrategy strategy(forwarder);
 
   auto face1 = make_shared<DummyFace>();
-  auto face2 = make_shared<DummyLocalFace>();
+  auto face2 = make_shared<DummyFace>("dummy://", "dummy://", ndn::nfd::FACE_SCOPE_LOCAL);
   forwarder.addFace(face1);
   forwarder.addFace(face2);
   FaceId id1 = face1->getId();
@@ -94,7 +95,8 @@
   BOOST_CHECK((strategy.removedFaces == std::vector<FaceId>{id2, id1}));
 }
 
-BOOST_AUTO_TEST_SUITE_END()
+BOOST_AUTO_TEST_SUITE_END() // TestStrategy
+BOOST_AUTO_TEST_SUITE_END() // Fw
 
 } // namespace tests
 } // namespace fw
diff --git a/tests/daemon/fw/topology-tester.cpp b/tests/daemon/fw/topology-tester.cpp
index 8b94abc..f1e54bb 100644
--- a/tests/daemon/fw/topology-tester.cpp
+++ b/tests/daemon/fw/topology-tester.cpp
@@ -34,7 +34,6 @@
 using face::InternalTransportBase;
 using face::InternalForwarderTransport;
 using face::InternalClientTransport;
-using face::LpFaceWrapper;
 using face::GenericLinkService;
 
 TopologyLink::TopologyLink(const time::nanoseconds& delay)
@@ -46,9 +45,9 @@
 }
 
 void
-TopologyLink::addFace(TopologyNode i, shared_ptr<LpFaceWrapper> face)
+TopologyLink::addFace(TopologyNode i, shared_ptr<Face> face)
 {
-  this->attachTransport(i, dynamic_cast<InternalTransportBase*>(face->getLpFace()->getTransport()));
+  this->attachTransport(i, dynamic_cast<InternalTransportBase*>(face->getTransport()));
   m_faces[i] = face;
 }
 
@@ -87,9 +86,9 @@
   });
 }
 
-TopologyAppLink::TopologyAppLink(shared_ptr<LpFaceWrapper> forwarderFace)
+TopologyAppLink::TopologyAppLink(shared_ptr<Face> forwarderFace)
   : m_face(forwarderFace)
-  , m_forwarderTransport(static_cast<InternalForwarderTransport*>(forwarderFace->getLpFace()->getTransport()))
+  , m_forwarderTransport(static_cast<InternalForwarderTransport*>(forwarderFace->getTransport()))
   , m_clientTransport(make_shared<InternalClientTransport>())
   , m_client(make_shared<ndn::Face>(m_clientTransport, getGlobalIoService()))
 {
@@ -136,11 +135,10 @@
     auto service = make_unique<GenericLinkService>();
     auto transport = make_unique<InternalForwarderTransport>(localUri, remoteUri,
                      ndn::nfd::FACE_SCOPE_NON_LOCAL, linkType);
-    auto face = make_unique<LpFace>(std::move(service), std::move(transport));
-    auto faceW = make_shared<LpFaceWrapper>(std::move(face));
+    auto face = make_shared<Face>(std::move(service), std::move(transport));
 
-    forwarder.addFace(faceW);
-    link->addFace(i, faceW);
+    forwarder.addFace(face);
+    link->addFace(i, face);
   }
 
   m_links.push_back(link); // keep a shared_ptr so callers don't have to
@@ -157,12 +155,11 @@
   auto service = make_unique<GenericLinkService>();
   auto transport = make_unique<InternalForwarderTransport>(localUri, remoteUri,
                    ndn::nfd::FACE_SCOPE_LOCAL, ndn::nfd::LINK_TYPE_POINT_TO_POINT);
-  auto face = make_unique<LpFace>(std::move(service), std::move(transport));
-  auto faceW = make_shared<LpFaceWrapper>(std::move(face));
+  auto face = make_shared<Face>(std::move(service), std::move(transport));
 
-  forwarder.addFace(faceW);
+  forwarder.addFace(face);
 
-  auto al = make_shared<TopologyAppLink>(faceW);
+  auto al = make_shared<TopologyAppLink>(face);
   m_appLinks.push_back(al); // keep a shared_ptr so callers don't have to
   return al;
 }
diff --git a/tests/daemon/fw/topology-tester.hpp b/tests/daemon/fw/topology-tester.hpp
index 9a10ad7..88d73da 100644
--- a/tests/daemon/fw/topology-tester.hpp
+++ b/tests/daemon/fw/topology-tester.hpp
@@ -32,7 +32,7 @@
 
 #include <ndn-cxx/face.hpp>
 #include "face/internal-transport.hpp"
-#include "face/lp-face-wrapper.hpp"
+#include "face/face.hpp"
 #include "fw/strategy.hpp"
 #include "tests/test-common.hpp"
 
@@ -70,8 +70,12 @@
     m_isUp = true;
   }
 
+  /** \brief attach a face to the link
+   *  \param i forwarder index
+   *  \param face a Face with InternalForwarderTransport
+   */
   void
-  addFace(TopologyNode i, shared_ptr<face::LpFaceWrapper> face);
+  addFace(TopologyNode i, shared_ptr<Face> face);
 
   /** \return a face of forwarder \p i which is attached to this link
    */
@@ -98,7 +102,7 @@
   bool m_isUp;
   time::nanoseconds m_delay;
   std::unordered_map<TopologyNode, face::InternalTransportBase*> m_transports;
-  std::unordered_map<TopologyNode, shared_ptr<face::LpFaceWrapper>> m_faces;
+  std::unordered_map<TopologyNode, shared_ptr<Face>> m_faces;
 };
 
 /** \brief represents a link to a local application
@@ -106,8 +110,11 @@
 class TopologyAppLink : noncopyable
 {
 public:
+  /** \brief constructor
+   *  \param forwarderFace a Face with InternalForwarderTransport
+   */
   explicit
-  TopologyAppLink(shared_ptr<face::LpFaceWrapper> forwarderFace);
+  TopologyAppLink(shared_ptr<Face> forwarderFace);
 
   /** \brief fail the link, cause packets to be dropped silently
    */
