diff --git a/src/handles/base-handle.hpp b/src/handles/base-handle.hpp
index 3048856..9427356 100644
--- a/src/handles/base-handle.hpp
+++ b/src/handles/base-handle.hpp
@@ -74,13 +74,13 @@
   {
     return m_scheduler;
   }
-/*
-  inline RepoStorage&
-  getStoreIndex()
-  {
-    return m_storeindex;
-  }
-*/
+
+  // inline RepoStorage&
+  // getStoreIndex()
+  // {
+  //   return m_storeindex;
+  // }
+
   uint64_t
   generateProcessId();
 
diff --git a/src/handles/delete-handle.hpp b/src/handles/delete-handle.hpp
index 4b0ac85..91ff244 100644
--- a/src/handles/delete-handle.hpp
+++ b/src/handles/delete-handle.hpp
@@ -22,6 +22,7 @@
 
 #include "base-handle.hpp"
 #include <ndn-cxx/security/validator-config.hpp>
+
 namespace repo {
 
 using std::vector;
@@ -61,8 +62,8 @@
   onValidationFailed(const shared_ptr<const Interest>& interest, const string& reason);
 
   /**
-  * @todo delete check has not been realized due to the while loop of segmented data deletion.
-  */
+   * @todo delete check has not been realized due to the while loop of segmented data deletion.
+   */
   void
   onCheckInterest(const Name& prefix, const Interest& interest);
 
diff --git a/src/handles/write-handle.hpp b/src/handles/write-handle.hpp
index 6d42630..48bd0e4 100644
--- a/src/handles/write-handle.hpp
+++ b/src/handles/write-handle.hpp
@@ -21,9 +21,9 @@
 #define REPO_HANDLES_WRITE_HANDLE_HPP
 
 #include "base-handle.hpp"
-//#include <ndn-cxx/security/signature-sha256.hpp>
-#include <ndn-cxx/security/signature-sha256-with-rsa.hpp>
+
 #include <ndn-cxx/security/validator-config.hpp>
+
 #include <queue>
 
 namespace repo {
diff --git a/src/storage/index.cpp b/src/storage/index.cpp
index d2472fb..b141b51 100644
--- a/src/storage/index.cpp
+++ b/src/storage/index.cpp
@@ -100,7 +100,7 @@
     }
   else
     {
-      return std::pair<int64_t,Name>();
+      return std::make_pair(0, Name());
     }
 }
 
@@ -114,7 +114,7 @@
     }
   else
     {
-      return std::pair<int64_t,Name>();
+      return std::make_pair(0, Name());
     }
 }
 
@@ -138,7 +138,7 @@
     }
   else
     {
-      return std::pair<int64_t,Name>();
+      return std::make_pair(0, Name());
     }
 }
 
@@ -185,7 +185,7 @@
            it != m_skipList.end(); ++it)
         {
           if (!interest.getName().isPrefixOf(it->getName()))
-            return std::pair<int64_t,Name>();
+            return std::make_pair(0, Name());
           if (matchesSimpleSelectors(interest, hash, (*it)))
             return std::make_pair(it->getId(), it->getName());
         }
@@ -194,7 +194,7 @@
     {
       IndexSkipList::const_iterator boundary = m_skipList.lower_bound(interest.getName());
       if (boundary == m_skipList.end() || !interest.getName().isPrefixOf(boundary->getName()))
-        return std::pair<int64_t,Name>();
+        return std::make_pair(0, Name());
       Name successor = interest.getName().getSuccessor();
       IndexSkipList::const_iterator last = interest.getName().size() == 0 ?
                     m_skipList.end() : m_skipList.lower_bound(interest.getName().getSuccessor());
@@ -210,7 +210,7 @@
                   return std::make_pair(prev->getId(), prev->getName());
                 }
               else
-                return std::pair<int64_t,Name>();
+                return std::make_pair(0, Name());
             }
           IndexSkipList::const_iterator first =
             m_skipList.lower_bound(prev->getName().getPrefix(interest.getName().size() + 1));
@@ -223,7 +223,7 @@
           last = first;
         }
     }
-  return std::pair<int64_t,Name>();
+  return std::make_pair(0, Name());
 }
 
 Index::Entry::Entry(const Data& data, const int64_t id)
diff --git a/tests/dataset-fixtures.hpp b/tests/dataset-fixtures.hpp
index f306948..a957ee0 100644
--- a/tests/dataset-fixtures.hpp
+++ b/tests/dataset-fixtures.hpp
@@ -27,66 +27,74 @@
 namespace repo {
 namespace tests {
 
-static inline ndn::shared_ptr<ndn::Data>
-createData(const ndn::Name& name)
-{
-  static ndn::KeyChain keyChain;
-  static std::vector<uint8_t> content(1500, '-');
-
-  ndn::shared_ptr<ndn::Data> data = ndn::make_shared<ndn::Data>();
-  data->setName(name);
-  data->setContent(&content[0], content.size());
-  keyChain.sign(*data);
-
-  return data;
-}
-
 
 class DatasetBase
 {
 public:
+  class Error : public std::runtime_error
+  {
+  public:
+    explicit
+    Error(const std::string& what)
+      : std::runtime_error(what)
+    {
+    }
+  };
+
   typedef std::list<ndn::shared_ptr<ndn::Data> > DataContainer;
   DataContainer data;
 
   typedef std::list<std::pair<ndn::Interest, ndn::shared_ptr<ndn::Data> > > InterestContainer;
   InterestContainer interests;
 
-  typedef std::list<std::pair<ndn::Interest, int > > InterestIdContainer;
-  InterestIdContainer interestsSelectors, interestDeleteCount;
+  typedef std::list<std::pair<ndn::Interest, size_t > > RemovalsContainer;
+  RemovalsContainer removals;
 
-  typedef std::list<std::pair<int, ndn::shared_ptr<ndn::Data> > > IdContainer;
-  IdContainer ids, insert;
-
-  struct DataSetNameCompare
+protected:
+  ndn::shared_ptr<ndn::Data>
+  createData(const ndn::Name& name)
   {
-    bool operator()(const ndn::Name& a, const ndn::Name& b) const
-    {
-      return a < b;
-    }
-  };
+    if (map.count(name) > 0)
+      return map[name];
 
-  struct DataSetDataCompare
+    static ndn::KeyChain keyChain;
+    static std::vector<uint8_t> content(1500, '-');
+
+    ndn::shared_ptr<ndn::Data> data = ndn::make_shared<ndn::Data>();
+    data->setName(name);
+    data->setContent(&content[0], content.size());
+    keyChain.sign(*data);
+
+    map.insert(std::make_pair(name, data));
+    return data;
+  }
+
+  ndn::shared_ptr<ndn::Data>
+  getData(const ndn::Name& name)
   {
-    bool operator()(const Data& a, const Data& b) const
-    {
-      return a.getName() < b.getName();
-    }
-  };
+    if (map.count(name) > 0)
+      return map[name];
+    else
+      throw Error("Data with name " + name.toUri() + " is not found");
+  }
+
+private:
+  std::map<Name, shared_ptr<Data> > map;
 };
 
 
 template<size_t N>
