diff --git a/daemon/fw/access-strategy.cpp b/daemon/fw/access-strategy.cpp
index 6ae2767..51f7c8d 100644
--- a/daemon/fw/access-strategy.cpp
+++ b/daemon/fw/access-strategy.cpp
@@ -172,7 +172,7 @@
     return;
   }
 
-  auto inRecord = pitEntry->getInRecord(*inFace, inEndpointId);
+  auto inRecord = pitEntry->getInRecord(*inFace);
   // in-record is erased only if Interest is satisfied, and RTO timer should have been cancelled
   // note: if this strategy is extended to send Nacks, that would also erase the in-record,
   //       and the RTO timer should be cancelled in that case as well
@@ -219,7 +219,7 @@
     return;
   }
 
-  auto outRecord = pitEntry->getOutRecord(ingress.face, 0);
+  auto outRecord = pitEntry->getOutRecord(ingress.face);
   if (outRecord == pitEntry->out_end()) { // no out-record
     NFD_LOG_DEBUG(pitEntry->getInterest() << " dataFrom " << ingress << " no-out-record");
     return;
diff --git a/daemon/fw/algorithm.cpp b/daemon/fw/algorithm.cpp
index 6ea610f..1ed699b 100644
--- a/daemon/fw/algorithm.cpp
+++ b/daemon/fw/algorithm.cpp
@@ -140,7 +140,7 @@
     if (!isNextHopEligible(inFace, interest, *it, pitEntry))
       continue;
 
-    auto outRecord = pitEntry->getOutRecord(it->getFace(), 0);
+    auto outRecord = pitEntry->getOutRecord(it->getFace());
     BOOST_ASSERT(outRecord != pitEntry->out_end());
     if (outRecord->getLastRenewed() < earliestRenewed) {
       found = it;
@@ -166,7 +166,7 @@
 
   if (wantUnused) {
     // nexthop must not have unexpired out-record
-    auto outRecord = pitEntry->getOutRecord(outFace, 0);
+    auto outRecord = pitEntry->getOutRecord(outFace);
     if (outRecord != pitEntry->out_end() && outRecord->getExpiry() > now) {
       return false;
     }
diff --git a/daemon/fw/asf-strategy.cpp b/daemon/fw/asf-strategy.cpp
index 62336eb..90b4ebe 100644
--- a/daemon/fw/asf-strategy.cpp
+++ b/daemon/fw/asf-strategy.cpp
@@ -181,7 +181,7 @@
     return;
   }
 
-  auto outRecord = pitEntry->getOutRecord(ingress.face, 0);
+  auto outRecord = pitEntry->getOutRecord(ingress.face);
   if (outRecord == pitEntry->out_end()) {
     NFD_LOG_DEBUG(pitEntry->getName() << " data from=" << ingress << " no-out-record");
   }
diff --git a/daemon/fw/forwarder.cpp b/daemon/fw/forwarder.cpp
index 4c60129..4c91fb7 100644
--- a/daemon/fw/forwarder.cpp
+++ b/daemon/fw/forwarder.cpp
@@ -167,13 +167,8 @@
   NFD_LOG_DEBUG("onContentStoreMiss interest=" << interest.getName());
   ++m_counters.nCsMisses;
 
-  // FIXME Strategies are not prepared to handle non-zero EndpointIds, so always insert
-  //       the in-record and dispatch to strategy with EndpointId=0 for now. Eventually,
-  //       this pipeline will need to be refactored so that strategies can control the
-  //       in-record insertion.
-
   // insert in-record
-  pitEntry->insertOrUpdateInRecord(ingress.face, 0, interest);
+  pitEntry->insertOrUpdateInRecord(ingress.face, interest);
 
   // set PIT expiry timer to the time that the last PIT in-record expires
   auto lastExpiring = std::max_element(pitEntry->in_begin(), pitEntry->in_end(),
@@ -233,7 +228,7 @@
   NFD_LOG_DEBUG("onOutgoingInterest out=" << egress << " interest=" << pitEntry->getName());
 
   // insert out-record
-  pitEntry->insertOrUpdateOutRecord(egress.face, egress.endpoint, interest);
+  pitEntry->insertOrUpdateOutRecord(egress.face, interest);
 
   // send Interest
   egress.face.sendInterest(interest, egress.endpoint);
@@ -311,7 +306,7 @@
     this->insertDeadNonceList(*pitEntry, &ingress.face);
 
     // delete PIT entry's out-record
-    pitEntry->deleteOutRecord(ingress.face, ingress.endpoint);
+    pitEntry->deleteOutRecord(ingress.face);
   }
   // when more than one PIT entry is matched, trigger strategy: before satisfy Interest,
   // and send Data to all matched out faces
@@ -325,7 +320,7 @@
       // remember pending downstreams
       for (const pit::InRecord& inRecord : pitEntry->getInRecords()) {
         if (inRecord.getExpiry() > now) {
-          pendingDownstreams.emplace(&inRecord.getFace(), inRecord.getEndpointId());
+          pendingDownstreams.emplace(&inRecord.getFace(), 0);
         }
       }
 
@@ -345,7 +340,7 @@
 
       // clear PIT entry's in and out records
       pitEntry->clearInRecords();
-      pitEntry->deleteOutRecord(ingress.face, ingress.endpoint);
+      pitEntry->deleteOutRecord(ingress.face);
     }
 
     // foreach pending downstream
@@ -424,7 +419,7 @@
   }
 
   // has out-record?
