diff --git a/src/route/fib-entry.cpp b/src/route/fib-entry.cpp
deleted file mode 100644
index bc11634..0000000
--- a/src/route/fib-entry.cpp
+++ /dev/null
@@ -1,36 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2014-2020,  The University of Memphis,
- *                           Regents of the University of California
- *
- * This file is part of NLSR (Named-data Link State Routing).
- * See AUTHORS.md for complete list of NLSR authors and contributors.
- *
- * NLSR is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NLSR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "fib-entry.hpp"
-#include "logger.hpp"
-
-namespace nlsr {
-
-INIT_LOGGER(route.FibEntry);
-
-void
-FibEntry::writeLog() const
-{
-  NLSR_LOG_DEBUG("Name Prefix: " << m_name);
-  NLSR_LOG_DEBUG("Seq No: " << m_seqNo);
-  NLSR_LOG_DEBUG(m_nexthopList);
-}
-
-} // namespace nlsr
diff --git a/src/route/fib-entry.hpp b/src/route/fib-entry.hpp
deleted file mode 100644
index e5542e1..0000000
--- a/src/route/fib-entry.hpp
+++ /dev/null
@@ -1,108 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2014-2020,  The University of Memphis,
- *                           Regents of the University of California
- *
- * This file is part of NLSR (Named-data Link State Routing).
- * See AUTHORS.md for complete list of NLSR authors and contributors.
- *
- * NLSR is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NLSR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- **/
-
-#ifndef NLSR_FIB_ENTRY_HPP
-#define NLSR_FIB_ENTRY_HPP
-
-#include "nexthop-list.hpp"
-
-#include <ndn-cxx/util/scheduler.hpp>
-
-namespace nlsr {
-
-class FibEntry
-{
-public:
-  FibEntry() = default;
-
-  FibEntry(const ndn::Name& name)
-    : m_name(name)
-  {
-  }
-
-  const ndn::Name&
-  getName() const
-  {
-    return m_name;
-  }
-
-  NexthopList&
-  getNexthopList()
-  {
-    return m_nexthopList;
-  }
-
-  void
-  setRefreshEventId(ndn::scheduler::EventId id)
-  {
-    m_refreshEventId = std::move(id);
-  }
-
-  ndn::scheduler::EventId
-  getRefreshEventId() const
-  {
-    return m_refreshEventId;
-  }
-
-  void
-  setSeqNo(int32_t fsn)
-  {
-    m_seqNo = fsn;
-  }
-
-  int32_t
-  getSeqNo() const
-  {
-    return m_seqNo;
-  }
-
-  void
-  writeLog() const;
-
-  typedef NexthopList::const_iterator const_iterator;
-
-  const_iterator
-  begin() const;
-
-  const_iterator
-  end() const;
-
-private:
-  ndn::Name m_name;
-  ndn::scheduler::EventId m_refreshEventId;
-  int32_t m_seqNo = 1;
-  NexthopList m_nexthopList;
-};
-
-inline FibEntry::const_iterator
-FibEntry::begin() const
-{
-  return m_nexthopList.cbegin();
-}
-
-inline FibEntry::const_iterator
-FibEntry::end() const
-{
-  return m_nexthopList.cend();
-}
-
-} // namespace nlsr
-
-#endif // NLSR_FIB_ENTRY_HPP
diff --git a/src/route/fib.cpp b/src/route/fib.cpp
index 2fef853..1004889 100644
--- a/src/route/fib.cpp
+++ b/src/route/fib.cpp
@@ -33,7 +33,6 @@
 
 INIT_LOGGER(route.Fib);
 
-const uint64_t Fib::GRACE_PERIOD = 10;
 const std::string Fib::MULTICAST_STRATEGY("ndn:/localhost/nfd/strategy/multicast");
 const std::string Fib::BEST_ROUTE_V2_STRATEGY("ndn:/localhost/nfd/strategy/best-route");
 
@@ -54,11 +53,10 @@
   auto it = m_table.find(name);
 
   // Only unregister the prefix if it ISN'T a neighbor.
