diff --git a/daemon/fw/best-route-strategy2.cpp b/daemon/fw/best-route-strategy2.cpp
index df6ca4d..5080d9c 100644
--- a/daemon/fw/best-route-strategy2.cpp
+++ b/daemon/fw/best-route-strategy2.cpp
@@ -195,7 +195,7 @@
     const lp::NackHeader* inNack = outR.getIncomingNack();
     if (inNack == nullptr) {
       ++nOutRecordsNotNacked;
-      lastFaceNotNacked = outR.getFace().get();
+      lastFaceNotNacked = &outR.getFace();
       continue;
     }
 
diff --git a/daemon/fw/forwarder.cpp b/daemon/fw/forwarder.cpp
index 2fbc93c..ff8e451 100644
--- a/daemon/fw/forwarder.cpp
+++ b/daemon/fw/forwarder.cpp
@@ -196,9 +196,8 @@
 {
   NFD_LOG_DEBUG("onContentStoreMiss interest=" << interest.getName());
 
-  shared_ptr<Face> face = const_pointer_cast<Face>(inFace.shared_from_this());
   // insert in-record
-  pitEntry->insertOrUpdateInRecord(face, interest);
+  pitEntry->insertOrUpdateInRecord(const_cast<Face&>(inFace), interest);
 
   // set PIT unsatisfy timer
   this->setUnsatisfyTimer(pitEntry);
@@ -252,8 +251,8 @@
   pit::InRecordCollection::iterator pickedInRecord = std::max_element(
     pitEntry->in_begin(), pitEntry->in_end(),
     [&outFace] (const pit::InRecord& a, const pit::InRecord& b) {
-      bool isOutFaceA = a.getFace().get() == &outFace;
-      bool isOutFaceB = b.getFace().get() == &outFace;
+      bool isOutFaceA = &a.getFace() == &outFace;
+      bool isOutFaceB = &b.getFace() == &outFace;
       return (isOutFaceA > isOutFaceB) ||
              (isOutFaceA == isOutFaceB && a.getLastRenewed() < b.getLastRenewed());
     });
@@ -267,7 +266,7 @@
   }
 
   // insert out-record
-  pitEntry->insertOrUpdateOutRecord(outFace.shared_from_this(), *interest);
+  pitEntry->insertOrUpdateOutRecord(outFace, *interest);
 
   // send Interest
   outFace.sendInterest(*interest);
@@ -360,7 +359,7 @@
     // remember pending downstreams
     for (const pit::InRecord& inRecord : pitEntry->getInRecords()) {
       if (inRecord.getExpiry() > now) {
-        pendingDownstreams.insert(inRecord.getFace().get());
+        pendingDownstreams.insert(&inRecord.getFace());
       }
     }
 
diff --git a/daemon/fw/pit-algorithm.cpp b/daemon/fw/pit-algorithm.cpp
index a9ef7ea..3ff63b8 100644
--- a/daemon/fw/pit-algorithm.cpp
+++ b/daemon/fw/pit-algorithm.cpp
@@ -49,7 +49,7 @@
   if (scope_prefix::LOCALHOP.isPrefixOf(pitEntry.getName())) {
     // face is non-local, violates localhop scope unless PIT entry has local in-record
     return std::none_of(pitEntry.in_begin(), pitEntry.in_end(),
-      [] (const pit::InRecord& inRecord) { return inRecord.getFace()->getScope() == ndn::nfd::FACE_SCOPE_LOCAL; });
+      [] (const pit::InRecord& inRecord) { return inRecord.getFace().getScope() == ndn::nfd::FACE_SCOPE_LOCAL; });
   }
 
   // Name is not subject to scope control
@@ -63,7 +63,7 @@
 
   bool hasUnexpiredOutRecord = std::any_of(pitEntry.out_begin(), pitEntry.out_end(),
     [&face, &now] (const pit::OutRecord& outRecord) {
-      return outRecord.getFace().get() == &face && outRecord.getExpiry() >= now;
+      return &outRecord.getFace() == &face && outRecord.getExpiry() >= now;
     });
   if (hasUnexpiredOutRecord) {
     return false;
@@ -71,7 +71,7 @@
 
   bool hasUnexpiredOtherInRecord = std::any_of(pitEntry.in_begin(), pitEntry.in_end(),
     [&face, &now] (const pit::InRecord& inRecord) {
-      return inRecord.getFace().get() != &face && inRecord.getExpiry() >= now;
+      return &inRecord.getFace() != &face && inRecord.getExpiry() >= now;
     });
   if (!hasUnexpiredOtherInRecord) {
     return false;
@@ -87,7 +87,7 @@
 
   for (const pit::InRecord& inRecord : pitEntry.getInRecords()) {
     if (inRecord.getLastNonce() == nonce) {
-      if (inRecord.getFace().get() == &face) {
+      if (&inRecord.getFace() == &face) {
         dnw |= DUPLICATE_NONCE_IN_SAME;
       }
       else {
@@ -98,7 +98,7 @@
 
   for (const pit::OutRecord& outRecord : pitEntry.getOutRecords()) {
     if (outRecord.getLastNonce() == nonce) {
-      if (outRecord.getFace().get() == &face) {
+      if (&outRecord.getFace() == &face) {
         dnw |= DUPLICATE_NONCE_OUT_SAME;
       }
       else {
diff --git a/daemon/fw/strategy.cpp b/daemon/fw/strategy.cpp
index 2a40517..f645369 100644
--- a/daemon/fw/strategy.cpp
+++ b/daemon/fw/strategy.cpp
@@ -75,10 +75,10 @@
   // populate downstreams with all downstreams faces
   std::unordered_set<const Face*> downstreams;
   std::transform(pitEntry->in_begin(), pitEntry->in_end(), std::inserter(downstreams, downstreams.end()),
-                 [] (const pit::InRecord& inR) { return inR.getFace().get(); });
+                 [] (const pit::InRecord& inR) { return &inR.getFace(); });
 
   // delete excluded faces
-  // .erase in a loop is more efficient than std::set_difference between that requires sorted range
+  // .erase in a loop is more efficient than std::set_difference because that requires sorted range
   for (const Face* exceptFace : exceptFaces) {
     downstreams.erase(exceptFace);
   }