-class BaseSmoketestFixture : public DatasetBase
+class SamePrefixDataset : public DatasetBase
 {
 public:
   static const std::string&
   getName()
   {
-    static std::string name = "BaseSmoketest";
+    static std::string name = "SamePrefixDataset";
     return name;
   }
 
-  BaseSmoketestFixture()
+  SamePrefixDataset()
   {
     ndn::Name baseName("/x/y/z/test/1");
     for (size_t i = 0; i < N; i++) {
@@ -96,54 +104,47 @@
       this->data.push_back(data);
 
       this->interests.push_back(std::make_pair(Interest(name), data));
-      this->ids.push_back(std::make_pair(i+1, data));
     }
   }
 };
 
 
-class BaseTestFixture : public DatasetBase
+class BasicDataset : public DatasetBase
 {
 public:
   static const std::string&
   getName()
   {
-    static std::string name = "BaseTest";
+    static std::string name = "BasicDataset";
     return name;
   }
 
-  BaseTestFixture()
+  BasicDataset()
   {
     this->data.push_back(createData("/a"));
-    this->interests.push_back(std::make_pair(Interest("/a"), this->data.back()));
-    this->ids.push_back(std::make_pair(1, this->data.back()));
-
     this->data.push_back(createData("/a/b"));
-    this->interests.push_back(std::make_pair(Interest("/a/b"), this->data.back()));
-    this->ids.push_back(std::make_pair(2, this->data.back()));
-
     this->data.push_back(createData("/a/b/c"));
-    this->interests.push_back(std::make_pair(Interest("/a/b/c"), this->data.back()));
-    this->ids.push_back(std::make_pair(3, this->data.back()));
-
     this->data.push_back(createData("/a/b/c/d"));
-    this->interests.push_back(std::make_pair(Interest("/a/b/c/d"), this->data.back()));
-    this->ids.push_back(std::make_pair(4, this->data.back()));
+
+    this->interests.push_back(std::make_pair(Interest("/a"),       getData("/a/b/c/d")));
+    this->interests.push_back(std::make_pair(Interest("/a/b"),     getData("/a/b/c/d")));
+    this->interests.push_back(std::make_pair(Interest("/a/b/c"),   getData("/a/b/c/d")));
+    this->interests.push_back(std::make_pair(Interest("/a/b/c/d"), getData("/a/b/c/d")));
   }
 };
 
 //Fetch by prefix is useless due to the database is fetched by id