-  auto outRecord = pitEntry->getOutRecord(ingress.face, ingress.endpoint);
+  auto outRecord = pitEntry->getOutRecord(ingress.face);
   // if no out-record found, drop
   if (outRecord == pitEntry->out_end()) {
     NFD_LOG_DEBUG("onIncomingNack in=" << ingress << " nack=" << nack.getInterest().getName()
@@ -467,7 +462,7 @@
   }
 
   // has in-record?
-  auto inRecord = pitEntry->getInRecord(egress.face, egress.endpoint);
+  auto inRecord = pitEntry->getInRecord(egress.face);
 
   // if no in-record found, drop
   if (inRecord == pitEntry->in_end()) {
@@ -494,7 +489,7 @@
   nackPkt.setHeader(nack);
 
   // erase in-record
-  pitEntry->deleteInRecord(egress.face, egress.endpoint);
+  pitEntry->deleteInRecord(egress.face);
 
   // send Nack on face
   egress.face.sendNack(nackPkt, egress.endpoint);
@@ -542,7 +537,7 @@
   }
   else {
     // insert outgoing Nonce of a specific face
-    auto outRecord = pitEntry.getOutRecord(*upstream, 0);
+    auto outRecord = pitEntry.getOutRecord(*upstream);
     if (outRecord != pitEntry.getOutRecords().end()) {
       m_deadNonceList.add(pitEntry.getName(), outRecord->getLastNonce());
     }
diff --git a/daemon/fw/multicast-strategy.cpp b/daemon/fw/multicast-strategy.cpp
index d15063e..d861071 100644
--- a/daemon/fw/multicast-strategy.cpp
+++ b/daemon/fw/multicast-strategy.cpp
@@ -93,7 +93,7 @@
     NFD_LOG_DEBUG(interest << " from=" << ingress << " pitEntry-to=" << outFace.getId());
 
     if (suppressResult == RetxSuppressionResult::FORWARD) {
-      m_retxSuppression.incrementIntervalForOutRecord(*pitEntry->getOutRecord(outFace, 0));
+      m_retxSuppression.incrementIntervalForOutRecord(*pitEntry->getOutRecord(outFace));
     }
     ++nEligibleNextHops;
   }
diff --git a/daemon/fw/ncc-strategy.cpp b/daemon/fw/ncc-strategy.cpp
index 4969a14..9909272 100644
--- a/daemon/fw/ncc-strategy.cpp
+++ b/daemon/fw/ncc-strategy.cpp
@@ -143,7 +143,7 @@
   if (pitEntry == nullptr) {
     return;
   }
-  auto inRecord = pitEntry->getInRecord(*inFace, 0);
+  auto inRecord = pitEntry->getInRecord(*inFace);
   if (inRecord == pitEntry->in_end()) {
     return;
   }
diff --git a/daemon/fw/process-nack-traits.cpp b/daemon/fw/process-nack-traits.cpp
index 6f3ad08..ed599d9 100644
--- a/daemon/fw/process-nack-traits.cpp
+++ b/daemon/fw/process-nack-traits.cpp
@@ -56,7 +56,7 @@
 
   if (nOutRecordsNotNacked == 1) {
     BOOST_ASSERT(lastFaceNotNacked != nullptr);
-    pit::InRecordCollection::iterator inR = pitEntry->getInRecord(*lastFaceNotNacked, 0);
+    pit::InRecordCollection::iterator inR = pitEntry->getInRecord(*lastFaceNotNacked);
     if (inR != pitEntry->in_end()) {
       // one out-record not Nacked, which is also a downstream
       NFD_LOG_DEBUG(nack.getInterest() << " nack-from=" << inFace.getId() <<
diff --git a/daemon/fw/retx-suppression-exponential.cpp b/daemon/fw/retx-suppression-exponential.cpp
index 1275dd9..c634173 100644
--- a/daemon/fw/retx-suppression-exponential.cpp
+++ b/daemon/fw/retx-suppression-exponential.cpp
@@ -95,7 +95,7 @@
 RetxSuppressionExponential::decidePerUpstream(pit::Entry& pitEntry, Face& outFace)
 {
   // NEW if outRecord for the face does not exist
-  auto outRecord = pitEntry.getOutRecord(outFace, 0);
+  auto outRecord = pitEntry.getOutRecord(outFace);
   if (outRecord == pitEntry.out_end()) {
     return RetxSuppressionResult::NEW;
   }
diff --git a/daemon/fw/self-learning-strategy.cpp b/daemon/fw/self-learning-strategy.cpp
index fd6d16e..a77d3ef 100644
--- a/daemon/fw/self-learning-strategy.cpp
+++ b/daemon/fw/self-learning-strategy.cpp
@@ -73,7 +73,7 @@
   const fib::NextHopList& nexthops = fibEntry.getNextHops();
 
   bool isNonDiscovery = interest.getTag<lp::NonDiscoveryTag>() != nullptr;
-  auto inRecordInfo = pitEntry->getInRecord(ingress.face, ingress.endpoint)->insertStrategyInfo<InRecordInfo>().first;
+  auto inRecordInfo = pitEntry->getInRecord(ingress.face)->insertStrategyInfo<InRecordInfo>().first;
   if (isNonDiscovery) { // "non-discovery" Interest
     inRecordInfo->isNonDiscoveryInterest = true;
     if (nexthops.empty()) { // return NACK if no matching FIB entry exists
@@ -103,7 +103,7 @@
 SelfLearningStrategy::afterReceiveData(const shared_ptr<pit::Entry>& pitEntry,
                                        const FaceEndpoint& ingress, const Data& data)
 {
-  OutRecordInfo* outRecordInfo = pitEntry->getOutRecord(ingress.face, ingress.endpoint)->getStrategyInfo<OutRecordInfo>();
+  OutRecordInfo* outRecordInfo = pitEntry->getOutRecord(ingress.face)->getStrategyInfo<OutRecordInfo>();
   if (outRecordInfo && outRecordInfo->isNonDiscoveryInterest) { // outgoing Interest was non-discovery
     if (!needPrefixAnn(pitEntry)) { // no need to attach a PA (common cases)
       sendDataToAll(pitEntry, ingress, data);
@@ -147,7 +147,7 @@
       continue;
     }
     this->sendInterest(pitEntry, FaceEndpoint(outFace, 0), interest);
-    pitEntry->getOutRecord(outFace, 0)->insertStrategyInfo<OutRecordInfo>().first->isNonDiscoveryInterest = false;
+    pitEntry->getOutRecord(outFace)->insertStrategyInfo<OutRecordInfo>().first->isNonDiscoveryInterest = false;
     NFD_LOG_DEBUG("send discovery Interest=" << interest << " from="
                   << inFace.getId() << " to=" << outFace.getId());
   }
@@ -165,7 +165,7 @@
       continue;
     }
     this->sendInterest(pitEntry, FaceEndpoint(outFace, 0), interest);
-    pitEntry->getOutRecord(outFace, 0)->insertStrategyInfo<OutRecordInfo>().first->isNonDiscoveryInterest = true;
+    pitEntry->getOutRecord(outFace)->insertStrategyInfo<OutRecordInfo>().first->isNonDiscoveryInterest = true;
     NFD_LOG_DEBUG("send non-discovery Interest=" << interest << " from="
                   << inFace.getId() << " to=" << outFace.getId());
   }
diff --git a/daemon/fw/strategy.cpp b/daemon/fw/strategy.cpp
index 151dac8..b4ccda8 100644
--- a/daemon/fw/strategy.cpp
+++ b/daemon/fw/strategy.cpp
@@ -199,7 +199,7 @@
 
   // delete the PIT entry's in-record based on egress,
   // since Data is sent to face and endpoint from which the Interest was received
-  pitEntry->deleteInRecord(egress.face, egress.endpoint);
+  pitEntry->deleteInRecord(egress.face);
 
   m_forwarder.onOutgoingData(data, egress);
 }
@@ -208,23 +208,22 @@
 Strategy::sendDataToAll(const shared_ptr<pit::Entry>& pitEntry,
                         const FaceEndpoint& ingress, const Data& data)
 {
-  std::set<std::pair<Face*, EndpointId>> pendingDownstreams;
+  std::set<Face*> pendingDownstreams;
   auto now = time::steady_clock::now();
 
   // remember pending downstreams
   for (const pit::InRecord& inRecord : pitEntry->getInRecords()) {
     if (inRecord.getExpiry() > now) {
       if (inRecord.getFace().getId() == ingress.face.getId() &&
-          inRecord.getEndpointId() == ingress.endpoint &&
           inRecord.getFace().getLinkType() != ndn::nfd::LINK_TYPE_AD_HOC) {
         continue;
       }
-      pendingDownstreams.emplace(&inRecord.getFace(), inRecord.getEndpointId());
+      pendingDownstreams.emplace(&inRecord.getFace());
     }
   }
 
   for (const auto& pendingDownstream : pendingDownstreams) {
-    this->sendData(pitEntry, data, FaceEndpoint(*pendingDownstream.first, pendingDownstream.second));
+    this->sendData(pitEntry, data, FaceEndpoint(*pendingDownstream, 0));
   }
 }
 
@@ -233,20 +232,20 @@
                     std::initializer_list<FaceEndpoint> exceptFaceEndpoints)
 {
   // populate downstreams with all downstreams faces
-  std::set<std::pair<Face*, EndpointId>> downstreams;
+  std::set<Face*> downstreams;
   std::transform(pitEntry->in_begin(), pitEntry->in_end(), std::inserter(downstreams, downstreams.end()),
                  [] (const pit::InRecord& inR) {
-                  return std::make_pair(&inR.getFace(), inR.getEndpointId());
+                  return &inR.getFace();
                  });
 
   // delete excluded faces
   for (const auto& exceptFaceEndpoint : exceptFaceEndpoints) {
-    downstreams.erase({&exceptFaceEndpoint.face, exceptFaceEndpoint.endpoint});
+    downstreams.erase(&exceptFaceEndpoint.face);
   }
 
   // send Nacks
   for (const auto& downstream : downstreams) {
-    this->sendNack(pitEntry, FaceEndpoint(*downstream.first, downstream.second), header);
+    this->sendNack(pitEntry, FaceEndpoint(*downstream, 0), header);
   }
   // warning: don't loop on pitEntry->getInRecords(), because in-record is deleted when sending Nack
 }
diff --git a/daemon/table/cleanup.cpp b/daemon/table/cleanup.cpp
index a62304b..b025de8 100644
--- a/daemon/table/cleanup.cpp
+++ b/daemon/table/cleanup.cpp
@@ -40,7 +40,7 @@
     }
 
     for (const auto& pitEntry : nte.getPitEntries()) {
-      pit.deleteInOutRecordsByFace(pitEntry.get(), face);
+      pit.deleteInOutRecords(pitEntry.get(), face);
     }
 
     if (!nte.hasTableEntries()) {
diff --git a/daemon/table/pit-entry.cpp b/daemon/table/pit-entry.cpp
index 4de7bcd..e2e194f 100644
--- a/daemon/table/pit-entry.cpp
+++ b/daemon/table/pit-entry.cpp
@@ -49,25 +49,21 @@
 }
 
 InRecordCollection::iterator
-Entry::getInRecord(const Face& face, EndpointId endpointId)
+Entry::getInRecord(const Face& face)
 {
   return std::find_if(m_inRecords.begin(), m_inRecords.end(),
-    [&face, endpointId] (const InRecord& inRecord) {
-      return &inRecord.getFace() == &face && inRecord.getEndpointId() == endpointId;
-    });
+    [&face] (const InRecord& inRecord) { return &inRecord.getFace() == &face; });
 }
 
 InRecordCollection::iterator
-Entry::insertOrUpdateInRecord(Face& face, EndpointId endpointId, const Interest& interest)
+Entry::insertOrUpdateInRecord(Face& face, const Interest& interest)
 {
   BOOST_ASSERT(this->canMatch(interest));
 
   auto it = std::find_if(m_inRecords.begin(), m_inRecords.end(),
-    [&face, endpointId] (const InRecord& inRecord) {
-      return &inRecord.getFace() == &face && inRecord.getEndpointId() == endpointId;
-    });
+    [&face] (const InRecord& inRecord) { return &inRecord.getFace() == &face; });
   if (it == m_inRecords.end()) {
-    m_inRecords.emplace_front(face, endpointId);
+    m_inRecords.emplace_front(face);
     it = m_inRecords.begin();
   }
 
@@ -76,12 +72,10 @@
 }
 
 void
-Entry::deleteInRecord(const Face& face, EndpointId endpointId)
+Entry::deleteInRecord(const Face& face)
 {
   auto it = std::find_if(m_inRecords.begin(), m_inRecords.end(),
-    [&face, endpointId] (const InRecord& inRecord) {
-      return &inRecord.getFace() == &face && inRecord.getEndpointId() == endpointId;
-    });
+    [&face] (const InRecord& inRecord) { return &inRecord.getFace() == &face; });
   if (it != m_inRecords.end()) {
     m_inRecords.erase(it);
   }
@@ -94,25 +88,21 @@
 }
 
 OutRecordCollection::iterator
