diff --git a/PSync/common.hpp b/PSync/common.hpp
new file mode 100644
index 0000000..d72198d
--- /dev/null
+++ b/PSync/common.hpp
@@ -0,0 +1,66 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2014-2020,  The University of Memphis
+ *
+ * This file is part of PSync.
+ * See AUTHORS.md for complete list of PSync authors and contributors.
+ *
+ * PSync is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU Lesser General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * PSync 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License along with
+ * PSync, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef PSYNC_COMMON_HPP
+#define PSYNC_COMMON_HPP
+
+#include "PSync/detail/config.hpp"
+
+#include <ndn-cxx/name.hpp>
+
+#include <cstddef>
+#include <cstdint>
+#include <functional>
+#include <stdexcept>
+#include <vector>
+
+namespace psync {
+
+enum class CompressionScheme {
+  NONE,
+  ZLIB,
+  GZIP,
+  BZIP2,
+  LZMA,
+  ZSTD,
+#ifdef PSYNC_HAVE_ZLIB
+  DEFAULT = ZLIB
+#else
+  DEFAULT = NONE
+#endif
+};
+
+class CompressionError : public std::runtime_error
+{
+public:
+  using std::runtime_error::runtime_error;
+};
+
+struct MissingDataInfo
+{
+  ndn::Name prefix;
+  uint64_t lowSeq;
+  uint64_t highSeq;
+};
+
+using UpdateCallback = std::function<void(const std::vector<MissingDataInfo>&)>;
+
+} // namespace psync
+
+#endif // PSYNC_COMMON_HPP
diff --git a/PSync/consumer.cpp b/PSync/consumer.cpp
index 95e3f89..1b100cb 100644
--- a/PSync/consumer.cpp
+++ b/PSync/consumer.cpp
@@ -20,10 +20,8 @@
 #include "PSync/consumer.hpp"
 #include "PSync/detail/state.hpp"
 
-#include <ndn-cxx/util/logger.hpp>
 #include <ndn-cxx/security/validator-null.hpp>
-
-#include <boost/algorithm/string.hpp>
+#include <ndn-cxx/util/logger.hpp>
 
 namespace psync {
 
@@ -37,19 +35,19 @@
                    double false_positive = 0.001,
                    ndn::time::milliseconds helloInterestLifetime,
                    ndn::time::milliseconds syncInterestLifetime)
- : m_face(face)
- , m_scheduler(m_face.getIoService())
- , m_syncPrefix(syncPrefix)
- , m_helloInterestPrefix(ndn::Name(m_syncPrefix).append("hello"))
- , m_syncInterestPrefix(ndn::Name(m_syncPrefix).append("sync"))
- , m_syncDataContentType(ndn::tlv::ContentType_Blob)
- , m_onReceiveHelloData(onReceiveHelloData)
- , m_onUpdate(onUpdate)
- , m_bloomFilter(count, false_positive)
- , m_helloInterestLifetime(helloInterestLifetime)
- , m_syncInterestLifetime(syncInterestLifetime)
- , m_rng(ndn::random::getRandomNumberEngine())
- , m_rangeUniformRandom(100, 500)
+  : m_face(face)
+  , m_scheduler(m_face.getIoService())
+  , m_syncPrefix(syncPrefix)
+  , m_helloInterestPrefix(ndn::Name(m_syncPrefix).append("hello"))
+  , m_syncInterestPrefix(ndn::Name(m_syncPrefix).append("sync"))
+  , m_syncDataContentType(ndn::tlv::ContentType_Blob)
+  , m_onReceiveHelloData(onReceiveHelloData)
+  , m_onUpdate(onUpdate)
+  , m_bloomFilter(count, false_positive)
+  , m_helloInterestLifetime(helloInterestLifetime)
+  , m_syncInterestLifetime(syncInterestLifetime)
+  , m_rng(ndn::random::getRandomNumberEngine())
+  , m_rangeUniformRandom(100, 500)
 {
 }
 
@@ -65,7 +63,7 @@
   m_bloomFilter.insert(prefix.toUri());
 
   if (callSyncDataCb && seqNo != 0) {
-    m_onUpdate({MissingDataInfo(prefix, seqNo, seqNo)});
+    m_onUpdate({{prefix, seqNo, seqNo}});
   }
 
   return true;
@@ -134,8 +132,7 @@
 
   NDN_LOG_TRACE("m_iblt: " << std::hash<std::string>{}(m_iblt.toUri()));
 
-  State state{ndn::Block{bufferPtr}};
-
+  detail::State state{ndn::Block(bufferPtr)};
   std::vector<MissingDataInfo> updates;
   std::map<ndn::Name, uint64_t> availableSubscriptions;
 
@@ -148,7 +145,7 @@
     // m_prefixes (see addSubscription). So [] operator is safe to use.
     if (isSubscribed(prefix) && seq > m_prefixes[prefix]) {
       // In case we are behind on this prefix and consumer is subscribed to it
-      updates.emplace_back(prefix, m_prefixes[prefix] + 1, seq);
+      updates.push_back({prefix, m_prefixes[prefix] + 1, seq});
       m_prefixes[prefix] = seq;
     }
     availableSubscriptions.emplace(prefix, seq);
@@ -233,8 +230,7 @@
   // Extract IBF from sync data name which is the last component
   m_iblt = m_syncDataName.getSubName(m_syncDataName.size() - 1, 1);
 
-  State state{ndn::Block{bufferPtr}};
-
+  detail::State state{ndn::Block(bufferPtr)};
   std::vector<MissingDataInfo> updates;
 
   for (const auto& content : state) {
@@ -244,7 +240,7 @@
     if (m_prefixes.find(prefix) == m_prefixes.end() || seq > m_prefixes[prefix]) {
       // If this is just the next seq number then we had already informed the consumer about
       // the previous sequence number and hence seq low and seq high should be equal to current seq
-      updates.emplace_back(prefix, m_prefixes[prefix] + 1, seq);
+      updates.push_back({prefix, m_prefixes[prefix] + 1, seq});
       m_prefixes[prefix] = seq;
     }
     // Else updates will be empty and consumer will not be notified.
diff --git a/PSync/consumer.hpp b/PSync/consumer.hpp
index 5f80d8e..3a695cb 100644
--- a/PSync/consumer.hpp
+++ b/PSync/consumer.hpp
@@ -20,9 +20,9 @@
 #ifndef PSYNC_CONSUMER_HPP
 #define PSYNC_CONSUMER_HPP
 
+#include "PSync/common.hpp"
 #include "PSync/detail/access-specifiers.hpp"
 #include "PSync/detail/bloom-filter.hpp"
-#include "PSync/detail/util.hpp"
 
 #include <ndn-cxx/face.hpp>
 #include <ndn-cxx/util/random.hpp>
@@ -31,14 +31,12 @@
 #include <ndn-cxx/util/time.hpp>
 
 #include <map>
-#include <vector>
 
 namespace psync {
 
-using namespace ndn::literals::time_literals;
+using namespace ndn::time_literals;
 
-typedef std::function<void(const std::map<ndn::Name, uint64_t>&)> ReceiveHelloCallback;
-typedef std::function<void(const std::vector<MissingDataInfo>&)> UpdateCallback;
+using ReceiveHelloCallback = std::function<void(const std::map<ndn::Name, uint64_t>&)>;
 
 const ndn::time::milliseconds HELLO_INTEREST_LIFETIME = 1_s;
 const ndn::time::milliseconds SYNC_INTEREST_LIFETIME = 1_s;
@@ -190,7 +188,7 @@
   UpdateCallback m_onUpdate;
 
   // Bloom filter is used to store application/user's subscription list.
-  BloomFilter m_bloomFilter;
+  detail::BloomFilter m_bloomFilter;
 
   ndn::time::milliseconds m_helloInterestLifetime;
   ndn::time::milliseconds m_syncInterestLifetime;
diff --git a/PSync/detail/bloom-filter.cpp b/PSync/detail/bloom-filter.cpp
index 89447c0..56c70b9 100644
--- a/PSync/detail/bloom-filter.cpp
+++ b/PSync/detail/bloom-filter.cpp
@@ -50,11 +50,11 @@
 
 #include <algorithm>
 #include <cmath>
-#include <cstddef>
 #include <cstdlib>
 #include <limits>
 
 namespace psync {
+namespace detail {
 
 // https://github.com/ArashPartow/bloom
 
@@ -376,4 +376,5 @@
   }
 }
 
+} // namespace detail
 } // namespace psync