-class FetchByPrefixTestFixture : public DatasetBase
+class FetchByPrefixDataset : public DatasetBase
 {
 public:
   static const std::string&
   getName()
   {
-    static std::string name = "FetchByPrefix";
+    static std::string name = "FetchByPrefixDataset";
     return name;
   }
 
-  FetchByPrefixTestFixture()
+  FetchByPrefixDataset()
   {
     this->data.push_back(createData("/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z"));
     this->interests.push_back(std::make_pair(Interest("/a"),
@@ -207,17 +208,17 @@
 };
 
 
-class SelectorTestFixture : public DatasetBase
+class BasicChildSelectorDataset : public DatasetBase
 {
 public:
   static const std::string&
   getName()
   {
-    static std::string name = "SelectorTest";
+    static std::string name = "BasicChildSelectorDataset";
     return name;
   }
 
-  SelectorTestFixture()
+  BasicChildSelectorDataset()
   {
     this->data.push_back(createData("/a/1"));
     this->data.push_back(createData("/b/1"));
@@ -239,111 +240,8 @@
   }
 };
 
-class IndexTestFixture : public DatasetBase
-{
-public:
-  static const std::string&
-  getName()
-  {
-    static std::string name = "IndexTest";
-    return name;
-  }
 
-  IndexTestFixture()
-  {
-    this->data.push_back(createData("/a/b/c"));
-    this->interests.push_back(std::make_pair(Interest("/a/b/c"), this->data.back()));
-    this->ids.push_back(std::make_pair(1, this->data.back()));
-    this->insert.push_back(std::make_pair(1, this->data.back()));
-
-    this->data.push_back(createData("/a/b/d/1"));
-    this->interests.push_back(std::make_pair(Interest("/a/b/d"), this->data.back()));
-    this->interests.push_back(std::make_pair(Interest("/a/b/d/1"), this->data.back()));
-    this->ids.push_back(std::make_pair(2, this->data.back()));
-    this->ids.push_back(std::make_pair(2, this->data.back()));
-    this->insert.push_back(std::make_pair(2, this->data.back()));
-
-    this->data.push_back(createData("/a/b/d/2"));
-    this->interests.push_back(std::make_pair(Interest("/a/b/d/2"), this->data.back()));
-    this->ids.push_back(std::make_pair(3, this->data.back()));
-    this->insert.push_back(std::make_pair(3, this->data.back()));
-
-    this->data.push_back(createData("/a/b/d/3"));
-    this->interests.push_back(std::make_pair(Interest("/a/b/d/3"), this->data.back()));
-    this->ids.push_back(std::make_pair(4, this->data.back()));
-    this->insert.push_back(std::make_pair(4, this->data.back()));
-
-    this->data.push_back(createData("/a/b/d/4/I"));
-    this->interests.push_back(std::make_pair(Interest("/a/b/d/4/I"), this->data.back()));
-    this->interests.push_back(std::make_pair(Interest("/a/b/d/4"), this->data.back()));
-    this->ids.push_back(std::make_pair(5, this->data.back()));
-    this->ids.push_back(std::make_pair(5, this->data.back()));
-    this->insert.push_back(std::make_pair(5, this->data.back()));
-
-    this->data.push_back(createData("/a/b/d/4"));
-  //  this->ids.push_back(std::make_pair(7, this->data.back()));
-    this->insert.push_back(std::make_pair(6, this->data.back()));
-
-    this->data.push_back(createData("/a/b/d"));
-  //  this->ids.push_back(std::make_pair(8, this->data.back()));
-    this->insert.push_back(std::make_pair(7, this->data.back()));
-
-    this->data.push_back(createData("/a/b/e/1"));
-    this->interests.push_back(std::make_pair(Interest("/a/b/e"), this->data.back()));
-    this->interests.push_back(std::make_pair(Interest("/a/b/e/1"), this->data.back()));
-    this->ids.push_back(std::make_pair(8, this->data.back()));
-    this->ids.push_back(std::make_pair(8, this->data.back()));
-    this->insert.push_back(std::make_pair(8, this->data.back()));
-
-    Selectors selector_keylocator;
-    ndn::SignatureSha256WithRsa rsaSignature(this->data.back()->getSignature());
-
-    this->data.push_back(createData("/a/b/e"));
-    this->ids.push_back(std::make_pair(9, this->data.back()));
-    this->insert.push_back(std::make_pair(9, this->data.back()));
-
-    Selectors selector;
-    selector.setMinSuffixComponents(3);
-    this->interestsSelectors.push_back(std::make_pair(Interest("/a/b/d").setSelectors(selector),
-                                                       5));
-
-    selector.setMinSuffixComponents(-1);
-    selector.setChildSelector(0);
-    this->interestsSelectors.push_back(std::make_pair(Interest("/a/b/d").setSelectors(selector),
-                                                       2));
-
-    selector.setMinSuffixComponents(2);
-    this->interestsSelectors.push_back(std::make_pair(Interest("/a/b/d").setSelectors(selector),
-                                                       2));
-
-    selector.setChildSelector(1);
-    this->interestsSelectors.push_back(std::make_pair(Interest("/a/b/d").setSelectors(selector),
-                                                       6));
-
-    selector.setChildSelector(-1);
-    selector.setMaxSuffixComponents(2);
-    this->interestsSelectors.push_back(std::make_pair(Interest("/a/b").setSelectors(selector),
-                                                       1));
-
-    ndn::name::Component from("3");
-    ndn::name::Component to("4");
-    Exclude exclude;
-    exclude.excludeRange(from, to);
-    selector.setChildSelector(1);
-    selector.setExclude(exclude);
-    this->interestsSelectors.push_back(std::make_pair(Interest("/a/b/d").setSelectors(selector),
-                                                       3));
-
-
-    KeyLocator keylocate = rsaSignature.getKeyLocator();
-    // std::cout<<"keylocator from data = "<<keylocate.wireEncode()<<std::endl;
-    selector_keylocator.setPublisherPublicKeyLocator(keylocate);
-    this->interestsSelectors.push_back(std::make_pair
-                                        (Interest("/a/b/e").setSelectors(selector_keylocator), 9));
-  }
-};
-
-class ChildSelectorTestFixture : public DatasetBase
+class ExtendedChildSelectorDataset : public DatasetBase
 {
 public:
   static const std::string&
@@ -353,132 +251,142 @@
     return name;
   }
 
-  ChildSelectorTestFixture()
+  ExtendedChildSelectorDataset()
   {
     this->data.push_back(createData("/a/b/1"));
-    this->insert.push_back(std::make_pair(1, this->data.back()));
+
     this->data.push_back(createData("/a/c/1"));
-    this->insert.push_back(std::make_pair(2, this->data.back()));
+    this->interests.push_back(std::make_pair(Interest("/a")
+                                             .setSelectors(Selectors()
+                                                           .setChildSelector(1)),
+                                              this->data.back()));
 
     this->data.push_back(createData("/a/c/2"));
-    this->insert.push_back(std::make_pair(3, this->data.back()));
 
     this->data.push_back(createData("/b"));
-    this->insert.push_back(std::make_pair(4, this->data.back()));
-
-    Selectors selector;
-    selector.setChildSelector(1);
-    this->interestsSelectors.push_back(std::make_pair(Interest("/a").setSelectors(selector),
-                                                       2));
   }
 };
 
-class StorageFixture : public DatasetBase
+
+class ComplexSelectorsDataset : public DatasetBase
 {
 public:
-    static const std::string&
-    getName()
-    {
-        static std::string name = "storage";
-        return name;
-    }
+  static const std::string&
+  getName()
+  {
+    static std::string name = "ComplexSelectorsDataset";
+    return name;
+  }
 
-    StorageFixture()
-    {
-        this->data.push_back(createData("/a/b/c"));
-        this->interests.push_back(std::make_pair(Interest("/a/b/c"), this->data.back()));
-        this->ids.push_back(std::make_pair(1, this->data.back()));
-        this->insert.push_back(std::make_pair(1, this->data.back()));
+  std::map<std::string, shared_ptr<Data> > map;
 
-        this->data.push_back(createData("/a/b/d/1"));
-        this->interests.push_back(std::make_pair(Interest("/a/b/d/1"), this->data.back()));
-        this->ids.push_back(std::make_pair(2, this->data.back()));
-        this->insert.push_back(std::make_pair(2, this->data.back()));
+  void
+  addData(const std::string& name)
+  {
+  }
 
-        this->data.push_back(createData("/a/b/d/2"));
-        this->interests.push_back(std::make_pair(Interest("/a/b/d/2"), this->data.back()));
-        this->ids.push_back(std::make_pair(3, this->data.back()));
-        this->insert.push_back(std::make_pair(3, this->data.back()));
+  ComplexSelectorsDataset()
+  {
+    // Dataset
+    this->data.push_back(createData("/a/b/c"));
+    this->data.push_back(createData("/a/b/d/1"));
+    this->data.push_back(createData("/a/b/d/2"));
+    this->data.push_back(createData("/a/b/d/3"));
+    this->data.push_back(createData("/a/b/d/4/I"));
+    this->data.push_back(createData("/a/b/d/4"));
+    this->data.push_back(createData("/a/b/d"));
+    this->data.push_back(createData("/a/b/e/1"));
+    this->data.push_back(createData("/a/b/e"));
 
-        this->data.push_back(createData("/a/b/d/3"));
-        this->interests.push_back(std::make_pair(Interest("/a/b/d/3"), this->data.back()));
-        this->ids.push_back(std::make_pair(4, this->data.back()));
-        this->insert.push_back(std::make_pair(4, this->data.back()));
+    // Basic selects
+    this->interests.push_back(std::make_pair(Interest("/a/b/c"),     this->getData("/a/b/c")));
+    this->interests.push_back(std::make_pair(Interest("/a/b/d"),     this->getData("/a/b/d/1")));
+    this->interests.push_back(std::make_pair(Interest("/a/b/d/1"),   this->getData("/a/b/d/1")));
+    this->interests.push_back(std::make_pair(Interest("/a/b/d/2"),   this->getData("/a/b/d/2")));
+    this->interests.push_back(std::make_pair(Interest("/a/b/d/3"),   this->getData("/a/b/d/3")));
+    this->interests.push_back(std::make_pair(Interest("/a/b/d/4/I"), this->getData("/a/b/d/4/I")));
+    this->interests.push_back(std::make_pair(Interest("/a/b/d/4"),   this->getData("/a/b/d/4/I")));
+    this->interests.push_back(std::make_pair(Interest("/a/b/e"),     this->getData("/a/b/e/1")));
+    this->interests.push_back(std::make_pair(Interest("/a/b/e/1"),   this->getData("/a/b/e/1")));
 
-        this->data.push_back(createData("/a/b/d/4"));
-        this->ids.push_back(std::make_pair(5, this->data.back()));
-        this->interests.push_back(std::make_pair(Interest("/a/b/d/4"), this->data.back()));
-        this->insert.push_back(std::make_pair(5, this->data.back()));
+    // Complex selects
+    this->interests.push_back(std::make_pair(Interest("/a/b")
+                                             .setSelectors(Selectors()
+                                                           .setMinSuffixComponents(2)
+                                                           .setMaxSuffixComponents(2)),
+                                             this->getData("/a/b/c")));
 
-        this->data.push_back(createData("/a/b/e/1"));
-        this->interests.push_back(std::make_pair(Interest("/a/b/e/1"), this->data.back()));
-        this->ids.push_back(std::make_pair(6, this->data.back()));
-        this->insert.push_back(std::make_pair(6, this->data.back()));
+    this->interests.push_back(std::make_pair(Interest("/a/b/d")
+                                             .setSelectors(Selectors()
+                                                           .setMinSuffixComponents(-1)
+                                                           .setChildSelector(0)),
+                                             this->getData("/a/b/d/1")));
 
-        Selectors selector_keylocator;
-        ndn::SignatureSha256WithRsa rsaSignature(this->data.back()->getSignature());
+    this->interests.push_back(std::make_pair(Interest("/a/b/d")
+                                             .setSelectors(Selectors()
+                                                           .setMinSuffixComponents(2)
+                                                           .setChildSelector(0)),
+                                             this->getData("/a/b/d/1")));
 
-        this->data.push_back(createData("/a/b/e/2"));
-        this->ids.push_back(std::make_pair(7, this->data.back()));
-        this->interests.push_back(std::make_pair(Interest("/a/b/e/2"), this->data.back()));
-        this->insert.push_back(std::make_pair(7, this->data.back()));
-
-        Selectors selector;
-        selector.setChildSelector(0);
-        this->interestsSelectors.push_back(std::make_pair
-                                           (Interest("/a/b/d").setSelectors(selector), 2));
-        this->interestDeleteCount.push_back(std::make_pair
-                                             (Interest("/a/b/d").setSelectors(selector), 4));
+    this->interests.push_back(std::make_pair(
+      Interest("/a/b/d")
+      .setSelectors(Selectors()
+                    .setChildSelector(1)
+                    .setMaxSuffixComponents(2)
+                    .setMinSuffixComponents(2)
+                    .setExclude(Exclude()
+                                .excludeRange(ndn::name::Component("3"),
+                                              ndn::name::Component("4")))),
+      this->getData("/a/b/d/2")));
 
 
-        selector.setChildSelector(1);
-        this->interestsSelectors.push_back(std::make_pair
-                                           (Interest("/a/b/d").setSelectors(selector), 5));
-        this->interestDeleteCount.push_back(std::make_pair
-                                             (Interest("/a/b/d").setSelectors(selector), 0));
+    this->interests.push_back(std::make_pair(Interest("/a/b/d")
+                                               .setSelectors(Selectors().setMinSuffixComponents(3)),
+                                             this->getData("/a/b/d/4/I")));
 
-        selector.setChildSelector(-1);
-        selector.setMaxSuffixComponents(2);
-        this->interestsSelectors.push_back(std::make_pair
-                                           (Interest("/a/b").setSelectors(selector), 1));
-        this->interestDeleteCount.push_back(std::make_pair
-                                             (Interest("/a/b").setSelectors(selector), 1));
+    // According to selector definition, RightMost for the next level and LeftMost for the next-next level
+    this->interests.push_back(std::make_pair(Interest("/a/b/d")
+                                             .setSelectors(Selectors()
+                                                           .setMinSuffixComponents(2)
+                                                           .setChildSelector(1)),
+                                             this->getData("/a/b/d/4/I")));
 
-        ndn::name::Component from("3");
-        ndn::name::Component to("4");
-        Exclude exclude;
-        exclude.excludeRange(from, to);
-        selector.setChildSelector(1);
-        selector.setExclude(exclude);
-        this->interestsSelectors.push_back(std::make_pair
-                                           (Interest("/a/b/d").setSelectors(selector), 3));
-        this->interestDeleteCount.push_back(std::make_pair
-                                             (Interest("/a/b/d").setSelectors(selector), 0));
+    // because of the digest component, /a/b/d will be to the right of /a/b/d/4
+    this->interests.push_back(std::make_pair(Interest("/a/b/d")
+                                             .setSelectors(Selectors()
+                                                           .setChildSelector(1)),
+                                             this->getData("/a/b/d")));
 
+    // Alex: this interest doesn't make sense, as all Data packets will have the same selector
+    this->interests.push_back(std::make_pair(Interest("/a/b/e")
+                                             .setSelectors(Selectors()
+                                                           .setPublisherPublicKeyLocator(
+                                                             this->data.back()
+                                                               ->getSignature().getKeyLocator())),
+                                             this->getData("/a/b/e/1")));
 
-        KeyLocator keylocate = rsaSignature.getKeyLocator();
-        selector_keylocator.setPublisherPublicKeyLocator(keylocate);
-        this->interestsSelectors.push_back(std::make_pair
-                                           (Interest("/a/b/e").setSelectors(selector_keylocator),
-                                            6));
-        this->interestDeleteCount
-                .push_back(std::make_pair(Interest("/a/b/e")
-                                            .setSelectors(selector_keylocator), 2));
+    // Removals
+    this->removals.push_back(std::make_pair(Interest("/a/b/d/2"), 1));
 
-    }
+    this->removals.push_back(std::make_pair(
+      Interest("/a/b/d")
+      .setSelectors(Selectors()
+                    .setMaxSuffixComponents(2)
+                    .setMinSuffixComponents(2)
+                    .setExclude(Exclude()
+                                .excludeOne(ndn::name::Component("3")))),
+      2));
+  }
 };
 
-typedef boost::mpl::vector< BaseTestFixture,
-                            FetchByPrefixTestFixture,
-                            SelectorTestFixture,
-                            BaseSmoketestFixture<10> > DatasetFixtures;
 
-typedef boost::mpl::vector< BaseTestFixture,
-                            BaseSmoketestFixture<10> > DatasetFixtures_Sqlite;
+typedef boost::mpl::vector< BasicDataset,
+                            FetchByPrefixDataset,
+                            BasicChildSelectorDataset,
+                            ExtendedChildSelectorDataset,
+                            SamePrefixDataset<10>,
+                            SamePrefixDataset<100> > CommonDatasets;
 
-typedef boost::mpl::vector<IndexTestFixture> DatasetFixtures_Index;
-typedef boost::mpl::vector<StorageFixture> DatasetFixtures_Storage;
-typedef boost::mpl::vector<ChildSelectorTestFixture> DatasetFixtures_Selector;
 
 } // namespace tests
 } // namespace repo