-Entry::getOutRecord(const Face& face, EndpointId endpointId)
+Entry::getOutRecord(const Face& face)
 {
   return std::find_if(m_outRecords.begin(), m_outRecords.end(),
-    [&face, endpointId] (const OutRecord& outRecord) {
-      return &outRecord.getFace() == &face && outRecord.getEndpointId() == endpointId;
-    });
+    [&face] (const OutRecord& outRecord) { return &outRecord.getFace() == &face; });
 }
 
 OutRecordCollection::iterator
-Entry::insertOrUpdateOutRecord(Face& face, EndpointId endpointId, const Interest& interest)
+Entry::insertOrUpdateOutRecord(Face& face, const Interest& interest)
 {
   BOOST_ASSERT(this->canMatch(interest));
 
   auto it = std::find_if(m_outRecords.begin(), m_outRecords.end(),
-    [&face, endpointId] (const OutRecord& outRecord) {
-      return &outRecord.getFace() == &face && outRecord.getEndpointId() == endpointId;
-    });
+    [&face] (const OutRecord& outRecord) { return &outRecord.getFace() == &face; });
   if (it == m_outRecords.end()) {
-    m_outRecords.emplace_front(face, endpointId);
+    m_outRecords.emplace_front(face);
     it = m_outRecords.begin();
   }
 
