diff --git a/daemon/table/cs-entry.cpp b/daemon/table/cs-entry.cpp
index 584dda3..d4f3921 100644
--- a/daemon/table/cs-entry.cpp
+++ b/daemon/table/cs-entry.cpp
@@ -28,91 +28,38 @@
 namespace nfd {
 namespace cs {
 
-Entry::Entry(const Name& name)
-  : m_queryName(name)
+void
+Entry::setData(shared_ptr<const Data> data, bool isUnsolicited)
 {
-  BOOST_ASSERT(this->isQuery());
-}
+  m_data = data;
+  m_isUnsolicited = isUnsolicited;
 
-Entry::Entry(shared_ptr<const Data> data, bool isUnsolicited)
-  : queueType(Cs::QUEUE_NONE)
-  , m_data(data)
-  , m_isUnsolicited(isUnsolicited)
-{
-  BOOST_ASSERT(!this->isQuery());
-}
-
-bool
-Entry::isQuery() const
-{
-  return m_data == nullptr;
-}
-
-shared_ptr<const Data>
-Entry::getData() const
-{
-  BOOST_ASSERT(!this->isQuery());
-  return m_data;
-}
-
-const Name&
-Entry::getName() const
-{
-  BOOST_ASSERT(!this->isQuery());
-  return m_data->getName();
-}
-
-const Name&
-Entry::getFullName() const
-{
-  BOOST_ASSERT(!this->isQuery());
-  return m_data->getFullName();
-}
-
-bool
-Entry::canStale() const
-{
-  BOOST_ASSERT(!this->isQuery());
-  return m_data->getFreshnessPeriod() >= time::milliseconds::zero();
+  updateStaleTime();
 }
 
 bool
 Entry::isStale() const
 {
-  BOOST_ASSERT(!this->isQuery());
-  return time::steady_clock::now() > m_staleAt;
+  BOOST_ASSERT(this->hasData());
+  return m_staleTime < time::steady_clock::now();
 }
 
 void
-Entry::refresh()
+Entry::updateStaleTime()
 {
-  BOOST_ASSERT(!this->isQuery());
-  if (this->canStale()) {
-    m_staleAt = time::steady_clock::now() + time::milliseconds(m_data->getFreshnessPeriod());
+  BOOST_ASSERT(this->hasData());
+  if (m_data->getFreshnessPeriod() >= time::milliseconds::zero()) {
+    m_staleTime = time::steady_clock::now() + time::milliseconds(m_data->getFreshnessPeriod());
   }
   else {
-    m_staleAt = time::steady_clock::TimePoint::max();
+    m_staleTime = time::steady_clock::TimePoint::max();
   }
 }
 
 bool
-Entry::isUnsolicited() const
-{
-  BOOST_ASSERT(!this->isQuery());
-  return m_isUnsolicited;
-}
-
-void
-Entry::unsetUnsolicited()
-{
-  BOOST_ASSERT(!this->isQuery());
-  m_isUnsolicited = false;
-}
-
-bool
 Entry::canSatisfy(const Interest& interest) const
 {
-  BOOST_ASSERT(!this->isQuery());
+  BOOST_ASSERT(this->hasData());
   if (!interest.matchesData(*m_data)) {
     return false;
   }
@@ -124,25 +71,12 @@
   return true;
 }
 
-bool
-Entry::operator<(const Entry& other) const
+void
+Entry::reset()
 {
-  if (this->isQuery()) {
-    if (other.isQuery()) {
-      return m_queryName < other.m_queryName;
-    }
-    else {
-      return m_queryName < other.m_queryName;
-    }
-  }
-  else {
-    if (other.isQuery()) {
-      return this->getFullName() < other.m_queryName;
-    }
-    else {
-      return this->getFullName() < other.getFullName();
-    }
-  }
+  m_data.reset();
+  m_isUnsolicited = false;
+  m_staleTime = time::steady_clock::TimePoint();
 }
 
 } // namespace cs