diff --git a/tests/integrated/test-basic-command-insert-delete.cpp b/tests/integrated/test-basic-command-insert-delete.cpp
index 5fc669e..10775f7 100644
--- a/tests/integrated/test-basic-command-insert-delete.cpp
+++ b/tests/integrated/test-basic-command-insert-delete.cpp
@@ -303,7 +303,13 @@
   }
 }
 
-BOOST_FIXTURE_TEST_CASE_TEMPLATE(InsertDelete, T, DatasetFixtures, Fixture<T>)
+typedef boost::mpl::vector< BasicDataset,
+                            FetchByPrefixDataset,
+                            BasicChildSelectorDataset,
+                            ExtendedChildSelectorDataset,
+                            SamePrefixDataset<10> > Datasets;
+
+BOOST_FIXTURE_TEST_CASE_TEMPLATE(InsertDelete, T, Datasets, Fixture<T>)
 {
   this->generateDefaultCertificateFile();
   this->validator.load("tests/integrated/insert-delete-validator-config.conf");
diff --git a/tests/integrated/test-basic-interest-read.cpp b/tests/integrated/test-basic-interest-read.cpp
index c198871..d4eba2e 100644
--- a/tests/integrated/test-basic-interest-read.cpp
+++ b/tests/integrated/test-basic-interest-read.cpp
@@ -116,15 +116,21 @@
 };
 
 
