diff --git a/daemon/table/pit-entry.cpp b/daemon/table/pit-entry.cpp
index 194106d..cfbbc82 100644
--- a/daemon/table/pit-entry.cpp
+++ b/daemon/table/pit-entry.cpp
@@ -29,6 +29,36 @@
 
 namespace nfd::pit {
 
+void
+FaceRecord::update(const Interest& interest)
+{
+  m_lastNonce = interest.getNonce();
+  m_lastRenewed = time::steady_clock::now();
+
+  auto lifetime = interest.getInterestLifetime();
+  // impose an upper bound on the lifetime to prevent integer overflow when calculating m_expiry
+  lifetime = std::min<time::milliseconds>(lifetime, 10_days);
+  m_expiry = m_lastRenewed + lifetime;
+}
+
+void
+InRecord::update(const Interest& interest)
+{
+  FaceRecord::update(interest);
+  m_interest = interest.shared_from_this();
+}
+
+bool
+OutRecord::setIncomingNack(const lp::Nack& nack)
+{
+  if (nack.getInterest().getNonce() != this->getLastNonce()) {
+    return false;
+  }
+
+  m_incomingNack = make_unique<lp::NackHeader>(nack.getHeader());
+  return true;
+}
+
 Entry::Entry(const Interest& interest)
   : m_interest(interest.shared_from_this())
 {
@@ -48,7 +78,7 @@
 }
 
 InRecordCollection::iterator
-Entry::getInRecord(const Face& face)
+Entry::findInRecord(const Face& face)
 {
   return std::find_if(m_inRecords.begin(), m_inRecords.end(),
                       [&face] (const InRecord& inRecord) { return &inRecord.getFace() == &face; });
@@ -70,21 +100,8 @@
   return it;
 }
 
-void
-Entry::deleteInRecord(InRecordCollection::const_iterator pos)
-{
-  BOOST_ASSERT(pos != m_inRecords.end());
-  m_inRecords.erase(pos);
-}
-
-void
-Entry::clearInRecords()
-{
-  m_inRecords.clear();
-}
-
 OutRecordCollection::iterator
-Entry::getOutRecord(const Face& face)
+Entry::findOutRecord(const Face& face)
 {
   return std::find_if(m_outRecords.begin(), m_outRecords.end(),
                       [&face] (const OutRecord& outRecord) { return &outRecord.getFace() == &face; });