@@ -121,27 +111,14 @@
 }
 
 void
-Entry::deleteOutRecord(const Face& face, EndpointId endpointId)
+Entry::deleteOutRecord(const Face& face)
 {
   auto it = std::find_if(m_outRecords.begin(), m_outRecords.end(),
-    [&face, endpointId] (const OutRecord& outRecord) {
-      return &outRecord.getFace() == &face && outRecord.getEndpointId() == endpointId;
-    });
+    [&face] (const OutRecord& outRecord) { return &outRecord.getFace() == &face; });
   if (it != m_outRecords.end()) {
     m_outRecords.erase(it);
   }
 }
 
-void
-Entry::deleteInOutRecordsByFace(const Face& face)
-{
-  m_inRecords.remove_if([&face] (const InRecord& inRecord) {
-    return &inRecord.getFace() == &face;
-  });
-  m_outRecords.remove_if([&face] (const OutRecord& outRecord) {
-    return &outRecord.getFace() == &face;
-  });
-}
-
 } // namespace pit
 } // namespace nfd
diff --git a/daemon/table/pit-entry.hpp b/daemon/table/pit-entry.hpp
index 8100b8e..9e4a357 100644
--- a/daemon/table/pit-entry.hpp
+++ b/daemon/table/pit-entry.hpp
@@ -131,22 +131,22 @@
     return m_inRecords.end();
   }
 