-BOOST_FIXTURE_TEST_CASE_TEMPLATE(Read, T, DatasetFixtures, BasicInterestReadFixture<T>)
+typedef boost::mpl::vector< BasicDataset,
+                            FetchByPrefixDataset,
+                            BasicChildSelectorDataset,
+                            ExtendedChildSelectorDataset,
+                            SamePrefixDataset<10> > Datasets;
+
+BOOST_FIXTURE_TEST_CASE_TEMPLATE(Read, T, Datasets, BasicInterestReadFixture<T>)
 {
   // Insert dataset
- // for (typename T::DataContainer::iterator i = this->data.begin();
- //      i != this->data.end(); ++i) {
- //   BOOST_CHECK_EQUAL(this->handle.insertData(**i), true);
- // }
+  // for (typename T::DataContainer::iterator i = this->data.begin();
+  //      i != this->data.end(); ++i) {
+  //   BOOST_CHECK_EQUAL(this->handle.insertData(**i), true);
+  // }
 
-//  BOOST_CHECK_EQUAL(this->handle.size(), this->data.size());
+  // BOOST_CHECK_EQUAL(this->handle.size(), this->data.size());
 
   this->startListen();
   this->scheduler.scheduleEvent(ndn::time::seconds(0),
diff --git a/tests/unit/index.cpp b/tests/unit/index.cpp
index a7ea5e4..49af9fe 100644
--- a/tests/unit/index.cpp
+++ b/tests/unit/index.cpp
@@ -28,60 +28,7 @@
 namespace repo {
 namespace tests {
 
-BOOST_AUTO_TEST_SUITE(TestIndex)
-
-template<class Dataset>
-class Fixture : public Dataset
-{
-};
-
-BOOST_FIXTURE_TEST_CASE_TEMPLATE(IndexGeneralTest, T, DatasetFixtures_Storage, Fixture<T>)
-{
-   Index index(65535);
-   for (typename T::IdContainer::iterator i = this->insert.begin();
-        i != this->insert.end(); ++i)
-   {
-     BOOST_CHECK_EQUAL(index.insert(*i->second, i->first), true);
-   }
-   BOOST_CHECK_EQUAL(index.size(), 7);
-
-   typename T::IdContainer::iterator id = this->ids.begin();
-   for (typename T::InterestContainer::iterator i = this->interests.begin();
-        i != this->interests.end(); ++i)
-   {
-     vector<std::pair<int, ndn::Name> > id_names;
-     BOOST_CHECK_EQUAL(index.find(i->first.getName()).first, id->first);
-     BOOST_CHECK_EQUAL(index.hasData(*i->second), true);
-     ++id;
-   }
-
-   for (typename T::InterestIdContainer::iterator i = this->interestsSelectors.begin();
-        i != this->interestsSelectors.end(); ++i)
-   {
-
-     BOOST_CHECK_EQUAL(index.find(i->first).first, i->second);
-     ndn::Name name = index.find(i->first).second;
-     BOOST_CHECK_EQUAL(index.erase(name), true);
-   }
-   BOOST_CHECK_EQUAL(index.size(), 2);
-}
-
-
-BOOST_FIXTURE_TEST_CASE_TEMPLATE(IndexTestSelector, T, DatasetFixtures_Selector, Fixture<T>)
-{
-   Index index(65535);
-   for (typename T::IdContainer::iterator i = this->insert.begin();
-        i != this->insert.end(); ++i)
-     BOOST_CHECK_EQUAL(index.insert(*i->second, i->first), true);
-   for (typename T::InterestIdContainer::iterator i = this->interestsSelectors.begin();
-        i != this->interestsSelectors.end(); ++i)
-   {
-     BOOST_CHECK_EQUAL(index.find(i->first).first, i->second);
-   }
-
-
-}
-
+BOOST_AUTO_TEST_SUITE(Index)
 
 class FindFixture
 {
@@ -116,7 +63,7 @@
   }
 
 protected:
-  Index m_index;
+  repo::Index m_index;
   KeyChain m_keyChain;
   shared_ptr<Interest> m_interest;
 };
@@ -418,6 +365,64 @@
 
 BOOST_AUTO_TEST_SUITE_END() // Find
 
+
+template<class Dataset>
+class Fixture : public Dataset
+{
+public:
+  Fixture()
+    : index(65535)
+  {
+  }
+
+public:
+  std::map<int64_t, shared_ptr<Data> > idToDataMap;
+  repo::Index index;
+};
+
+// Combine CommonDatasets with ComplexSelectorDataset
+typedef boost::mpl::push_back<CommonDatasets,
+                              ComplexSelectorsDataset>::type Datasets;
+
+BOOST_FIXTURE_TEST_CASE_TEMPLATE(Bulk, T, Datasets, Fixture<T>)
+{
+  BOOST_TEST_MESSAGE(T::getName());
+
+  for (typename T::DataContainer::iterator i = this->data.begin();
+       i != this->data.end(); ++i)
+    {
+      int64_t id = std::abs(static_cast<int64_t>(ndn::random::generateWord64()));
+      this->idToDataMap.insert(std::make_pair(id, *i));
+
+      BOOST_CHECK_EQUAL(this->index.insert(**i, id), true);
+    }
+
+  BOOST_CHECK_EQUAL(this->index.size(), this->data.size());
+
+  for (typename T::InterestContainer::iterator i = this->interests.begin();
+       i != this->interests.end(); ++i)
+    {
+      std::pair<int64_t, Name> item = this->index.find(i->first);
+
+      BOOST_REQUIRE_GT(item.first, 0);
+      BOOST_REQUIRE(this->idToDataMap.count(item.first) > 0);
+
+      BOOST_TEST_MESSAGE(i->first);
+      BOOST_CHECK_EQUAL(*this->idToDataMap[item.first], *i->second);
+
+      BOOST_CHECK_EQUAL(this->index.hasData(*i->second), true);
+    }
+
+  // Need support for selector-based removal
+  // for (typename T::RemovalsContainer::iterator i = this->removals.begin();
+  //      i != this->removals.end(); ++i)
+  //   {
+  //     size_t nRemoved = 0;
+  //     BOOST_REQUIRE_NO_THROW(this->index.erase(*i));
+  //     BOOST_CHECK_EQUAL(nRemoved, i->seconds);
+  //   }
+}
+
 BOOST_AUTO_TEST_SUITE_END()
 
 } // namespace tests
diff --git a/tests/unit/repo-storage.cpp b/tests/unit/repo-storage.cpp
index 41f9930..5058f08 100644
--- a/tests/unit/repo-storage.cpp
+++ b/tests/unit/repo-storage.cpp
@@ -30,67 +30,47 @@
 namespace tests {
 
 BOOST_AUTO_TEST_SUITE(RepoStorage)
+
 template<class Dataset>
 class Fixture : public Dataset, public RepoStorageFixture
 {
 };
 
-BOOST_FIXTURE_TEST_CASE_TEMPLATE(NdnNameSkipList, T, DatasetFixtures_Storage, Fixture<T>)
+// Combine CommonDatasets with ComplexSelectorDataset
+typedef boost::mpl::push_back<CommonDatasets,
+                              ComplexSelectorsDataset>::type Datasets;
+
+
+BOOST_FIXTURE_TEST_CASE_TEMPLATE(Bulk, T, Datasets, Fixture<T>)
 {
-  //Insert
+  BOOST_TEST_MESSAGE(T::getName());
+
+  // Insert data into repo
   for (typename T::DataContainer::iterator i = this->data.begin();
-       i != this->data.end(); ++i) 
+       i != this->data.end(); ++i)
     {
       BOOST_CHECK_EQUAL(this->handle->insertData(**i), true);
     }
-  
-  //Read
+
+  // check size directly with the storage (repo doesn't have interface yet)
+  BOOST_CHECK_EQUAL(this->store->size(), this->data.size());
+
+  // Read
   for (typename T::InterestContainer::iterator i = this->interests.begin();
-       i != this->interests.end(); ++i) 
+       i != this->interests.end(); ++i)
   {
       shared_ptr<ndn::Data> dataTest = this->handle->readData(i->first);
       BOOST_CHECK_EQUAL(*this->handle->readData(i->first), *i->second);
-     // int rc = memcmp(dataTest->getContent().value(),
-      //                i->second->getContent().value(), sizeof(i->second->getContent().value()));
-      //BOOST_CHECK_EQUAL(rc, 0);
-      BOOST_CHECK_EQUAL(this->handle->deleteData(i->first.getName()), 1);
     }
- 
-  //Insert
-  for (typename T::DataContainer::iterator i = this->data.begin();
-       i != this->data.end(); ++i) 
+
+  // Remove items
+  for (typename T::RemovalsContainer::iterator i = this->removals.begin();
+       i != this->removals.end(); ++i)
     {
-      BOOST_CHECK_EQUAL(this->handle->insertData(**i), true);
+      size_t nRemoved = 0;
+      BOOST_REQUIRE_NO_THROW(nRemoved = this->handle->deleteData(i->first));
+      BOOST_CHECK_EQUAL(nRemoved, i->second);
     }
-
-  //Erase
-  for (typename T::InterestIdContainer::iterator i = this->interestDeleteCount.begin();
-       i != this->interestDeleteCount.end(); ++i)
-    {
-      BOOST_CHECK_EQUAL(this->handle->deleteData(i->first), i->second);
-    }
-}
-
-BOOST_FIXTURE_TEST_CASE_TEMPLATE(Index, T, DatasetFixtures_Storage, Fixture<T>)
-{
-
-  for (typename T::DataContainer::iterator i = this->data.begin();
-       i != this->data.end(); ++i)
-    {
-      BOOST_CHECK_EQUAL(this->handle->insertData(**i), true);
-    }
-  ndn::Interest interest("/a");
-  ndn::Interest interest1("/a/b/d/1");
-
-  BOOST_CHECK_EQUAL(this->handle->deleteData(interest), 7);
-
-
-  for (typename T::DataContainer::iterator i = this->data.begin();
-       i != this->data.end(); ++i)
-    {
-      BOOST_CHECK_EQUAL(this->handle->insertData(**i), true);
-    }
-  BOOST_CHECK_EQUAL(this->handle->deleteData(interest.getName()), 7);
 }
 
 BOOST_AUTO_TEST_SUITE_END()
diff --git a/tests/unit/skiplist.cpp b/tests/unit/skiplist.cpp
index 34083d6..5bbb0ff 100644
--- a/tests/unit/skiplist.cpp
+++ b/tests/unit/skiplist.cpp
@@ -36,27 +36,7 @@
 {
 };
 
-BOOST_FIXTURE_TEST_CASE_TEMPLATE(NdnNameSkipList, T, DatasetFixtures, Fixture<T>)
-{
-  repo::SkipList<ndn::Name, typename T::DataSetNameCompare> skipList;
-  //Insert
-  for (typename T::DataContainer::iterator i = this->data.begin();
-       i != this->data.end(); ++i) {
-    skipList.insert((*i)->getName());
-  }
-
-  //find and erase
-  for (typename T::DataContainer::iterator i = this->data.begin();
-       i != this->data.end(); ++i) {
-    typename repo::SkipList<ndn::Name, typename T::DataSetNameCompare>::iterator findIterator =
-      skipList.find((*i)->getName());
-    skipList.erase(findIterator);
-  }
-
-  //@todo test lower_bound
-}
-
-BOOST_AUTO_TEST_CASE(IntGtSkipList)
+BOOST_AUTO_TEST_CASE(Correctness)
 {
   typedef repo::SkipList<int, std::greater<int> > IntGtSkipList;
   IntGtSkipList sl;
@@ -153,6 +133,56 @@
   BOOST_CHECK(it3 == sl.end());
 }
 
+class Item : public ndn::Name
+{
+public:
+  explicit
+  Item(const ndn::Name& name = "")
+    : ndn::Name(name)
+    , randomValue(ndn::random::generateWord64())
+  {
+  }
+
+public:
+  uint64_t randomValue;
+};
+
+BOOST_FIXTURE_TEST_CASE_TEMPLATE(Bulk, T, CommonDatasets, Fixture<T>)
+{
+  BOOST_TEST_MESSAGE(T::getName());
+  typedef repo::SkipList<Item, std::less<Item> > SkipList;
+  SkipList skipList;
+
+  std::vector<Item> items;
+  std::set<ndn::Name> names;
+  for (typename T::DataContainer::iterator i = this->data.begin();
+       i != this->data.end(); ++i) {
+    std::pair<std::set<ndn::Name>::iterator, bool> ret = names.insert((*i)->getName());
+    if (ret.second) {
+      items.push_back(Item((*i)->getName()));
+    }
+  }
+
+  // Insert
+  for (std::vector<Item>::iterator i = items.begin(); i != items.end(); ++i) {
+    skipList.insert(*i);
+  }
+
+  BOOST_CHECK_EQUAL(items.size(), skipList.size());
+
+  // Randomize items
+  std::random_shuffle(items.begin(), items.end());
+
+  // Find items and check if the right item is found
+  for (std::vector<Item>::iterator i = items.begin(); i != items.end(); ++i) {
+    SkipList::iterator item = skipList.find(*i);
+    BOOST_CHECK(item != skipList.end());
+
+    BOOST_CHECK_EQUAL(static_cast<const Name&>(*item), static_cast<const Name&>(*i));
+    BOOST_CHECK_EQUAL(item->randomValue, i->randomValue);
+  }
+}
+
 BOOST_AUTO_TEST_SUITE_END()
 
 } // namespace tests
