diff --git a/daemon/table/pit-iterator.hpp b/daemon/table/pit-iterator.hpp
index bfe0e8e..e1647ff 100644
--- a/daemon/table/pit-iterator.hpp
+++ b/daemon/table/pit-iterator.hpp
@@ -34,42 +34,32 @@
 /**
  * \brief PIT iterator.
  */
-class Iterator
+class Iterator : public boost::forward_iterator_helper<Iterator, const Entry>
 {
 public:
-  using iterator_category = std::forward_iterator_tag;
-  using value_type        = const Entry;
-  using difference_type   = std::ptrdiff_t;
-  using pointer           = value_type*;
-  using reference         = value_type&;
-
-  /** \brief Constructor.
-   *  \param ntIt a name tree iterator that visits name tree entries with one or more PIT entries
-   *  \param iPitEntry make this iterator to dereference to the i-th PIT entry in name tree entry
+  /**
+   * \brief Constructor.
+   * \param ntIt a name tree iterator that visits name tree entries with one or more PIT entries
+   * \param iPitEntry make this iterator to dereference to the i-th PIT entry in name tree entry
    */
   explicit
-  Iterator(const NameTree::const_iterator& ntIt = {}, size_t iPitEntry = 0);
-
-  const Entry&
-  operator*() const
+  Iterator(const NameTree::const_iterator& ntIt = {}, size_t iPitEntry = 0)
+    : m_ntIt(ntIt)
+    , m_iPitEntry(iPitEntry)
   {
-    return *this->operator->();
   }
 
-  const shared_ptr<Entry>&
-  operator->() const
+  const Entry&
+  operator*() const noexcept
   {
     BOOST_ASSERT(m_ntIt != NameTree::const_iterator());
     BOOST_ASSERT(m_iPitEntry < m_ntIt->getPitEntries().size());
-    return m_ntIt->getPitEntries()[m_iPitEntry];
+    return *m_ntIt->getPitEntries()[m_iPitEntry];
   }
 
   Iterator&
   operator++();
 
-  Iterator
-  operator++(int);
-
   friend bool
   operator==(const Iterator& lhs, const Iterator& rhs) noexcept
   {
@@ -77,12 +67,6 @@
            lhs.m_iPitEntry == rhs.m_iPitEntry;
   }
 
-  friend bool
-  operator!=(const Iterator& lhs, const Iterator& rhs) noexcept
-  {
-    return !(lhs == rhs);
-  }
-
 private:
   NameTree::const_iterator m_ntIt; ///< current name tree entry
   size_t m_iPitEntry; ///< current PIT entry within m_ntIt->getPitEntries()