-  /** \brief get the in-record for \p face and \p endpointId
+  /** \brief get the in-record for \p face
    *  \return an iterator to the in-record, or in_end() if it does not exist
    */
   InRecordCollection::iterator
-  getInRecord(const Face& face, EndpointId endpointId);
+  getInRecord(const Face& face);
 
   /** \brief insert or update an in-record
    *  \return an iterator to the new or updated in-record
    */
   InRecordCollection::iterator
-  insertOrUpdateInRecord(Face& face, EndpointId endpointId, const Interest& interest);
+  insertOrUpdateInRecord(Face& face, const Interest& interest);
 
-  /** \brief delete the in-record for \p face and \p endpointId if it exists
+  /** \brief delete the in-record for \p face if it exists
    */
   void
-  deleteInRecord(const Face& face, EndpointId endpointId);
+  deleteInRecord(const Face& face);
 
   /** \brief delete all in-records
    */
@@ -198,28 +198,22 @@
     return m_outRecords.end();
   }
 
-  /** \brief get the out-record for \p face and \p endpointId
+  /** \brief get the out-record for \p face
    *  \return an iterator to the out-record, or out_end() if it does not exist
    */
   OutRecordCollection::iterator
-  getOutRecord(const Face& face, EndpointId endpointId);
+  getOutRecord(const Face& face);
 
   /** \brief insert or update an out-record
    *  \return an iterator to the new or updated out-record
    */
   OutRecordCollection::iterator