diff --git a/PSync/detail/bloom-filter.hpp b/PSync/detail/bloom-filter.hpp
index ff0d213..e01828b 100644
--- a/PSync/detail/bloom-filter.hpp
+++ b/PSync/detail/bloom-filter.hpp
@@ -53,6 +53,7 @@
 #include <vector>
 
 namespace psync {
+namespace detail {
 
 class bloom_parameters;
 
@@ -141,6 +142,7 @@
   double                  desired_false_positive_probability_ = 0.0;
 };
 
+} // namespace detail
 } // namespace psync
 
 #endif // PSYNC_DETAIL_BLOOM_FILTER_HPP
diff --git a/PSync/detail/iblt.cpp b/PSync/detail/iblt.cpp
index dcc2931..28cae11 100644
--- a/PSync/detail/iblt.cpp
+++ b/PSync/detail/iblt.cpp
@@ -44,10 +44,12 @@
 */
 
 #include "PSync/detail/iblt.hpp"
+#include "PSync/detail/util.hpp"
 
 #include <ndn-cxx/util/exception.hpp>
 
 namespace psync {
+namespace detail {
 
 namespace be = boost::endian;
 
@@ -181,47 +183,6 @@
   return result;
 }
 
-bool
-operator==(const IBLT& iblt1, const IBLT& iblt2)
-{
-  auto iblt1HashTable = iblt1.getHashTable();
-  auto iblt2HashTable = iblt2.getHashTable();
-  if (iblt1HashTable.size() != iblt2HashTable.size()) {
-    return false;
-  }
-
-  size_t N = iblt1HashTable.size();
-
-  for (size_t i = 0; i < N; i++) {
-    if (iblt1HashTable[i].count != iblt2HashTable[i].count ||
-        iblt1HashTable[i].keySum != iblt2HashTable[i].keySum ||
-        iblt1HashTable[i].keyCheck != iblt2HashTable[i].keyCheck)
-      return false;
-  }
-
-  return true;
-}
-
-bool
-operator!=(const IBLT& iblt1, const IBLT& iblt2)
-{
-  return !(iblt1 == iblt2);
-}
-
-std::ostream&
-operator<<(std::ostream& out, const IBLT& iblt)
-{
-  out << "count keySum keyCheckMatch\n";
-  for (const auto& entry : iblt.getHashTable()) {
-    out << entry.count << " " << entry.keySum << " ";
-    out << ((murmurHash3(N_HASHCHECK, entry.keySum) == entry.keyCheck) ||
-           (entry.isEmpty())? "true" : "false");
-    out << "\n";
-  }
-
-  return out;
-}
-
 void
 IBLT::appendToName(ndn::Name& name) const
 {
@@ -256,7 +217,6 @@
   }
 
   size_t n = decompressedBuf->size() / 4;
-
   std::vector<uint32_t> values(n, 0);
 
   for (size_t i = 0; i < n; i++) {
@@ -268,4 +228,44 @@
   return values;
 }
 
+bool
+operator==(const IBLT& iblt1, const IBLT& iblt2)
+{
+  auto iblt1HashTable = iblt1.getHashTable();
+  auto iblt2HashTable = iblt2.getHashTable();
+  if (iblt1HashTable.size() != iblt2HashTable.size()) {
+    return false;
+  }
+
+  size_t N = iblt1HashTable.size();
+
+  for (size_t i = 0; i < N; i++) {
+    if (iblt1HashTable[i].count != iblt2HashTable[i].count ||
+        iblt1HashTable[i].keySum != iblt2HashTable[i].keySum ||
+        iblt1HashTable[i].keyCheck != iblt2HashTable[i].keyCheck)
+      return false;
+  }
+
+  return true;
+}
+
+bool
+operator!=(const IBLT& iblt1, const IBLT& iblt2)
+{
+  return !(iblt1 == iblt2);
+}
+
+std::ostream&
+operator<<(std::ostream& os, const IBLT& iblt)
+{
+  os << "count keySum keyCheckMatch\n";
+  for (const auto& entry : iblt.getHashTable()) {
+    os << entry.count << " " << entry.keySum << " "
+       << ((entry.isEmpty() || murmurHash3(N_HASHCHECK, entry.keySum) == entry.keyCheck) ? "true" : "false")
+       << "\n";
+  }
+  return os;
+}
+
+} // namespace detail
 } // namespace psync
diff --git a/PSync/detail/iblt.hpp b/PSync/detail/iblt.hpp
index 3b7ad88..b81809b 100644
--- a/PSync/detail/iblt.hpp
+++ b/PSync/detail/iblt.hpp
@@ -46,16 +46,15 @@
 #ifndef PSYNC_DETAIL_IBLT_HPP
 #define PSYNC_DETAIL_IBLT_HPP
 
-#include "PSync/detail/util.hpp"
+#include "PSync/common.hpp"
 
 #include <ndn-cxx/name.hpp>
 
-#include <inttypes.h>
 #include <set>
 #include <string>
