diff --git a/daemon/table/strategy-choice-entry.cpp b/daemon/table/strategy-choice-entry.cpp
index b9e0b48..8a73c5d 100644
--- a/daemon/table/strategy-choice-entry.cpp
+++ b/daemon/table/strategy-choice-entry.cpp
@@ -32,7 +32,6 @@
 
 Entry::Entry(const Name& prefix)
   : m_prefix(prefix)
-  , m_strategyPtr(nullptr)
   , m_nameTreeEntry(nullptr)
 {
 }
@@ -46,21 +45,9 @@
 }
 
 void
-Entry::setStrategy(fw::Strategy& strategy)
-{
-  /// \todo #3868
-  /// Every entry should have its own Strategy instance in unique_ptr;
-  /// m_strategyPtr and this overload should be eliminated.
-
-  m_strategy.reset();
-  m_strategyPtr = &strategy;
-}
-
-void
 Entry::setStrategy(unique_ptr<fw::Strategy> strategy)
 {
   m_strategy = std::move(strategy);
-  m_strategyPtr = m_strategy.get();
 }
 
 } // namespace strategy_choice
diff --git a/daemon/table/strategy-choice-entry.hpp b/daemon/table/strategy-choice-entry.hpp
index c6a1326..e1f1eb3 100644
--- a/daemon/table/strategy-choice-entry.hpp
+++ b/daemon/table/strategy-choice-entry.hpp
@@ -67,21 +67,16 @@
   fw::Strategy&
   getStrategy() const
   {
-    BOOST_ASSERT(m_strategyPtr != nullptr);
-    return *m_strategyPtr;
+    BOOST_ASSERT(m_strategy != nullptr);
+    return *m_strategy;
   }
 
-  DEPRECATED(
-  void
-  setStrategy(fw::Strategy& strategy));
-
   void
   setStrategy(unique_ptr<fw::Strategy> strategy);
 
 private:
   Name m_prefix;
   unique_ptr<fw::Strategy> m_strategy;
-  fw::Strategy* m_strategyPtr;
 
   name_tree::Entry* m_nameTreeEntry;
   friend class name_tree::Entry;
diff --git a/daemon/table/strategy-choice.cpp b/daemon/table/strategy-choice.cpp
index b251a97..7e2f5bf 100644
--- a/daemon/table/strategy-choice.cpp
+++ b/daemon/table/strategy-choice.cpp
@@ -67,75 +67,20 @@
 }
 
 bool