-  insertOrUpdateOutRecord(Face& face, EndpointId endpointId, const Interest& interest);
+  insertOrUpdateOutRecord(Face& face, const Interest& interest);
 
-  /** \brief delete the out-record for \p face and \p endpointId if it exists
+  /** \brief delete the out-record for \p face if it exists
    */
   void
-  deleteOutRecord(const Face& face, EndpointId endpointId);
-
-public: // cleanup
-  /** \brief delete all in-records and out-records for \p face if it exists
-   */
-  void
-  deleteInOutRecordsByFace(const Face& face);
+  deleteOutRecord(const Face& face);
 
 public:
   /** \brief Expiry timer
diff --git a/daemon/table/pit-face-record.hpp b/daemon/table/pit-face-record.hpp
index 0c76530..7c36ab6 100644
--- a/daemon/table/pit-face-record.hpp
+++ b/daemon/table/pit-face-record.hpp
@@ -39,9 +39,9 @@
 class FaceRecord : public StrategyInfoHost
 {
 public:
-  FaceRecord(Face& face, EndpointId endpointId)
+  explicit
+  FaceRecord(Face& face)
     : m_face(face)
-    , m_endpointId(endpointId)
   {
   }
 
@@ -51,12 +51,6 @@
     return m_face;
   }
 
-  EndpointId
-  getEndpointId() const
-  {
-    return m_endpointId;
-  }
-
   uint32_t
   getLastNonce() const
   {
@@ -85,7 +79,6 @@
 
 private:
   Face& m_face;
-  EndpointId m_endpointId;
   uint32_t m_lastNonce = 0;
   time::steady_clock::TimePoint m_lastRenewed = time::steady_clock::TimePoint::min();
   time::steady_clock::TimePoint m_expiry = time::steady_clock::TimePoint::min();
diff --git a/daemon/table/pit.cpp b/daemon/table/pit.cpp
index c626c3a..cc447f2 100644
--- a/daemon/table/pit.cpp
+++ b/daemon/table/pit.cpp
@@ -112,11 +112,12 @@
 }
 
 void
-Pit::deleteInOutRecordsByFace(Entry* entry, const Face& face)
+Pit::deleteInOutRecords(Entry* entry, const Face& face)
 {
   BOOST_ASSERT(entry != nullptr);
 
-  entry->deleteInOutRecordsByFace(face);
+  entry->deleteInRecord(face);
+  entry->deleteOutRecord(face);
 
   /// \todo decide whether to delete PIT entry if there's no more in/out-record left
 }
diff --git a/daemon/table/pit.hpp b/daemon/table/pit.hpp
index 5464e00..c998a4d 100644
--- a/daemon/table/pit.hpp
+++ b/daemon/table/pit.hpp
@@ -93,10 +93,10 @@
     this->erase(entry, true);
   }
 
-  /** \brief Deletes all in-records and out-records for \p face
+  /** \brief Deletes in-records and out-records for \p face
    */
   void
-  deleteInOutRecordsByFace(Entry* entry, const Face& face);
+  deleteInOutRecords(Entry* entry, const Face& face);
 
 public: // enumeration
   typedef Iterator const_iterator;