diff --git a/tests/unit/sqlite-handle.cpp b/tests/unit/sqlite-handle.cpp
index 17a4832..59c5977 100644
--- a/tests/unit/sqlite-handle.cpp
+++ b/tests/unit/sqlite-handle.cpp
@@ -32,42 +32,45 @@
 template<class Dataset>
 class Fixture : public SqliteFixture, public Dataset
 {
+public:
+  std::map<int64_t, shared_ptr<Data> > idToDataMap;
 };
 
-BOOST_FIXTURE_TEST_CASE_TEMPLATE(InsertReadDelete, T, DatasetFixtures_Sqlite, Fixture<T>)
+BOOST_FIXTURE_TEST_CASE_TEMPLATE(InsertReadDelete, T, CommonDatasets, Fixture<T>)
 {
   BOOST_TEST_MESSAGE(T::getName());
 
-  // Insert
-  for (typename T::IdContainer::iterator i = this->ids.begin();
-       i != this->ids.end(); ++i) {
-    BOOST_CHECK_EQUAL(this->handle->insert(*i->second), i->first);
-  }
+  std::vector<int64_t> ids;
 
+  // Insert
+  for (typename T::DataContainer::iterator i = this->data.begin();
+       i != this->data.end(); ++i)
+    {
+      int64_t id = -1;
+      BOOST_REQUIRE_NO_THROW(id = this->handle->insert(**i));
+
+      this->idToDataMap.insert(std::make_pair(id, *i));
+      ids.push_back(id);
+    }
   BOOST_CHECK_EQUAL(this->handle->size(), this->data.size());
 
+  std::random_shuffle(ids.begin(), ids.end());
+
   // Read (all items should exist)
-  for (typename T::IdContainer::iterator i = this->ids.begin();
-       i != this->ids.end(); ++i) {
-    shared_ptr<Data> retrievedData = this->handle->read(i->first);
-    BOOST_CHECK_EQUAL(*retrievedData, *i->second);
+  for (std::vector<int64_t>::iterator i = ids.begin(); i != ids.end(); ++i) {
+    shared_ptr<Data> retrievedData = this->handle->read(*i);
+
+    BOOST_REQUIRE(this->idToDataMap.count(*i) > 0);
+    BOOST_CHECK_EQUAL(*this->idToDataMap[*i], *retrievedData);
   }
+  BOOST_CHECK_EQUAL(this->handle->size(), this->data.size());
 
   // Delete
-  for (typename T::IdContainer::iterator i = this->ids.begin();
-       i != this->ids.end(); ++i) {
-      //std::cout<<"remove name = "<<i->second->getName()<<std::endl;
-    BOOST_CHECK_EQUAL(this->handle->erase(i->first), true);
+  for (std::vector<int64_t>::iterator i = ids.begin(); i != ids.end(); ++i) {
+    BOOST_CHECK_EQUAL(this->handle->erase(*i), true);
   }
 
-  /*
-  // Read (none of the items should exist)
-  for (typename T::InterestContainer::iterator i = this->interests.begin();
-       i != this->interests.end(); ++i) {
-    ndn::Data retrievedData;
-    BOOST_REQUIRE_EQUAL(this->handle->readData(i->first, retrievedData), false);
-  }*/
-
+  BOOST_CHECK_EQUAL(this->handle->size(), 0);
 }
 
 BOOST_AUTO_TEST_SUITE_END()
diff --git a/tests/unit/tcp-bulk-insert-handle.cpp b/tests/unit/tcp-bulk-insert-handle.cpp
index 67a541a..6d911f7 100644
--- a/tests/unit/tcp-bulk-insert-handle.cpp
+++ b/tests/unit/tcp-bulk-insert-handle.cpp
@@ -153,11 +153,9 @@
 };
 
 
-BOOST_FIXTURE_TEST_CASE_TEMPLATE(BulkInsertAndRead, T, DatasetFixtures_Storage,
-                                 TcpBulkInsertFixture<T>)
+BOOST_FIXTURE_TEST_CASE_TEMPLATE(BulkInsertAndRead, T, CommonDatasets, TcpBulkInsertFixture<T>)
 {
   BOOST_TEST_MESSAGE(T::getName());
-  // BOOST_CHECK_EQUAL(this->handle->size(), 1);
 
   // start bulk inserter
   this->bulkInserter.listen("localhost", "17376");
@@ -168,16 +166,10 @@
   // actually run the test
   this->ioService.run();
 
-//  BOOST_CHECK_EQUAL(this->handle->size(), this->data.size());
-
   // Read (all items should exist)
   for (typename T::InterestContainer::iterator i = this->interests.begin();
        i != this->interests.end(); ++i) {
       BOOST_CHECK_EQUAL(*this->handle->readData(i->first), *i->second);
-   // int rc = memcmp(retrievedData->getContent().value(),
-   //                 i->second->getContent().value(), sizeof(i->second->getContent().value()));
-    //BOOST_CHECK_EQUAL(rc, 0);
-
   }
 }
 