-  if (it != m_table.end() && isNotNeighbor((it->second).getName())) {
-    for (const auto& nexthop : (it->second).getNexthopList().getNextHops()) {
-      unregisterPrefix((it->second).getName(), nexthop.getConnectingFaceUri());
+  if (it != m_table.end() && isNotNeighbor((it->second).name)) {
+    for (const auto& nexthop : (it->second).nexthopList.getNextHops()) {
+      unregisterPrefix((it->second).name, nexthop.getConnectingFaceUri());
     }
-    cancelEntryRefresh(it->second);
     m_table.erase(it);
   }
 }
@@ -66,14 +64,14 @@
 void
 Fib::addNextHopsToFibEntryAndNfd(FibEntry& entry, const NexthopList& hopsToAdd)
 {
-  const ndn::Name& name = entry.getName();
+  const ndn::Name& name = entry.name;
 
   bool shouldRegister = isNotNeighbor(name);
 
   for (const auto& hop : hopsToAdd.getNextHops())
   {
     // Add nexthop to FIB entry
-    entry.getNexthopList().addNextHop(hop);
+    entry.nexthopList.addNextHop(hop);
 
     if (shouldRegister) {
       // Add nexthop to NDN-FIB
@@ -108,11 +106,12 @@
   if (entryIt == m_table.end() && hopsToAdd.size() != 0) {
     NLSR_LOG_DEBUG("New FIB Entry");
 
-    FibEntry entry(name);
+    FibEntry entry;
+    entry.name = name;
 
     addNextHopsToFibEntryAndNfd(entry, hopsToAdd);
 
-    m_table.emplace(name, entry);
+    m_table.emplace(name, std::move(entry));
 
     entryIt = m_table.find(name);
   }
@@ -131,47 +130,39 @@
     addNextHopsToFibEntryAndNfd(entry, hopsToAdd);
 
     std::set<NextHop, NextHopComparator> hopsToRemove;
-    std::set_difference(entry.getNexthopList().begin(), entry.getNexthopList().end(),
+    std::set_difference(entry.nexthopList.begin(), entry.nexthopList.end(),
                         hopsToAdd.begin(), hopsToAdd.end(),
                         std::inserter(hopsToRemove, hopsToRemove.end()), NextHopComparator());
 
-    bool isUpdatable = isNotNeighbor(entry.getName());
+    bool isUpdatable = isNotNeighbor(entry.name);
     // Remove the uninstalled next hops from NFD and FIB entry
     for (const auto& hop : hopsToRemove){
       if (isUpdatable) {
-        unregisterPrefix(entry.getName(), hop.getConnectingFaceUri());
+        unregisterPrefix(entry.name, hop.getConnectingFaceUri());
       }
-      NLSR_LOG_DEBUG("Removing " << hop.getConnectingFaceUri() << " from " << entry.getName());
-      entry.getNexthopList().removeNextHop(hop);
+      NLSR_LOG_DEBUG("Removing " << hop.getConnectingFaceUri() << " from " << entry.name);
+      entry.nexthopList.removeNextHop(hop);
     }
 
     // Increment sequence number
-    entry.setSeqNo(entry.getSeqNo() + 1);
-
+    entry.seqNo += 1;
     entryIt = m_table.find(name);
-
   }
+
   if (entryIt != m_table.end() &&
-      !entryIt->second.getRefreshEventId() &&
-      isNotNeighbor(entryIt->second.getName())) {
-    scheduleEntryRefresh(entryIt->second,
-                         [this] (FibEntry& entry) {
-                           scheduleLoop(entry);
-                         });
+      !entryIt->second.refreshEventId &&
+      isNotNeighbor(entryIt->second.name)) {
+    scheduleEntryRefresh(entryIt->second, [this] (FibEntry& entry) { scheduleLoop(entry); });
   }
 }
 
 void
 Fib::clean()
 {
-  NLSR_LOG_DEBUG("Fib::clean called");
-  // can't use const ref here as getNexthopList can't be marked const
-  for (auto&& it : m_table) {
-    NLSR_LOG_DEBUG("Canceling Scheduled event. Name: " << it.second.getName());
-    cancelEntryRefresh(it.second);
-
-    for (const auto& hop : it.second.getNexthopList().getNextHops()) {
-      unregisterPrefix(it.second.getName(), hop.getConnectingFaceUri());
+  NLSR_LOG_DEBUG("Clean called");
+  for (const auto& it : m_table) {
+    for (const auto& hop : it.second.nexthopList.getNextHops()) {
+      unregisterPrefix(it.second.name, hop.getConnectingFaceUri());
     }
   }
 }
@@ -182,13 +173,8 @@
   uint32_t nNextHops = static_cast<uint32_t>(nextHopList.getNextHops().size());
   uint32_t nMaxFaces = m_confParameter.getMaxFacesPerPrefix();
 
-  // Allow all faces
-  if (nMaxFaces == 0) {
-    return nNextHops;
-  }
-  else {
-    return std::min(nNextHops, nMaxFaces);
-  }
+  // 0 == all faces
+  return nMaxFaces == 0 ? nNextHops : std::min(nNextHops, nMaxFaces);
 }
 
 bool
@@ -325,13 +311,13 @@
 void
 Fib::scheduleEntryRefresh(FibEntry& entry, const afterRefreshCallback& refreshCallback)
 {
-  NLSR_LOG_DEBUG("Scheduling refresh for " << entry.getName() <<
-                 " Seq Num: " << entry.getSeqNo() <<
+  NLSR_LOG_DEBUG("Scheduling refresh for " << entry.name <<
+                 " Seq Num: " << entry.seqNo <<
                  " in " << m_refreshTime << " seconds");
 
-  entry.setRefreshEventId(m_scheduler.schedule(ndn::time::seconds(m_refreshTime),
-                                               std::bind(&Fib::refreshEntry, this,
-                                                         entry.getName(), refreshCallback)));
+  entry.refreshEventId = m_scheduler.schedule(ndn::time::seconds(m_refreshTime),
+                                              std::bind(&Fib::refreshEntry, this,
+                                                        entry.name, refreshCallback));
 }
 
 void
@@ -341,13 +327,6 @@
 }
 
 void
-Fib::cancelEntryRefresh(const FibEntry& entry)
-{
-  NLSR_LOG_DEBUG("Canceling refresh for " << entry.getName() << " Seq Num: " << entry.getSeqNo());
-  entry.getRefreshEventId().cancel();
-}
-
-void
 Fib::refreshEntry(const ndn::Name& name, afterRefreshCallback refreshCb)
 {
   auto it = m_table.find(name);
@@ -356,13 +335,12 @@
   }
 
   FibEntry& entry = it->second;
-  NLSR_LOG_DEBUG("Refreshing " << entry.getName() << " Seq Num: " << entry.getSeqNo());
+  NLSR_LOG_DEBUG("Refreshing " << entry.name << " Seq Num: " << entry.seqNo);
 
-  // Increment sequence number
-  entry.setSeqNo(entry.getSeqNo() + 1);
+  entry.seqNo += 1;
 
-  for (const NextHop& hop : entry) {
-    registerPrefix(entry.getName(),
+  for (const NextHop& hop : entry.nexthopList) {
+    registerPrefix(entry.name,
                    ndn::FaceUri(hop.getConnectingFaceUri()),
                    hop.getRouteCostAsAdjustedInteger(),
                    ndn::time::seconds(m_refreshTime + GRACE_PERIOD),
@@ -377,7 +355,9 @@
 {
   NLSR_LOG_DEBUG("-------------------FIB-----------------------------");
   for (const auto& entry : m_table) {
-    entry.second.writeLog();
+    NLSR_LOG_DEBUG("Name Prefix: " << entry.second.name);
+    NLSR_LOG_DEBUG("Seq No: " <<  entry.second.seqNo);
+    NLSR_LOG_DEBUG(entry.second.nexthopList);
   }
 }
 
diff --git a/src/route/fib.hpp b/src/route/fib.hpp
index 27891eb..e8f8a40 100644
--- a/src/route/fib.hpp
+++ b/src/route/fib.hpp
@@ -22,19 +22,26 @@
 #ifndef NLSR_ROUTE_FIB_HPP
 #define NLSR_ROUTE_FIB_HPP
 
-#include "fib-entry.hpp"
 #include "test-access-control.hpp"
+#include "nexthop-list.hpp"
 
 #include <ndn-cxx/mgmt/nfd/controller.hpp>
+#include <ndn-cxx/util/scheduler.hpp>
 #include <ndn-cxx/util/time.hpp>
 
 namespace nlsr {
 
+struct FibEntry {
+  ndn::Name name;
+  ndn::scheduler::ScopedEventId refreshEventId;
+  int32_t seqNo = 1;
+  NexthopList nexthopList;
+};
+
 typedef std::function<void(FibEntry&)> afterRefreshCallback;
 
 class AdjacencyList;
 class ConfParameter;
-class FibEntry;
 
 /*! \brief Maps names to lists of next hops, and exports this information to NFD.
  *
@@ -203,16 +210,6 @@
   void
   scheduleLoop(FibEntry& entry);
 
-  /*! \brief Cancel an entry's refresh event.
-   *
-   * Cancel an entry's refresh event. This only needs to be done when
-   * an entry is removed. Typically this happens when NLSR is
-   * terminated or crashes, and we don't want the scheduler to crash
-   * because it's referencing memory that has no valid function.
-   */
-  void
-  cancelEntryRefresh(const FibEntry& entry);
-
   /*! \brief Refreshes an entry in NFD.
    */
   void
@@ -239,7 +236,7 @@
    * allow for things like stuttering prefix registrations and
    * processing time when refreshing events.
    */
-  static const uint64_t GRACE_PERIOD;
+  static constexpr uint64_t GRACE_PERIOD = 10;
 };
 
 } // namespace nlsr