-#include <vector>
 
 namespace psync {
+namespace detail {
 
 class HashTableEntry
 {
@@ -175,8 +174,9 @@
 operator!=(const IBLT& iblt1, const IBLT& iblt2);
 
 std::ostream&
-operator<<(std::ostream& out, const IBLT& iblt);
+operator<<(std::ostream& os, const IBLT& iblt);
 
+} // namespace detail
 } // namespace psync
 
 #endif // PSYNC_DETAIL_IBLT_HPP
diff --git a/PSync/detail/state.cpp b/PSync/detail/state.cpp
index beabda9..2f7f1b6 100644
--- a/PSync/detail/state.cpp
+++ b/PSync/detail/state.cpp
@@ -23,6 +23,7 @@
 #include <ndn-cxx/util/ostream-joiner.hpp>
 
 namespace psync {
+namespace detail {
 
 State::State(const ndn::Block& block)
 {
@@ -107,4 +108,5 @@
   return os;
 }
 
+} // namespace detail
 } // namespace psync
diff --git a/PSync/detail/state.hpp b/PSync/detail/state.hpp
index 38e6508..90f5ab3 100644
--- a/PSync/detail/state.hpp
+++ b/PSync/detail/state.hpp
@@ -23,7 +23,6 @@
 #include <ndn-cxx/name.hpp>
 
 namespace psync {
-
 namespace tlv {
 
 enum {
@@ -32,13 +31,16 @@
 
 } // namespace tlv
 
+namespace detail {
+
 class State
 {
 public:
-  explicit State(const ndn::Block& block);
-
   State() = default;
 
+  explicit
+  State(const ndn::Block& block);
+
   void
   addContent(const ndn::Name& prefix);
 
@@ -80,6 +82,7 @@
 std::ostream&
 operator<<(std::ostream& os, const State& State);
 
+} // namespace detail
 } // namespace psync
 
 #endif // PSYNC_DETAIL_STATE_HPP
diff --git a/PSync/detail/util.cpp b/PSync/detail/util.cpp
index c622ecd..a7fd947 100644
--- a/PSync/detail/util.cpp
+++ b/PSync/detail/util.cpp
@@ -18,8 +18,8 @@
  *
  * murmurHash3 was written by Austin Appleby, and is placed in the public
  * domain. The author hereby disclaims copyright to this source code.
- * https://github.com/aappleby/smhasher/blob/master/src/murmurHash3.cpp
- **/
+ * https://github.com/aappleby/smhasher/blob/master/src/MurmurHash3.cpp
+ */
 
 #include "PSync/detail/util.hpp"
 
@@ -27,6 +27,7 @@
 #include <ndn-cxx/util/backports.hpp>
 #include <ndn-cxx/util/exception.hpp>
 
+#include <boost/iostreams/copy.hpp>
 #include <boost/iostreams/device/array.hpp>
 #include <boost/iostreams/filtering_stream.hpp>
 #ifdef PSYNC_HAVE_ZLIB
@@ -44,32 +45,36 @@
 #ifdef PSYNC_HAVE_ZSTD
   #include <boost/iostreams/filter/zstd.hpp>
 #endif
-#include <boost/iostreams/copy.hpp>
 
 namespace psync {
+namespace detail {
 
 namespace bio = boost::iostreams;
 
-static uint32_t
-ROTL32 ( uint32_t x, int8_t r )
+static inline uint32_t
+ROTL32(uint32_t x, int8_t r)
 {
   return (x << r) | (x >> (32 - r));
 }
 
 uint32_t
-murmurHash3(uint32_t nHashSeed, const std::vector<unsigned char>& vDataToHash)
+murmurHash3(const void* key, size_t len, uint32_t seed)
 {
-  uint32_t h1 = nHashSeed;
+  const uint8_t * data = (const uint8_t*)key;
+  const int nblocks = len / 4;
+
+  uint32_t h1 = seed;
+
   const uint32_t c1 = 0xcc9e2d51;
   const uint32_t c2 = 0x1b873593;
 
-  const size_t nblocks = vDataToHash.size() / 4;
-
   //----------
   // body
-  const uint32_t * blocks = (const uint32_t *)(&vDataToHash[0] + nblocks*4);
 
-  for (size_t i = -nblocks; i; i++) {
+  const uint32_t * blocks = (const uint32_t *)(data + nblocks*4);
+
+  for (int i = -nblocks; i; i++)
+  {
     uint32_t k1 = blocks[i];
 
     k1 *= c1;
@@ -83,27 +88,25 @@
 
   //----------
   // tail
-  const uint8_t * tail = (const uint8_t*)(&vDataToHash[0] + nblocks*4);
+
+  const uint8_t * tail = (const uint8_t*)(data + nblocks*4);
 
   uint32_t k1 = 0;
 
-  switch (vDataToHash.size() & 3) {
-    case 3:
-      k1 ^= tail[2] << 16;
-      NDN_CXX_FALLTHROUGH;
-
-    case 2:
-      k1 ^= tail[1] << 8;
-      NDN_CXX_FALLTHROUGH;
-
-    case 1:
-      k1 ^= tail[0];
-      k1 *= c1; k1 = ROTL32(k1,15); k1 *= c2; h1 ^= k1;
+  switch (len & 3)
+  {
+    case 3: k1 ^= tail[2] << 16;
+            NDN_CXX_FALLTHROUGH;
+    case 2: k1 ^= tail[1] << 8;
+            NDN_CXX_FALLTHROUGH;
+    case 1: k1 ^= tail[0];
+            k1 *= c1; k1 = ROTL32(k1,15); k1 *= c2; h1 ^= k1;
   }
 
   //----------
   // finalization
-  h1 ^= vDataToHash.size();
+
+  h1 ^= len;
   h1 ^= h1 >> 16;
   h1 *= 0x85ebca6b;
   h1 ^= h1 >> 13;
@@ -113,65 +116,52 @@
   return h1;
 }
 
-uint32_t
-murmurHash3(uint32_t nHashSeed, const std::string& str)
-{
-  return murmurHash3(nHashSeed, std::vector<unsigned char>(str.begin(), str.end()));
-}
-
-uint32_t
-murmurHash3(uint32_t nHashSeed, uint32_t value)
-{
-  return murmurHash3(nHashSeed,
-                     std::vector<unsigned char>((unsigned char*)&value,
-                                                (unsigned char*)&value + sizeof(uint32_t)));
-}
-
 std::shared_ptr<ndn::Buffer>
 compress(CompressionScheme scheme, const uint8_t* buffer, size_t bufferSize)
 {
   ndn::OBufferStream out;
   bio::filtering_streambuf<bio::input> in;
+
   switch (scheme) {
     case CompressionScheme::ZLIB:
 #ifdef PSYNC_HAVE_ZLIB
       in.push(bio::zlib_compressor(bio::zlib::best_compression));
-#else
-      NDN_THROW(Error("ZLIB compression not supported!"));
-#endif
       break;
+#else
+      NDN_THROW(CompressionError("ZLIB compression not supported!"));
+#endif
 
     case CompressionScheme::GZIP:
 #ifdef PSYNC_HAVE_GZIP
       in.push(bio::gzip_compressor(bio::gzip::best_compression));
-#else
-      NDN_THROW(Error("GZIP compression not supported!"));
-#endif
       break;
+#else
+      NDN_THROW(CompressionError("GZIP compression not supported!"));
+#endif
 
     case CompressionScheme::BZIP2:
 #ifdef PSYNC_HAVE_BZIP2
       in.push(bio::bzip2_compressor());
-#else
-      NDN_THROW(Error("BZIP2 compression not supported!"));
-#endif
       break;
+#else
+      NDN_THROW(CompressionError("BZIP2 compression not supported!"));
+#endif
 
     case CompressionScheme::LZMA:
 #ifdef PSYNC_HAVE_LZMA
       in.push(bio::lzma_compressor(bio::lzma::best_compression));
-#else
-      NDN_THROW(Error("LZMA compression not supported!"));
-#endif
       break;
+#else
+      NDN_THROW(CompressionError("LZMA compression not supported!"));
+#endif
 
     case CompressionScheme::ZSTD:
 #ifdef PSYNC_HAVE_ZSTD
       in.push(bio::zstd_compressor(bio::zstd::best_compression));
-#else
-      NDN_THROW(Error("ZSTD compression not supported!"));
-#endif
       break;
+#else
+      NDN_THROW(CompressionError("ZSTD compression not supported!"));
+#endif
 
     case CompressionScheme::NONE:
       break;
@@ -187,46 +177,47 @@
 {
   ndn::OBufferStream out;
   bio::filtering_streambuf<bio::input> in;
+
   switch (scheme) {
     case CompressionScheme::ZLIB:
 #ifdef PSYNC_HAVE_ZLIB
       in.push(bio::zlib_decompressor());
-#else
-      NDN_THROW(Error("ZLIB decompression not supported!"));
-#endif
       break;
+#else
+      NDN_THROW(CompressionError("ZLIB decompression not supported!"));
+#endif
 
     case CompressionScheme::GZIP:
 #ifdef PSYNC_HAVE_GZIP
       in.push(bio::gzip_decompressor());
-#else
-      NDN_THROW(Error("GZIP compression not supported!"));
-#endif
       break;
+#else
+      NDN_THROW(CompressionError("GZIP compression not supported!"));
+#endif
 
     case CompressionScheme::BZIP2:
 #ifdef PSYNC_HAVE_BZIP2
       in.push(bio::bzip2_decompressor());
-#else
-      NDN_THROW(Error("BZIP2 compression not supported!"));
-#endif
       break;
+#else
+      NDN_THROW(CompressionError("BZIP2 compression not supported!"));
+#endif
 
     case CompressionScheme::LZMA:
 #ifdef PSYNC_HAVE_LZMA
       in.push(bio::lzma_decompressor());
-#else
-      NDN_THROW(Error("LZMA compression not supported!"));
-#endif
       break;
+#else
+      NDN_THROW(CompressionError("LZMA compression not supported!"));
+#endif
 
     case CompressionScheme::ZSTD:
 #ifdef PSYNC_HAVE_ZSTD
       in.push(bio::zstd_decompressor());
-#else
-      NDN_THROW(Error("ZSTD compression not supported!"));
-#endif
       break;
+#else
+      NDN_THROW(CompressionError("ZSTD compression not supported!"));
+#endif
 
     case CompressionScheme::NONE:
       break;
@@ -237,4 +228,5 @@
   return out.buf();
 }
 
+} // namespace detail
 } // namespace psync
diff --git a/PSync/detail/util.hpp b/PSync/detail/util.hpp
index 68b9ba8..e457832 100644
--- a/PSync/detail/util.hpp
+++ b/PSync/detail/util.hpp
@@ -15,60 +15,34 @@
  *
  * You should have received a copy of the GNU Lesser General Public License along with
  * PSync, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- *
- * murmurHash3 was written by Austin Appleby, and is placed in the public
- * domain. The author hereby disclaims copyright to this source code.
- * https://github.com/aappleby/smhasher/blob/master/src/murmurHash3.cpp
  */
 
 #ifndef PSYNC_DETAIL_UTIL_HPP
 #define PSYNC_DETAIL_UTIL_HPP
 
-#include "PSync/detail/config.hpp"
+#include "PSync/common.hpp"
 
-#include <ndn-cxx/name.hpp>
+#include <ndn-cxx/encoding/buffer.hpp>
 
-#include <inttypes.h>
-#include <vector>
 #include <string>
 
 namespace psync {
+namespace detail {
 
 uint32_t
-murmurHash3(uint32_t nHashSeed, const std::vector<unsigned char>& vDataToHash);
+murmurHash3(const void* key, size_t len, uint32_t seed);
 
-uint32_t
-murmurHash3(uint32_t nHashSeed, const std::string& str);
-
-uint32_t
-murmurHash3(uint32_t nHashSeed, uint32_t value);
-
-struct MissingDataInfo
+inline uint32_t
+murmurHash3(uint32_t seed, const std::string& str)
 {
-  MissingDataInfo(const ndn::Name& prefix, uint64_t lowSeq, uint64_t highSeq)
-    : prefix(prefix)
-    , lowSeq(lowSeq)
-    , highSeq(highSeq)
-  {}
+  return murmurHash3(str.data(), str.size(), seed);
+}
 
-  ndn::Name prefix;
-  uint64_t lowSeq;
-  uint64_t highSeq;
-};
-
-enum class CompressionScheme {
-  NONE,
-  ZLIB,
-  GZIP,
-  BZIP2,
-  LZMA,
-  ZSTD,
-#ifdef PSYNC_HAVE_ZLIB
-  DEFAULT = ZLIB
-#else
-  DEFAULT = NONE
-#endif
-};
+inline uint32_t
+murmurHash3(uint32_t seed, uint32_t value)
+{
+  return murmurHash3(&value, sizeof(value), seed);
+}
 
 std::shared_ptr<ndn::Buffer>
 compress(CompressionScheme scheme, const uint8_t* buffer, size_t bufferSize);
@@ -76,12 +50,7 @@
 std::shared_ptr<ndn::Buffer>
 decompress(CompressionScheme scheme, const uint8_t* buffer, size_t bufferSize);
 
-class Error : public std::runtime_error
-{
-public:
-  using std::runtime_error::runtime_error;
-};
-
+} // namespace detail
 } // namespace psync
 
 #endif // PSYNC_DETAIL_UTIL_HPP
diff --git a/PSync/full-producer.cpp b/PSync/full-producer.cpp
index 430d2ec..048bba3 100644
--- a/PSync/full-producer.cpp
+++ b/PSync/full-producer.cpp
@@ -18,14 +18,14 @@
  */
 
 #include "PSync/full-producer.hpp"
+#include "PSync/detail/state.hpp"
+#include "PSync/detail/util.hpp"
 
+#include <ndn-cxx/security/validator-null.hpp>
 #include <ndn-cxx/util/logger.hpp>
 #include <ndn-cxx/util/segment-fetcher.hpp>
-#include <ndn-cxx/security/validator-null.hpp>
 
 #include <cstring>
-#include <limits>
-#include <functional>
 
 namespace psync {
 
@@ -73,7 +73,7 @@
 
   uint64_t newSeq = seq.value_or(m_prefixes[prefix] + 1);
 
-  NDN_LOG_INFO("Publish: "<< prefix << "/" << newSeq);
+  NDN_LOG_INFO("Publish: " << prefix << "/" << newSeq);
 
   updateSeqNo(prefix, newSeq);
 
@@ -118,7 +118,7 @@
   });
 
   m_fetcher->onError.connect([this] (uint32_t errorCode, const std::string& msg) {
-    NDN_LOG_ERROR("Cannot fetch sync data, error: " << errorCode << " message: " << msg);
+    NDN_LOG_ERROR("Cannot fetch sync data, error: " << errorCode << ", message: " << msg);
     // We would like to recover from errors like NoRoute NACK quicker than sync Interest timeout.
     // We don't react to Interest timeout here as we have scheduled the next sync Interest
     // to be sent in half the sync Interest lifetime + jitter above. So we would react to
@@ -157,12 +157,12 @@
     return;
   }
 
-  ndn::name::Component ibltName = interestName.get(interestName.size()-1);
+  ndn::name::Component ibltName = interestName.get(interestName.size() - 1);
 
-  NDN_LOG_DEBUG("Full Sync Interest Received, nonce: " << interest.getNonce() <<
+  NDN_LOG_DEBUG("Full sync Interest received, nonce: " << interest.getNonce() <<
                 ", hash: " << std::hash<ndn::Name>{}(interestName));
 
-  IBLT iblt(m_expectedNumEntries, m_ibltCompression);
+  detail::IBLT iblt(m_expectedNumEntries, m_ibltCompression);
   try {
     iblt.initialize(ibltName);
   }
@@ -171,7 +171,7 @@
     return;
   }
 
-  IBLT diff = m_iblt - iblt;
+  auto diff = m_iblt - iblt;
 
   std::set<uint32_t> positive;
   std::set<uint32_t> negative;
@@ -185,7 +185,7 @@
     // Or send if we can't get neither positive nor negative differences
     if (positive.size() + negative.size() >= m_threshold ||
         (positive.size() == 0 && negative.size() == 0)) {
-      State state;
+      detail::State state;
       for (const auto& content : m_prefixes) {
         if (content.second != 0) {
           state.addContent(ndn::Name(content.first).appendNumber(content.second));
@@ -200,7 +200,7 @@
     }
   }
 
-  State state;
+  detail::State state;
   for (const auto& hash : positive) {
     auto nameIt = m_biMap.left.find(hash);
     if (nameIt != m_biMap.left.end()) {
@@ -219,10 +219,10 @@
     return;
   }
 
-  auto& entry = m_pendingEntries.emplace(interestName, PendingEntryInfoFull{iblt, {}}).first->second;
+  auto& entry = m_pendingEntries.emplace(interestName, PendingEntryInfo{iblt, {}}).first->second;
   entry.expirationEvent = m_scheduler.schedule(interest.getInterestLifetime(),
                           [this, interest] {
-                            NDN_LOG_TRACE("Erase Pending Interest " << interest.getNonce());
+                            NDN_LOG_TRACE("Erase pending Interest " << interest.getNonce());
                             m_pendingEntries.erase(interest.getName());
                           });
 }
@@ -238,7 +238,7 @@
   // TODO: Remove appending of hash - serves no purpose to the receiver
   ndn::Name dataName(ndn::Name(name).appendNumber(std::hash<ndn::Name>{}(nameWithIblt)));
 
-  auto content = compress(m_contentCompression, block.wire(), block.size());
+  auto content = detail::compress(m_contentCompression, block.wire(), block.size());
 
   // checking if our own interest got satisfied
   if (m_outstandingInterestName == name) {
@@ -250,7 +250,7 @@
       m_outstandingInterestName = ndn::Name("");
     }
 
-    NDN_LOG_DEBUG("Sending Sync Data");
+    NDN_LOG_DEBUG("Sending sync Data");
 
     // Send data after removing pending sync interest on face
     m_segmentPublisher.publish(name, dataName, content, m_syncReplyFreshness);
@@ -259,7 +259,7 @@
     sendSyncInterest();
   }
   else {
-    NDN_LOG_DEBUG("Sending Sync Data");
+    NDN_LOG_DEBUG("Sending sync Data");
     m_segmentPublisher.publish(name, dataName, content, m_syncReplyFreshness);
   }
 }
@@ -269,26 +269,26 @@
 {
   deletePendingInterests(interest.getName());
 
-  State state;
+  detail::State state;
   try {
-    auto decompressed = decompress(m_contentCompression, bufferPtr->data(), bufferPtr->size());
+    auto decompressed = detail::decompress(m_contentCompression, bufferPtr->data(), bufferPtr->size());
     state.wireDecode(ndn::Block(std::move(decompressed)));
   }
   catch (const std::exception& e) {
-    NDN_LOG_ERROR("Cannot parse received Sync Data: " << e.what());
+    NDN_LOG_ERROR("Cannot parse received sync Data: " << e.what());
     return;
   }
 
-  std::vector<MissingDataInfo> updates;
+  NDN_LOG_DEBUG("Sync Data received: " << state);
 
-  NDN_LOG_DEBUG("Sync Data Received: " << state);
+  std::vector<MissingDataInfo> updates;
 
   for (const auto& content : state) {
     ndn::Name prefix = content.getPrefix(-1);
     uint64_t seq = content.get(content.size() - 1).toNumber();
 
     if (m_prefixes.find(prefix) == m_prefixes.end() || m_prefixes[prefix] < seq) {
-      updates.push_back(MissingDataInfo{prefix, m_prefixes[prefix] + 1, seq});
+      updates.push_back({prefix, m_prefixes[prefix] + 1, seq});
       updateSeqNo(prefix, seq);
       // We should not call satisfyPendingSyncInterests here because we just
       // got data and deleted pending interest by calling deletePendingFullSyncInterests
@@ -315,8 +315,8 @@
   NDN_LOG_DEBUG("Satisfying full sync interest: " << m_pendingEntries.size());
 
   for (auto it = m_pendingEntries.begin(); it != m_pendingEntries.end();) {
-    const PendingEntryInfoFull& entry = it->second;
-    IBLT diff = m_iblt - entry.iblt;
+    const auto& entry = it->second;
+    auto diff = m_iblt - entry.iblt;
     std::set<uint32_t> positive;
     std::set<uint32_t> negative;
 
@@ -330,7 +330,7 @@
       }
     }
 
-    State state;
+    detail::State state;
     for (const auto& hash : positive) {
       auto nameIt = m_biMap.left.find(hash);
       if (nameIt != m_biMap.left.end()) {
@@ -354,15 +354,9 @@
 bool
 FullProducer::isFutureHash(const ndn::Name& prefix, const std::set<uint32_t>& negative)
 {
-  uint32_t nextHash = murmurHash3(N_HASHCHECK,
-                                  ndn::Name(prefix).appendNumber(m_prefixes[prefix] + 1).toUri());
-  for (const auto& nHash : negative) {
-    if (nHash == nextHash) {
-      return true;
-      break;
-    }
-  }
-  return false;
+  auto nextHash = detail::murmurHash3(detail::N_HASHCHECK,
+                                      ndn::Name(prefix).appendNumber(m_prefixes[prefix] + 1).toUri());
+  return negative.find(nextHash) != negative.end();
 }
 
 void
diff --git a/PSync/full-producer.hpp b/PSync/full-producer.hpp
index ffbdc77..d510d2d 100644
--- a/PSync/full-producer.hpp
+++ b/PSync/full-producer.hpp
@@ -21,31 +21,14 @@
 #define PSYNC_FULL_PRODUCER_HPP
 
 #include "PSync/producer-base.hpp"
-#include "PSync/detail/state.hpp"
 
-#include <map>
 #include <random>
 #include <set>
 
-#include <ndn-cxx/face.hpp>
-#include <ndn-cxx/security/key-chain.hpp>
-#include <ndn-cxx/util/scheduler.hpp>
 #include <ndn-cxx/util/segment-fetcher.hpp>
-#include <ndn-cxx/util/time.hpp>
 
 namespace psync {
 
-// Name has to be different than PendingEntryInfo
-// used in partial-producer otherwise get strange segmentation-faults
-// when partial producer is destructed
-struct PendingEntryInfoFull
-{
-  IBLT iblt;
-  ndn::scheduler::ScopedEventId expirationEvent;
-};
-
-typedef std::function<void(const std::vector<MissingDataInfo>&)> UpdateCallback;
-
 const ndn::time::milliseconds SYNC_INTEREST_LIFTIME = 1_s;
 
 /**
@@ -187,7 +170,13 @@
   isFutureHash(const ndn::Name& prefix, const std::set<uint32_t>& negative);
 
 private:
-  std::map<ndn::Name, PendingEntryInfoFull> m_pendingEntries;
+  struct PendingEntryInfo
+  {
+    detail::IBLT iblt;
+    ndn::scheduler::ScopedEventId expirationEvent;
+  };
+
+  std::map<ndn::Name, PendingEntryInfo> m_pendingEntries;
   ndn::time::milliseconds m_syncInterestLifetime;
   UpdateCallback m_onUpdate;
   ndn::scheduler::ScopedEventId m_scheduledSyncInterestId;
diff --git a/PSync/partial-producer.cpp b/PSync/partial-producer.cpp
index b3cd3ea..25e456a 100644
--- a/PSync/partial-producer.cpp
+++ b/PSync/partial-producer.cpp
@@ -82,10 +82,9 @@
 
   NDN_LOG_DEBUG("Hello Interest Received, nonce: " << interest);
 
-  State state;
-
-  for (const auto& prefix : m_prefixes) {
-    state.addContent(ndn::Name(prefix.first).appendNumber(prefix.second));
+  detail::State state;
+  for (const auto& p : m_prefixes) {
+    state.addContent(ndn::Name(p.first).appendNumber(p.second));
   }
   NDN_LOG_DEBUG("sending content p: " << state);
 
@@ -137,11 +136,10 @@
     return;
   }
 
-  BloomFilter bf;
-  IBLT iblt(m_expectedNumEntries, m_ibltCompression);
-
+  detail::BloomFilter bf;
+  detail::IBLT iblt(m_expectedNumEntries, m_ibltCompression);
   try {
-    bf = BloomFilter(projectedCount, falsePositiveProb, bfName);
+    bf = detail::BloomFilter(projectedCount, falsePositiveProb, bfName);
     iblt.initialize(ibltName);
   }
   catch (const std::exception& e) {
@@ -150,7 +148,7 @@
   }
 
   // get the difference
-  IBLT diff = m_iblt - iblt;
+  auto diff = m_iblt - iblt;
 
   // non-empty positive means we have some elements that the others don't
   std::set<uint32_t> positive;
@@ -169,7 +167,7 @@
   }
 
   // generate content for Sync reply
-  State state;
+  detail::State state;
   NDN_LOG_TRACE("Size of positive set " << positive.size());
   NDN_LOG_TRACE("Size of negative set " << negative.size());
   for (const auto& hash : positive) {
@@ -211,7 +209,7 @@
   for (auto it = m_pendingEntries.begin(); it != m_pendingEntries.end();) {
     const PendingEntryInfo& entry = it->second;
 
-    IBLT diff = m_iblt - entry.iblt;
+    auto diff = m_iblt - entry.iblt;
     std::set<uint32_t> positive;
     std::set<uint32_t> negative;
 
@@ -228,7 +226,7 @@
       continue;
     }
 
-    State state;
+    detail::State state;
     if (entry.bf.contains(prefix.toUri()) || positive.size() + negative.size() >= m_threshold) {
       if (entry.bf.contains(prefix.toUri())) {
         state.addContent(ndn::Name(prefix).appendNumber(m_prefixes[prefix]));
diff --git a/PSync/partial-producer.hpp b/PSync/partial-producer.hpp
index 64a5a21..8a60a28 100644
--- a/PSync/partial-producer.hpp
+++ b/PSync/partial-producer.hpp
@@ -32,13 +32,6 @@
 
 namespace psync {
 
-struct PendingEntryInfo
-{
-  BloomFilter bf;
-  IBLT iblt;
-  ndn::scheduler::ScopedEventId expirationEvent;
-};
-
 const ndn::time::milliseconds HELLO_REPLY_FRESHNESS = 1_s;
 
 /**
@@ -122,6 +115,13 @@
   onSyncInterest(const ndn::Name& prefix, const ndn::Interest& interest);
 
 PSYNC_PUBLIC_WITH_TESTS_ELSE_PRIVATE:
+  struct PendingEntryInfo
+  {
+    detail::BloomFilter bf;
+    detail::IBLT iblt;
+    ndn::scheduler::ScopedEventId expirationEvent;
+  };
+
   std::map<ndn::Name, PendingEntryInfo> m_pendingEntries;
   ndn::ScopedRegisteredPrefixHandle m_registeredPrefix;
   ndn::time::milliseconds m_helloReplyFreshness;
diff --git a/PSync/producer-base.cpp b/PSync/producer-base.cpp
index 4c2204d..bf8bc0e 100644
--- a/PSync/producer-base.cpp
+++ b/PSync/producer-base.cpp
@@ -18,14 +18,12 @@
  **/
 
 #include "PSync/producer-base.hpp"
+#include "PSync/detail/util.hpp"
 
 #include <ndn-cxx/util/exception.hpp>
 #include <ndn-cxx/util/logger.hpp>
 
-#include <boost/algorithm/string.hpp>
-
 #include <cstring>
-#include <functional>
 #include <limits>
 
 namespace psync {
@@ -118,7 +116,7 @@
   // Insert the new seq no in m_prefixes, m_biMap, and m_iblt
   it->second = seq;
   ndn::Name prefixWithSeq = ndn::Name(prefix).appendNumber(seq);
-  uint32_t newHash = murmurHash3(N_HASHCHECK, prefixWithSeq.toUri());
+  auto newHash = detail::murmurHash3(detail::N_HASHCHECK, prefixWithSeq.toUri());
   m_biMap.insert({newHash, prefixWithSeq});
   m_iblt.insert(newHash);
 }
diff --git a/PSync/producer-base.hpp b/PSync/producer-base.hpp
index 16e28d6..03eae63 100644
--- a/PSync/producer-base.hpp
+++ b/PSync/producer-base.hpp
@@ -20,20 +20,19 @@
 #ifndef PSYNC_PRODUCER_BASE_HPP
 #define PSYNC_PRODUCER_BASE_HPP
 
+#include "PSync/common.hpp"
 #include "PSync/detail/access-specifiers.hpp"
-#include "PSync/detail/bloom-filter.hpp"
 #include "PSync/detail/iblt.hpp"
-#include "PSync/detail/util.hpp"
 #include "PSync/segment-publisher.hpp"
 
 #include <ndn-cxx/face.hpp>
+#include <ndn-cxx/security/key-chain.hpp>
+#include <ndn-cxx/security/validator-config.hpp>
 #include <ndn-cxx/util/random.hpp>
 #include <ndn-cxx/util/scheduler.hpp>
 #include <ndn-cxx/util/time.hpp>
-#include <ndn-cxx/security/key-chain.hpp>
-#include <ndn-cxx/security/validator-config.hpp>
 
-#include <boost/bimap.hpp>
+#include <boost/bimap/bimap.hpp>
 #include <boost/bimap/unordered_set_of.hpp>
 
 #include <map>
@@ -52,6 +51,7 @@
  */
 class ProducerBase
 {
+public:
   class Error : public std::runtime_error
   {
   public:
@@ -155,11 +155,8 @@
   void
   onRegisterFailed(const ndn::Name& prefix, const std::string& msg) const;
 
-  using HashNameBiMap = bm::bimap<bm::unordered_set_of<uint32_t>,
-                                  bm::unordered_set_of<ndn::Name, std::hash<ndn::Name>>>;
-
 PSYNC_PUBLIC_WITH_TESTS_ELSE_PROTECTED:
-  IBLT m_iblt;
+  detail::IBLT m_iblt;
   uint32_t m_expectedNumEntries;
   // Threshold is used check if the differences are greater
   // than it and whether we need to update the other side.
@@ -167,6 +164,9 @@
 
   // prefix and sequence number
   std::map<ndn::Name, uint64_t> m_prefixes;
+
+  using HashNameBiMap = bm::bimap<bm::unordered_set_of<uint32_t>,
+                                  bm::unordered_set_of<ndn::Name, std::hash<ndn::Name>>>;
   HashNameBiMap m_biMap;
 
   ndn::Face& m_face;
diff --git a/PSync/segment-publisher.cpp b/PSync/segment-publisher.cpp
index 8ab5de3..1bdc981 100644
--- a/PSync/segment-publisher.cpp
+++ b/PSync/segment-publisher.cpp
@@ -42,7 +42,7 @@
 
 void
 SegmentPublisher::publish(const ndn::Name& interestName, const ndn::Name& dataName,
-                          const std::shared_ptr<const ndn::Buffer>& buffer,
+                          const ndn::ConstBufferPtr& buffer,
                           ndn::time::milliseconds freshness,
                           const ndn::security::SigningInfo& signingInfo)
 {
diff --git a/PSync/segment-publisher.hpp b/PSync/segment-publisher.hpp
index 7ef84c5..5817c24 100644
--- a/PSync/segment-publisher.hpp
+++ b/PSync/segment-publisher.hpp
@@ -31,17 +31,14 @@
 
 namespace psync {
 
-const int MAX_SEGMENTS_STORED = 100;
-
 /**
  * @brief Segment Publisher to publish segmented data
- *
  */
 class SegmentPublisher
 {
 public:
   SegmentPublisher(ndn::Face& face, ndn::KeyChain& keyChain,
-                   size_t imsLimit = MAX_SEGMENTS_STORED);
+                   size_t imsLimit = 100);
 
   /**
    * @brief Put all the segments in memory.
@@ -68,7 +65,7 @@
    */
   void
   publish(const ndn::Name& interestName, const ndn::Name& dataName,
-          const std::shared_ptr<const ndn::Buffer>& buffer, ndn::time::milliseconds freshness,
+          const ndn::ConstBufferPtr& buffer, ndn::time::milliseconds freshness,
           const ndn::security::SigningInfo& signingInfo = ndn::security::SigningInfo());
 
   /**
diff --git a/tests/test-bloom-filter.cpp b/tests/test-bloom-filter.cpp
index 1788cd1..a33c088 100644
--- a/tests/test-bloom-filter.cpp
+++ b/tests/test-bloom-filter.cpp
@@ -24,8 +24,7 @@
 #include <ndn-cxx/name.hpp>
 
 namespace psync {
-
-using namespace ndn;
+namespace detail {
 
 BOOST_AUTO_TEST_SUITE(TestBloomFilter)
 
@@ -40,7 +39,7 @@
 
 BOOST_AUTO_TEST_CASE(NameAppendAndExtract)
 {
-  Name bfName("/test");
+  ndn::Name bfName("/test");
   BloomFilter bf(100, 0.001);
   bf.insert("/memphis");
   bf.appendToName(bfName);
@@ -56,4 +55,5 @@
 
 BOOST_AUTO_TEST_SUITE_END()
 
+} // namespace detail
 } // namespace psync
diff --git a/tests/test-full-producer.cpp b/tests/test-full-producer.cpp
index 2693421..f2c4a13 100644
--- a/tests/test-full-producer.cpp
+++ b/tests/test-full-producer.cpp
@@ -18,11 +18,11 @@
  **/
 
 #include "PSync/full-producer.hpp"
+#include "PSync/detail/util.hpp"
 
 #include "tests/boost-test.hpp"
 #include "tests/io-fixture.hpp"
 
-#include <ndn-cxx/name.hpp>
 #include <ndn-cxx/mgmt/nfd/control-parameters.hpp>
 #include <ndn-cxx/util/dummy-client-face.hpp>
 
@@ -80,7 +80,7 @@
   BOOST_CHECK_NO_THROW(node.onSyncData(syncInterest, badCompress));
 
   const uint8_t test[] = {'t', 'e', 's', 't'};
-  auto goodCompressBadBlock = compress(node.m_contentCompression, &test[0], sizeof(test));
+  auto goodCompressBadBlock = detail::compress(node.m_contentCompression, test, sizeof(test));
   BOOST_CHECK_NO_THROW(node.onSyncData(syncInterest, goodCompressBadBlock));
 }
 
diff --git a/tests/test-full-sync.cpp b/tests/test-full-sync.cpp
index 0d2b0ee..8fd5100 100644
--- a/tests/test-full-sync.cpp
+++ b/tests/test-full-sync.cpp
@@ -20,11 +20,11 @@
 #include "PSync/full-producer.hpp"
 #include "PSync/consumer.hpp"
 #include "PSync/detail/state.hpp"
+#include "PSync/detail/util.hpp"
 
 #include "tests/boost-test.hpp"
 #include "tests/io-fixture.hpp"
 
-#include <ndn-cxx/name.hpp>
 #include <ndn-cxx/util/dummy-client-face.hpp>
 
 namespace psync {
@@ -390,7 +390,7 @@
   addNode(0);
 
   int i = 0;
-  State state;
+  detail::State state;
   std::shared_ptr<Buffer> compressed;
   do {
     Name prefixToPublish("userNode0-" + to_string(i++));
@@ -400,13 +400,13 @@
     state.addContent(Name(prefixToPublish).appendNumber(nodes[0]->m_prefixes[prefixToPublish]));
 
     auto block = state.wireEncode();
-    compressed = compress(nodes[0]->m_contentCompression, block.wire(), block.size());
+    compressed = detail::compress(nodes[0]->m_contentCompression, block.wire(), block.size());
   } while (compressed->size() < (MAX_NDN_PACKET_SIZE >> 1));
 
   advanceClocks(ndn::time::milliseconds(10), 100);
 
   Name syncInterestName(syncPrefix);
-  IBLT iblt(40, nodes[0]->m_ibltCompression);
+  detail::IBLT iblt(40, nodes[0]->m_ibltCompression);
   iblt.appendToName(syncInterestName);
 
   nodes[0]->onSyncInterest(syncPrefix, Interest(syncInterestName));
diff --git a/tests/test-iblt.cpp b/tests/test-iblt.cpp
index c689596..c015a19 100644
--- a/tests/test-iblt.cpp
+++ b/tests/test-iblt.cpp
@@ -22,9 +22,8 @@
 
 #include "tests/boost-test.hpp"
 
-#include <ndn-cxx/interest.hpp>
-
 namespace psync {
+namespace detail {
 
 using namespace ndn;
 
@@ -32,7 +31,7 @@
 
 BOOST_AUTO_TEST_CASE(Equal)
 {
-  int size = 10;
+  const size_t size = 10;
 
   IBLT iblt1(size, CompressionScheme::DEFAULT);
   IBLT iblt2(size, CompressionScheme::DEFAULT);
@@ -107,7 +106,7 @@
 
 BOOST_AUTO_TEST_CASE(CopyInsertErase)
 {
-  int size = 10;
+  const size_t size = 10;
 
   IBLT iblt1(size, CompressionScheme::DEFAULT);
 
@@ -136,7 +135,8 @@
 {
   // The case where we can't recognize if the rcvd IBF has higher sequence number
   // Relevant to full sync case
-  int size = 10;
+
+  const size_t size = 10;
 
   IBLT ownIBF(size, CompressionScheme::DEFAULT);
   IBLT rcvdIBF(size, CompressionScheme::DEFAULT);
@@ -160,10 +160,9 @@
 
 BOOST_AUTO_TEST_CASE(Difference)
 {
-  int size = 10;
+  const size_t size = 10;
 
   IBLT ownIBF(size, CompressionScheme::DEFAULT);
-
   IBLT rcvdIBF = ownIBF;
 
   IBLT diff = ownIBF - rcvdIBF;
@@ -200,7 +199,7 @@
   // Check that we can still list the difference
   // even though we can't list the IBFs itself
 
-  int size = 10;
+  const size_t size = 10;
 
   IBLT ownIBF(size, CompressionScheme::DEFAULT);
 
@@ -231,4 +230,5 @@
 
 BOOST_AUTO_TEST_SUITE_END()
 
+} // namespace detail
 } // namespace psync
diff --git a/tests/test-partial-producer.cpp b/tests/test-partial-producer.cpp
index 3f5de4c..bfbcc12 100644
--- a/tests/test-partial-producer.cpp
+++ b/tests/test-partial-producer.cpp
@@ -82,7 +82,7 @@
   syncInterestName.append("sync");
   Name syncInterestPrefix = syncInterestName;
 
-  BloomFilter bf(20, 0.001);
+  detail::BloomFilter bf(20, 0.001);
   bf.appendToName(syncInterestName);
 
   producer.m_iblt.appendToName(syncInterestName);
@@ -133,7 +133,7 @@
   // Sync interest with malicious IBF
   syncInterestName = syncPrefix;
   syncInterestName.append("sync");
-  BloomFilter bf(20, 0.001);
+  detail::BloomFilter bf(20, 0.001);
   bf.appendToName(syncInterestName);
   syncInterestName.append("fake-name");
   BOOST_CHECK_NO_THROW(producer.onSyncInterest(syncInterestName, Interest(syncInterestName)));
diff --git a/tests/test-producer-base.cpp b/tests/test-producer-base.cpp
index 4320e83..8e9dd77 100644
--- a/tests/test-producer-base.cpp
+++ b/tests/test-producer-base.cpp
@@ -18,7 +18,6 @@
  **/
 
 #include "PSync/producer-base.hpp"
-#include "PSync/detail/util.hpp"
 
 #include "tests/boost-test.hpp"
 
@@ -32,7 +31,7 @@
 
 BOOST_AUTO_TEST_SUITE(TestProducerBase)
 
-BOOST_AUTO_TEST_CASE(Ctor)
+BOOST_AUTO_TEST_CASE(Constructor)
 {
   util::DummyClientFace face;
   BOOST_REQUIRE_NO_THROW(ProducerBase(40, face, Name("/psync"), Name("/testUser")));
diff --git a/tests/test-segment-publisher.cpp b/tests/test-segment-publisher.cpp
index bf437b9..4874c49 100644
--- a/tests/test-segment-publisher.cpp
+++ b/tests/test-segment-publisher.cpp
@@ -25,9 +25,9 @@
 
 #include <ndn-cxx/data.hpp>
 #include <ndn-cxx/interest.hpp>
+#include <ndn-cxx/security/validator-null.hpp>
 #include <ndn-cxx/util/dummy-client-face.hpp>
 #include <ndn-cxx/util/segment-fetcher.hpp>
-#include <ndn-cxx/security/validator-null.hpp>
 
 namespace psync {
 
@@ -88,7 +88,7 @@
   shared_ptr<util::SegmentFetcher> fetcher;
   Name dataName;
   time::milliseconds freshness = 1_s;
-  State state;
+  detail::State state;
 
   int numComplete = 0;
   int numRepliesFromStore = 0;
diff --git a/tests/test-state.cpp b/tests/test-state.cpp
index 3f04c8b..0e31a67 100644
--- a/tests/test-state.cpp
+++ b/tests/test-state.cpp
@@ -24,8 +24,7 @@
 #include <ndn-cxx/data.hpp>
 
 namespace psync {
-
-using namespace ndn;
+namespace detail {
 
 BOOST_AUTO_TEST_SUITE(TestState)
 
@@ -36,17 +35,14 @@
   state.addContent(ndn::Name("test2"));
 
   // Simulate getting buffer content from segment fetcher
-  Data data;
+  ndn::Data data;
   data.setContent(state.wireEncode());
   ndn::Buffer buffer(data.getContent().value_size());
   std::copy(data.getContent().value_begin(),
             data.getContent().value_end(),
             buffer.begin());
 
-  ndn::ConstBufferPtr bufferPtr = make_shared<ndn::Buffer>(buffer);
-
-  ndn::Block block(std::move(bufferPtr));
-
+  ndn::Block block(std::make_shared<ndn::Buffer>(buffer));
   State rcvdState;
   rcvdState.wireDecode(block);
 
@@ -58,16 +54,14 @@
   State state;
 
   // Simulate getting buffer content from segment fetcher
-  Data data;
+  ndn::Data data;
   data.setContent(state.wireEncode());
   ndn::Buffer buffer(data.getContent().value_size());
   std::copy(data.getContent().value_begin(),
             data.getContent().value_end(),
             buffer.begin());
-  ndn::ConstBufferPtr bufferPtr = make_shared<ndn::Buffer>(buffer);
 
-  ndn::Block block(std::move(bufferPtr));
-
+  ndn::Block block(std::make_shared<ndn::Buffer>(buffer));
   BOOST_CHECK_NO_THROW(State state2(block));
 
   State state2(block);
@@ -90,4 +84,5 @@
 
 BOOST_AUTO_TEST_SUITE_END()
 
+} // namespace detail
 } // namespace psync
diff --git a/tests/test-util.cpp b/tests/test-util.cpp
index bea4e68..e37957a 100644
--- a/tests/test-util.cpp
+++ b/tests/test-util.cpp
@@ -22,10 +22,11 @@
 #include "tests/boost-test.hpp"
 
 namespace psync {
+namespace detail {
 
 BOOST_AUTO_TEST_SUITE(TestUtil)
 
-BOOST_AUTO_TEST_CASE(Basic)
+BOOST_AUTO_TEST_CASE(Compression)
 {
   std::vector<CompressionScheme> available = {CompressionScheme::ZLIB, CompressionScheme::GZIP,
                                               CompressionScheme::BZIP2, CompressionScheme::LZMA,
@@ -49,6 +50,9 @@
   supported.push_back(CompressionScheme::ZSTD);
 #endif
 
+  std::set_difference(available.begin(), available.end(), supported.begin(), supported.end(),
+                      std::inserter(notSupported, notSupported.begin()));
+
   const uint8_t uncompressed[] = {'t', 'e', 's', 't'};
 
   for (const auto& s : supported) {
@@ -57,17 +61,13 @@
     BOOST_CHECK_NO_THROW(decompress(s, compressed->data(), compressed->size()));
   }
 
-  std::set_difference(available.begin(), available.end(), supported.begin(), supported.end(),
-                      std::inserter(notSupported, notSupported.begin()));
-
   for (const auto& s : notSupported) {
-    BOOST_CHECK_THROW(compress(s, uncompressed, sizeof(uncompressed)),
-                      std::runtime_error);
-    BOOST_CHECK_THROW(decompress(s, uncompressed, sizeof(uncompressed)),
-                      std::runtime_error);
+    BOOST_CHECK_THROW(compress(s, uncompressed, sizeof(uncompressed)), CompressionError);
+    BOOST_CHECK_THROW(decompress(s, uncompressed, sizeof(uncompressed)), CompressionError);
   }
 }
 
 BOOST_AUTO_TEST_SUITE_END()
 
+} // namespace detail
 } // namespace psync
