diff --git a/tests/test-common.hpp b/tests/test-common.hpp
index 2a1e607..5c95a0c 100644
--- a/tests/test-common.hpp
+++ b/tests/test-common.hpp
@@ -19,34 +19,35 @@
  * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef NLSR_TEST_COMMON_HPP
-#define NLSR_TEST_COMMON_HPP
+#ifndef NLSR_TESTS_TEST_COMMON_HPP
+#define NLSR_TESTS_TEST_COMMON_HPP
 
-#include "common.hpp"
 #include "conf-parameter.hpp"
-#include "route/fib.hpp"
 
-#include "boost-test.hpp"
-#include "identity-management-fixture.hpp"
+#include "tests/boost-test.hpp"
 
-#include <boost/asio.hpp>
-
-#include <ndn-cxx/face.hpp>
-#include <ndn-cxx/security/key-chain.hpp>
+#include <ndn-cxx/data.hpp>
 #include <ndn-cxx/util/dummy-client-face.hpp>
-#include <ndn-cxx/util/scheduler.hpp>
-#include <ndn-cxx/util/time-unit-test-clock.hpp>
 
 namespace nlsr {
 namespace test {
 
+/**
+ * \brief Create a Data with a null (i.e., empty) signature
+ *
+ * If a "real" signature is desired, use KeyChainFixture and sign again with `m_keyChain`.
+ */
+std::shared_ptr<ndn::Data>
+makeData(const ndn::Name& name);
+
+/**
+ * \brief Add a null signature to \p data
+ */
 ndn::Data&
 signData(ndn::Data& data);
 
-void
-checkPrefixRegistered(const ndn::util::DummyClientFace& face, const ndn::Name& prefix);
-
-/** \brief add a fake signature to Data
+/**
+ * \brief Add a null signature to \p data
  */
 inline std::shared_ptr<ndn::Data>
 signData(std::shared_ptr<ndn::Data> data)
@@ -55,132 +56,18 @@
   return data;
 }
 
-class BaseFixture : public tests::IdentityManagementFixture
-{
-public:
-  BaseFixture()
-    : m_scheduler(m_ioService)
-  {
-  }
-
-protected:
-  boost::asio::io_service m_ioService;
-  ndn::Scheduler m_scheduler;
-};
-
-class UnitTestTimeFixture : public BaseFixture
-{
-protected:
-  UnitTestTimeFixture()
-    : steadyClock(std::make_shared<ndn::time::UnitTestSteadyClock>())
-    , systemClock(std::make_shared<ndn::time::UnitTestSystemClock>())
-  {
-    ndn::time::setCustomClocks(steadyClock, systemClock);
-  }
-
-  ~UnitTestTimeFixture()
-  {
-    ndn::time::setCustomClocks(nullptr, nullptr);
-  }
-
-  void
-  advanceClocks(const ndn::time::nanoseconds& tick, size_t nTicks = 1);
-
-protected:
-  std::shared_ptr<ndn::time::UnitTestSteadyClock> steadyClock;
-  std::shared_ptr<ndn::time::UnitTestSystemClock> systemClock;
-};
-
-class MockNfdMgmtFixture : public UnitTestTimeFixture
-{
-public:
-  MockNfdMgmtFixture();
-
-  virtual
-  ~MockNfdMgmtFixture() = default;
-
-  /** \brief send one WireEncodable in reply to StatusDataset request
-   *  \param prefix dataset prefix without version and segment
-   *  \param payload payload block
-   *  \note payload must fit in one Data
-   *  \pre Interest for dataset has been expressed, sendDataset has not been invoked
-   */
-  template<typename T>
-  void
-  sendDataset(const ndn::Name& prefix, const T& payload)
-  {
-    BOOST_CONCEPT_ASSERT((ndn::WireEncodable<T>));
-
-    this->sendDatasetReply(prefix, payload.wireEncode());
-  }
-
-  /** \brief send two WireEncodables in reply to StatusDataset request
-   *  \param prefix dataset prefix without version and segment
-   *  \param payload1 first vector item
-   *  \param payload2 second vector item
-   *  \note all payloads must fit in one Data
-   *  \pre Interest for dataset has been expressed, sendDataset has not been invoked
-   */
-  template<typename T1, typename T2>
-  void
-  sendDataset(const ndn::Name& prefix, const T1& payload1, const T2& payload2)
-  {
-    BOOST_CONCEPT_ASSERT((ndn::WireEncodable<T1>));
-    BOOST_CONCEPT_ASSERT((ndn::WireEncodable<T2>));
-
-    ndn::encoding::EncodingBuffer buffer;
-    payload2.wireEncode(buffer);
-    payload1.wireEncode(buffer);
-
-    this->sendDatasetReply(prefix, buffer);
-  }
-
-  /** \brief send a payload in reply to StatusDataset request
-   *  \param name dataset prefix without version and segment
-   *  \param contentArgs passed to Data::setContent
-   */
-  template<typename ...ContentArgs>
-  void
-  sendDatasetReply(ndn::Name name, ContentArgs&&... contentArgs)
-  {
-    name.appendVersion().appendSegment(0);
-
-    // These warnings assist in debugging when nfdc does not receive StatusDataset.
-    // They usually indicate a misspelled prefix or incorrect timing in the test case.
-    if (m_face.sentInterests.empty()) {
-      BOOST_WARN_MESSAGE(false, "no Interest expressed");
-    }
-    else {
-      BOOST_WARN_MESSAGE(m_face.sentInterests.back().getName().isPrefixOf(name),
-                         "last Interest " << m_face.sentInterests.back().getName() <<
-                         " cannot be satisfied by this Data " << name);
-    }
-
-    auto data = std::make_shared<ndn::Data>(name);
-    data->setFreshnessPeriod(1_s);
-    data->setFinalBlock(name[-1]);
-    data->setContent(std::forward<ContentArgs>(contentArgs)...);
-    this->signDatasetReply(*data);
-    m_face.receive(*data);
-  }
-
-  virtual void
-  signDatasetReply(ndn::Data& data);
-
-public:
-  ndn::util::DummyClientFace m_face;
-};
+void
+checkPrefixRegistered(const ndn::util::DummyClientFace& face, const ndn::Name& prefix);
 
 class DummyConfFileProcessor
 {
-  typedef std::function<void(ConfParameter&)> AfterConfProcessing;
-
 public:
   DummyConfFileProcessor(ConfParameter& conf,
                          SyncProtocol protocol = SYNC_PROTOCOL_PSYNC,
-                         int32_t hyperbolicState = HYPERBOLIC_STATE_OFF,
-                         ndn::Name networkName = "/ndn", ndn::Name siteName = "/site",
-                         ndn::Name routerName = "/%C1.Router/this-router")
+                         HyperbolicState hyperbolicState = HYPERBOLIC_STATE_OFF,
+                         const ndn::Name& networkName = "/ndn",
+                         const ndn::Name& siteName = "/site",
+                         const ndn::Name& routerName = "/%C1.Router/this-router")
   {
     conf.setNetwork(networkName);
     conf.setSiteName(siteName);
@@ -194,4 +81,4 @@
 } // namespace test
 } // namespace nlsr
 
-#endif // NLSR_TEST_COMMON_HPP
+#endif // NLSR_TESTS_TEST_COMMON_HPP