-StrategyChoice::hasStrategy(const Name& strategyName, bool isExact) const
-{
-  if (isExact) {
-    return m_strategyInstances.count(strategyName) > 0;
-  }
-  else {
-    return Strategy::canCreate(strategyName) ||
-           this->getStrategy(strategyName) != nullptr;
-  }
-}
-
-std::pair<bool, Strategy*>
-StrategyChoice::install(unique_ptr<Strategy> strategy)
-{
-  /// \todo #3868
-  /// Strategy instance should always be created from Strategy::create;
-  /// m_strategyInstances, install, getStrategy, hasStrategy should be eliminated.
-
-  BOOST_ASSERT(strategy != nullptr);
-  Name strategyName = strategy->getInstanceName();
-  // copying Name, so that strategyName remains available even if strategy is deallocated
-
-  bool isInserted = false;
-  StrategyInstanceTable::iterator it;
-  std::tie(it, isInserted) = m_strategyInstances.emplace(strategyName, std::move(strategy));
-
-  if (!isInserted) {
-    NFD_LOG_ERROR("install(" << strategyName << ") duplicate strategyName");
-  }
-  return std::make_pair(isInserted, it->second.get());
-}
-
-Strategy*
-StrategyChoice::getStrategy(const Name& strategyName) const
-{
-  Strategy* candidate = nullptr;
-  for (auto it = m_strategyInstances.lower_bound(strategyName);
-       it != m_strategyInstances.end() && strategyName.isPrefixOf(it->first); ++it) {
-    switch (it->first.size() - strategyName.size()) {
-    case 0: // exact match
-      return it->second.get();
-    case 1: // unversioned strategyName matches versioned strategy
-      candidate = it->second.get();
-      break;
-    }
-  }
-  return candidate;
-}
-
-bool
 StrategyChoice::insert(const Name& prefix, const Name& strategyName)
 {
-  unique_ptr<Strategy> createdStrategy;
+  unique_ptr<Strategy> strategy;
   try {
-    createdStrategy = Strategy::create(strategyName, m_forwarder);
+    strategy = Strategy::create(strategyName, m_forwarder);
   }
   catch (const std::invalid_argument& e) {
     NFD_LOG_ERROR("insert(" << prefix << "," << strategyName << ") cannot create strategy: " << e.what());
     return false;
   }
 
-  Strategy* strategy = createdStrategy.get();
   if (strategy == nullptr) {
-    strategy = this->getStrategy(strategyName);
-    if (strategy == nullptr) {
-      NFD_LOG_ERROR("insert(" << prefix << "," << strategyName << ") strategy not registered or installed");
-      return false;
-    }
-    NFD_LOG_WARN("insert(" << prefix << "," << strategyName << ") using shared strategy instance");
+    NFD_LOG_ERROR("insert(" << prefix << "," << strategyName << ") strategy not registered");
+    return false;
   }
 
   name_tree::Entry& nte = m_nameTree.lookup(prefix);
@@ -160,12 +105,7 @@
   }
 
   this->changeStrategy(*entry, *oldStrategy, *strategy);
-  if (createdStrategy != nullptr) {
-    entry->setStrategy(std::move(createdStrategy));
-  }
-  else {
-    entry->setStrategy(*strategy);
-  }
+  entry->setStrategy(std::move(strategy));
   return true;
 }
 
diff --git a/daemon/table/strategy-choice.hpp b/daemon/table/strategy-choice.hpp
index 2c492cd..e007acf 100644
--- a/daemon/table/strategy-choice.hpp
+++ b/daemon/table/strategy-choice.hpp
@@ -67,27 +67,6 @@
   void
   setDefaultStrategy(const Name& strategyName);
 
-  /** \brief determines if a strategy is installed
-   *  \param strategyName name of the strategy
-   *  \param isExact true to require exact match, false to permit unversioned strategyName
-   *  \return true if strategy is installed
-   */
-  DEPRECATED(
-  bool
-  hasStrategy(const Name& strategyName, bool isExact = false) const);
-
-  // DEPRECATED macro does not work when this type appears inline on install function.
-  typedef std::pair<bool, fw::Strategy*> InstallResult;
-
-  /** \brief install a strategy
-   *  \return if installed, true, and a pointer to the strategy instance;
-   *          if not installed due to duplicate strategyName, false,
-   *          and a pointer to the existing strategy instance
-   */
-  DEPRECATED(
-  InstallResult
-  install(unique_ptr<fw::Strategy> strategy));
-
 public: // Strategy Choice table
   /** \brief set strategy of prefix to be strategyName
    *  \param prefix the name prefix for which \p strategyName should be used
@@ -160,12 +139,6 @@
   }
 
 private:
-  /** \brief get Strategy instance by strategyName
-   *  \param strategyName a versioned or unversioned strategyName
-   */
-  fw::Strategy*
-  getStrategy(const Name& strategyName) const;
-
   void
   changeStrategy(Entry& entry,
                  fw::Strategy& oldStrategy,
@@ -184,9 +157,6 @@
   Forwarder& m_forwarder;
   NameTree& m_nameTree;
   size_t m_nItems;
-
-  typedef std::map<Name, unique_ptr<fw::Strategy>> StrategyInstanceTable;
-  StrategyInstanceTable m_strategyInstances;
 };
 
 } // namespace strategy_choice
