diff --git a/src/common.hpp b/src/common.hpp
index 0987cf2..f5b9e03 100644
--- a/src/common.hpp
+++ b/src/common.hpp
@@ -51,6 +51,7 @@
 #include <memory>
 #include <stdexcept>
 #include <string>
+#include <type_traits>
 #include <unistd.h>
 
 #if defined(__GNUC__) || defined(__clang__)
@@ -104,6 +105,7 @@
 } // namespace ndn
 
 #include <boost/assert.hpp>
+#include <boost/concept_check.hpp>
 #include <boost/noncopyable.hpp>
 
 namespace ndn {
diff --git a/src/data.cpp b/src/data.cpp
index 0a2e3fb..7954cf7 100644
--- a/src/data.cpp
+++ b/src/data.cpp
@@ -22,9 +22,16 @@
 #include "data.hpp"
 #include "encoding/block-helpers.hpp"
 #include "util/crypto.hpp"
+#include "util/concepts.hpp"
 
 namespace ndn {
 
+BOOST_CONCEPT_ASSERT((boost::EqualityComparable<Data>));
+BOOST_CONCEPT_ASSERT((WireEncodable<Data>));
+BOOST_CONCEPT_ASSERT((WireDecodable<Data>));
+static_assert(std::is_base_of<tlv::Error, Data::Error>::value,
+              "Data::Error must inherit from tlv::Error");
+
 Data::Data()
   : m_content(tlv::Content) // empty content
 {
diff --git a/src/data.hpp b/src/data.hpp
index 170cad2..fec8658 100644
--- a/src/data.hpp
+++ b/src/data.hpp
@@ -33,15 +33,17 @@
 
 namespace ndn {
 
+/** @brief represents a Data packet
+ */
 class Data : public enable_shared_from_this<Data>
 {
 public:
-  class Error : public std::runtime_error
+  class Error : public tlv::Error
   {
   public:
     explicit
     Error(const std::string& what)
-      : std::runtime_error(what)
+      : tlv::Error(what)
     {
     }
   };
diff --git a/src/exclude.cpp b/src/exclude.cpp
index 8e44e1a..c32d214 100644
--- a/src/exclude.cpp
+++ b/src/exclude.cpp
@@ -22,13 +22,15 @@
  */
 
 #include "exclude.hpp"
-
-#include <boost/static_assert.hpp>
-#include <boost/type_traits.hpp>
+#include "util/concepts.hpp"
 
 namespace ndn {
 
-BOOST_STATIC_ASSERT((boost::is_base_of<tlv::Error, Exclude::Error>::value));
+BOOST_CONCEPT_ASSERT((boost::EqualityComparable<Exclude>));
+BOOST_CONCEPT_ASSERT((WireEncodable<Exclude>));
+BOOST_CONCEPT_ASSERT((WireDecodable<Exclude>));
+static_assert(std::is_base_of<tlv::Error, Exclude::Error>::value,
+              "Exclude::Error must inherit from tlv::Error");
 
 Exclude::Exclude()
 {
diff --git a/src/interest.cpp b/src/interest.cpp
index 3d3d40b..eb80c4b 100644
--- a/src/interest.cpp
+++ b/src/interest.cpp
@@ -24,10 +24,17 @@
 #include "interest.hpp"
 #include "util/random.hpp"
 #include "util/crypto.hpp"
+#include "util/concepts.hpp"
 #include "data.hpp"
 
 namespace ndn {
 
+BOOST_CONCEPT_ASSERT((boost::EqualityComparable<Interest>));
+BOOST_CONCEPT_ASSERT((WireEncodable<Interest>));
+BOOST_CONCEPT_ASSERT((WireDecodable<Interest>));
+static_assert(std::is_base_of<tlv::Error, Interest::Error>::value,
+              "Interest::Error must inherit from tlv::Error");
+
 uint32_t
 Interest::getNonce() const
 {
@@ -266,7 +273,7 @@
   //                InterestLifetime?
 
   if (m_wire.type() != tlv::Interest)
-    throw tlv::Error("Unexpected TLV number when decoding Interest");
+    throw Error("Unexpected TLV number when decoding Interest");
 
   // Name
   m_name.wireDecode(m_wire.get(tlv::Name));
diff --git a/src/interest.hpp b/src/interest.hpp
index e075ca7..02e7ba9 100644
--- a/src/interest.hpp
+++ b/src/interest.hpp
@@ -38,12 +38,21 @@
 
 const time::seconds DEFAULT_INTEREST_LIFETIME = time::seconds(4);
 
-/**
- * An Interest holds a Name and other fields for an Interest
+/** @brief represents an Interest packet
  */
 class Interest : public enable_shared_from_this<Interest>
 {
 public:
+  class Error : public tlv::Error
+  {
+  public:
+    explicit
+    Error(const std::string& what)
+      : tlv::Error(what)
+    {
+    }
+  };
+
   /**
    * @brief Create a new Interest with an empty name (`ndn:/`)
    *
diff --git a/src/key-locator.cpp b/src/key-locator.cpp
index ba17771..ddc0029 100644
--- a/src/key-locator.cpp
+++ b/src/key-locator.cpp
@@ -21,9 +21,16 @@
 
 #include "key-locator.hpp"
 #include "encoding/block-helpers.hpp"
+#include "util/concepts.hpp"
 
 namespace ndn {
 
+BOOST_CONCEPT_ASSERT((boost::EqualityComparable<KeyLocator>));
+BOOST_CONCEPT_ASSERT((WireEncodable<KeyLocator>));
+BOOST_CONCEPT_ASSERT((WireDecodable<KeyLocator>));
+static_assert(std::is_base_of<tlv::Error, KeyLocator::Error>::value,
+              "KeyLocator::Error must inherit from tlv::Error");
+
 KeyLocator::KeyLocator()
   : m_type(KeyLocator_None)
 {
diff --git a/src/key-locator.hpp b/src/key-locator.hpp
index 2528912..3c63bbd 100644
--- a/src/key-locator.hpp
+++ b/src/key-locator.hpp
@@ -30,12 +30,12 @@
 class KeyLocator
 {
 public:
-  class Error : public std::runtime_error
+  class Error : public tlv::Error
   {
   public:
     explicit
     Error(const std::string& what)
-      : std::runtime_error(what)
+      : tlv::Error(what)
     {
     }
   };
diff --git a/src/meta-info.cpp b/src/meta-info.cpp
index e3ba2be..3db4cb3 100644
--- a/src/meta-info.cpp
+++ b/src/meta-info.cpp
@@ -22,14 +22,15 @@
 #include "meta-info.hpp"
 #include "encoding/block-helpers.hpp"
 #include "encoding/encoding-buffer.hpp"
-
-#include <boost/concept_check.hpp>
-#include <boost/type_traits.hpp>
+#include "util/concepts.hpp"
 
 namespace ndn {
 
 BOOST_CONCEPT_ASSERT((boost::EqualityComparable<MetaInfo>));
-BOOST_STATIC_ASSERT((boost::is_base_of<tlv::Error, MetaInfo::Error>::value));
+BOOST_CONCEPT_ASSERT((WireEncodable<MetaInfo>));
+BOOST_CONCEPT_ASSERT((WireDecodable<MetaInfo>));
+static_assert(std::is_base_of<tlv::Error, MetaInfo::Error>::value,
+              "MetaInfo::Error must inherit from tlv::Error");
 
 MetaInfo::MetaInfo()
   : m_type(TYPE_DEFAULT)
diff --git a/src/name-component.cpp b/src/name-component.cpp
index 9c97773..893369f 100644
--- a/src/name-component.cpp
+++ b/src/name-component.cpp
@@ -28,10 +28,17 @@
 #include "encoding/block-helpers.hpp"
 #include "encoding/encoding-buffer.hpp"
 #include "util/string-helper.hpp"
+#include "util/concepts.hpp"
 
 namespace ndn {
 namespace name {
 
+BOOST_CONCEPT_ASSERT((boost::EqualityComparable<Component>));
+BOOST_CONCEPT_ASSERT((WireEncodable<Component>));
+BOOST_CONCEPT_ASSERT((WireDecodable<Component>));
+static_assert(std::is_base_of<tlv::Error, Component::Error>::value,
+              "name::Component::Error must inherit from tlv::Error");
+
 Component::Component()
   : Block(tlv::NameComponent)
 {
diff --git a/src/name.cpp b/src/name.cpp
index ba06322..acad1d1 100644
--- a/src/name.cpp
+++ b/src/name.cpp
@@ -27,11 +27,18 @@
 
 #include "util/time.hpp"
 #include "util/string-helper.hpp"
+#include "util/concepts.hpp"
 #include "encoding/block.hpp"
 #include "encoding/encoding-buffer.hpp"
 
 namespace ndn {
 
+BOOST_CONCEPT_ASSERT((boost::EqualityComparable<Name>));
+BOOST_CONCEPT_ASSERT((WireEncodable<Name>));
+BOOST_CONCEPT_ASSERT((WireDecodable<Name>));
+static_assert(std::is_base_of<tlv::Error, Name::Error>::value,
+              "Name::Error must inherit from tlv::Error");
+
 template<bool T>
 size_t
 Name::wireEncode(EncodingImpl<T>& encoder) const
diff --git a/src/security/conf/checker.hpp b/src/security/conf/checker.hpp
index 040d343..3c4ceb2 100644
--- a/src/security/conf/checker.hpp
+++ b/src/security/conf/checker.hpp
@@ -188,18 +188,18 @@
             }
           }
       }
-    catch (tlv::Error& e)
-      {
-        onValidationFailed(packet.shared_from_this(),
-                           "Cannot decode signature");
-        return -1;
-      }
     catch (KeyLocator::Error& e)
       {
         onValidationFailed(packet.shared_from_this(),
                            "Cannot decode KeyLocator");
         return -1;
       }
+    catch (tlv::Error& e)
+      {
+        onValidationFailed(packet.shared_from_this(),
+                           "Cannot decode signature");
+        return -1;
+      }
 
     std::string failInfo;
     if (m_keyLocatorChecker->check(packet, signature.getKeyLocator(), failInfo))
diff --git a/src/security/sec-public-info-sqlite3.cpp b/src/security/sec-public-info-sqlite3.cpp
index 0c70d02..c147bf1 100644
--- a/src/security/sec-public-info-sqlite3.cpp
+++ b/src/security/sec-public-info-sqlite3.cpp
@@ -489,10 +489,6 @@
     {
       return;
     }
-  catch (KeyLocator::Error& e)
-    {
-      return;
-    }
 
   sqlite3_bind_text(statement, 3, identity.toUri(), SQLITE_TRANSIENT);
   sqlite3_bind_text(statement, 4, keyId, SQLITE_STATIC);
diff --git a/src/security/sec-rule-relative.cpp b/src/security/sec-rule-relative.cpp
index 958eb66..042d04f 100644
--- a/src/security/sec-rule-relative.cpp
+++ b/src/security/sec-rule-relative.cpp
@@ -73,10 +73,6 @@
     {
       return false;
     }
-  catch (KeyLocator::Error& e)
-    {
-      return false;
-    }
   catch (RegexMatcher::Error& e)
     {
       return false;
@@ -124,10 +120,6 @@
     {
       return false;
     }
-  catch (KeyLocator::Error& e)
-    {
-      return false;
-    }
   catch (RegexMatcher::Error& e)
     {
       return false;
diff --git a/src/security/sec-rule-specific.cpp b/src/security/sec-rule-specific.cpp
index cb7adf4..061132f 100644
--- a/src/security/sec-rule-specific.cpp
+++ b/src/security/sec-rule-specific.cpp
@@ -80,10 +80,6 @@
     {
       return false;
     }
-  catch (KeyLocator::Error& e)
-    {
-      return false;
-    }
   catch (RegexMatcher::Error& e)
     {
       return false;
diff --git a/src/security/validator-config.cpp b/src/security/validator-config.cpp
index 83b7a62..5891ff1 100644
--- a/src/security/validator-config.cpp
+++ b/src/security/validator-config.cpp
@@ -537,16 +537,16 @@
       return onValidationFailed(interest.shared_from_this(),
                                 "No valid signature");
     }
-  catch (tlv::Error& e)
-    {
-      return onValidationFailed(interest.shared_from_this(),
-                                "Cannot decode signature");
-    }
   catch (KeyLocator::Error& e)
     {
       return onValidationFailed(interest.shared_from_this(),
                                 "No valid KeyLocator");
     }
+  catch (tlv::Error& e)
+    {
+      return onValidationFailed(interest.shared_from_this(),
+                                "Cannot decode signature");
+    }
   catch (IdentityCertificate::Error& e)
     {
       return onValidationFailed(interest.shared_from_this(),
diff --git a/src/security/validator-config.hpp b/src/security/validator-config.hpp
index 69f626d..6b70a3c 100644
--- a/src/security/validator-config.hpp
+++ b/src/security/validator-config.hpp
@@ -320,14 +320,14 @@
                               "Unsupported signature type");
     }
   }
-  catch (tlv::Error& e) {
-    return onValidationFailed(packet.shared_from_this(),
-                              "Cannot decode public key signature");
-  }
   catch (KeyLocator::Error& e) {
     return onValidationFailed(packet.shared_from_this(),
                               "Cannot decode KeyLocator in public key signature");
   }
+  catch (tlv::Error& e) {
+    return onValidationFailed(packet.shared_from_this(),
+                              "Cannot decode public key signature");
+  }
 
   if (signature.getKeyLocator().getType() != KeyLocator::KeyLocator_Name) {
     return onValidationFailed(packet.shared_from_this(), "Unsupported KeyLocator type");
diff --git a/src/security/validator-regex.cpp b/src/security/validator-regex.cpp
index 194aaf1..0539abd 100644
--- a/src/security/validator-regex.cpp
+++ b/src/security/validator-regex.cpp
@@ -161,17 +161,17 @@
                   return;
                 }
             }
-          catch (tlv::Error& e)
-            {
-              return onValidationFailed(data.shared_from_this(),
-                                        "Cannot decode signature");
-            }
           catch (KeyLocator::Error& e)
             {
               return onValidationFailed(data.shared_from_this(),
                                         "Key Locator is not a name: " +
                                         data.getName().toUri());
             }
+          catch (tlv::Error& e)
+            {
+              return onValidationFailed(data.shared_from_this(),
+                                        "Cannot decode signature");
+            }
         }
     }
 
diff --git a/src/selectors.cpp b/src/selectors.cpp
new file mode 100644
index 0000000..bfb4df4
--- /dev/null
+++ b/src/selectors.cpp
@@ -0,0 +1,248 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2013-2014 Regents of the University of California.
+ *
+ * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-cxx library 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.
+ *
+ * ndn-cxx library 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 copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ */
+
+#include "selectors.hpp"
+#include "encoding/encoding-buffer.hpp"
+#include "encoding/block-helpers.hpp"
+#include "util/concepts.hpp"
+
+namespace ndn {
+
+BOOST_CONCEPT_ASSERT((boost::EqualityComparable<Selectors>));
+BOOST_CONCEPT_ASSERT((WireEncodable<Selectors>));
+BOOST_CONCEPT_ASSERT((WireDecodable<Selectors>));
+static_assert(std::is_base_of<tlv::Error, Selectors::Error>::value,
+              "Selectors::Error must inherit from tlv::Error");
+
+Selectors::Selectors()
+  : m_minSuffixComponents(-1)
+  , m_maxSuffixComponents(-1)
+  , m_childSelector(-1)
+  , m_mustBeFresh(false)
+{
+}
+
+Selectors::Selectors(int minSuffixComponents, int maxSuffixComponents,
+                     const Exclude& exclude,
+                     int childSelector,
+                     bool mustBeFresh)
+  : m_minSuffixComponents(minSuffixComponents)
+  , m_maxSuffixComponents(maxSuffixComponents)
+  , m_exclude(exclude)
+  , m_childSelector(childSelector)
+  , m_mustBeFresh(mustBeFresh)
+{
+}
+
+Selectors::Selectors(const Block& wire)
+{
+  wireDecode(wire);
+}
+
+bool
+Selectors::empty() const
+{
+  return m_minSuffixComponents < 0 &&
+         m_maxSuffixComponents < 0 &&
+         m_publisherPublicKeyLocator.empty() &&
+         m_exclude.empty() &&
+         m_childSelector < 0 &&
+         !m_mustBeFresh;
+}
+
+template<bool T>
+size_t
+Selectors::wireEncode(EncodingImpl<T>& block) const
+{
+  size_t totalLength = 0;
+
+  // Selectors ::= SELECTORS-TYPE TLV-LENGTH
+  //                 MinSuffixComponents?
+  //                 MaxSuffixComponents?
+  //                 PublisherPublicKeyLocator?
+  //                 Exclude?
+  //                 ChildSelector?
+  //                 MustBeFresh?
+
+  // (reverse encoding)
+
+  // MustBeFresh
+  if (getMustBeFresh()) {
+    totalLength += prependBooleanBlock(block, tlv::MustBeFresh);
+  }
+
+  // ChildSelector
+  if (getChildSelector() >= 0) {
+    totalLength += prependNonNegativeIntegerBlock(block, tlv::ChildSelector, getChildSelector());
+  }
+
+  // Exclude
+  if (!getExclude().empty()) {
+    totalLength += getExclude().wireEncode(block);
+  }
+
+  // PublisherPublicKeyLocator
+  if (!getPublisherPublicKeyLocator().empty()) {
+    totalLength += getPublisherPublicKeyLocator().wireEncode(block);
+  }
+
+  // MaxSuffixComponents
+  if (getMaxSuffixComponents() >= 0) {
+    totalLength += prependNonNegativeIntegerBlock(block, tlv::MaxSuffixComponents,
+                                                  getMaxSuffixComponents());
+  }
+
+  // MinSuffixComponents
+  if (getMinSuffixComponents() >= 0) {
+    totalLength += prependNonNegativeIntegerBlock(block, tlv::MinSuffixComponents,
+                                                  getMinSuffixComponents());
+  }
+
+  totalLength += block.prependVarNumber(totalLength);
+  totalLength += block.prependVarNumber(tlv::Selectors);
+  return totalLength;
+}
+
+template size_t
+Selectors::wireEncode<true>(EncodingImpl<true>& estimator) const;
+
+template size_t
+Selectors::wireEncode<false>(EncodingImpl<false>& encoder) const;
+
+const Block&
+Selectors::wireEncode() const
+{
+  if (m_wire.hasWire())
+    return m_wire;
+
+  EncodingEstimator estimator;
+  size_t estimatedSize = wireEncode(estimator);
+
+  EncodingBuffer buffer(estimatedSize, 0);
+  wireEncode(buffer);
+
+  m_wire = buffer.block();
+  return m_wire;
+}
+
+void
+Selectors::wireDecode(const Block& wire)
+{
+  if (wire.type() != tlv::Selectors)
+    throw tlv::Error("Unexpected TLV type when decoding Selectors");
+
+  *this = Selectors();
+
+  m_wire = wire;
+  m_wire.parse();
+
+  // MinSuffixComponents
+  Block::element_const_iterator val = m_wire.find(tlv::MinSuffixComponents);
+  if (val != m_wire.elements_end()) {
+    m_minSuffixComponents = readNonNegativeInteger(*val);
+  }
+
+  // MaxSuffixComponents
+  val = m_wire.find(tlv::MaxSuffixComponents);
+  if (val != m_wire.elements_end()) {
+    m_maxSuffixComponents = readNonNegativeInteger(*val);
+  }
+
+  // PublisherPublicKeyLocator
+  val = m_wire.find(tlv::KeyLocator);
+  if (val != m_wire.elements_end()) {
+    m_publisherPublicKeyLocator.wireDecode(*val);
+  }
+
+  // Exclude
+  val = m_wire.find(tlv::Exclude);
+  if (val != m_wire.elements_end()) {
+    m_exclude.wireDecode(*val);
+  }
+
+  // ChildSelector
+  val = m_wire.find(tlv::ChildSelector);
+  if (val != m_wire.elements_end()) {
+    m_childSelector = readNonNegativeInteger(*val);
+  }
+
+  // MustBeFresh
+  val = m_wire.find(tlv::MustBeFresh);
+  if (val != m_wire.elements_end()) {
+    m_mustBeFresh = true;
+  }
+}
+
+Selectors&
+Selectors::setMinSuffixComponents(int minSuffixComponents)
+{
+  m_minSuffixComponents = minSuffixComponents;
+  m_wire.reset();
+  return *this;
+}
+
+Selectors&
+Selectors::setMaxSuffixComponents(int maxSuffixComponents)
+{
+  m_maxSuffixComponents = maxSuffixComponents;
+  m_wire.reset();
+  return *this;
+}
+
+Selectors&
+Selectors::setPublisherPublicKeyLocator(const KeyLocator& keyLocator)
+{
+  m_publisherPublicKeyLocator = keyLocator;
+  m_wire.reset();
+  return *this;
+}
+
+Selectors&
+Selectors::setExclude(const Exclude& exclude)
+{
+  m_exclude = exclude;
+  m_wire.reset();
+  return *this;
+}
+
+Selectors&
+Selectors::setChildSelector(int childSelector)
+{
+  m_childSelector = childSelector;
+  m_wire.reset();
+  return *this;
+}
+
+Selectors&
+Selectors::setMustBeFresh(bool mustBeFresh)
+{
+  m_mustBeFresh = mustBeFresh;
+  m_wire.reset();
+  return *this;
+}
+
+bool
+Selectors::operator==(const Selectors& other) const
+{
+  return wireEncode() == other.wireEncode();
+}
+
+} // namespace ndn
diff --git a/src/selectors.hpp b/src/selectors.hpp
index c4fcb42..6db99ac 100644
--- a/src/selectors.hpp
+++ b/src/selectors.hpp
@@ -25,8 +25,6 @@
 #include "common.hpp"
 #include "key-locator.hpp"
 #include "exclude.hpp"
-#include "encoding/encoding-buffer.hpp"
-#include "encoding/block-helpers.hpp"
 
 namespace ndn {
 
@@ -36,13 +34,17 @@
 class Selectors
 {
 public:
-  Selectors()
-  : m_minSuffixComponents(-1)
-  , m_maxSuffixComponents(-1)
-  , m_childSelector(-1)
-  , m_mustBeFresh(false)
+  class Error : public tlv::Error
   {
-  }
+  public:
+    explicit
+    Error(const std::string& what)
+      : tlv::Error(what)
+    {
+    }
+  };
+
+  Selectors();
 
   /** @deprecated Selectors().setX(...).setY(...)
    */
@@ -50,22 +52,13 @@
   Selectors(int minSuffixComponents, int maxSuffixComponents,
             const Exclude& exclude,
             int childSelector,
-            bool mustBeFresh))
-    : m_minSuffixComponents(minSuffixComponents)
-    , m_maxSuffixComponents(maxSuffixComponents)
-    , m_exclude(exclude)
-    , m_childSelector(childSelector)
-    , m_mustBeFresh(mustBeFresh)
-  {
-  }
+            bool mustBeFresh));
 
   /**
    * @brief Create from wire encoding
    */
-  Selectors(const Block& wire)
-  {
-    wireDecode(wire);
-  }
+  explicit
+  Selectors(const Block& wire);
 
   bool
   empty() const;
@@ -89,10 +82,7 @@
   void
   wireDecode(const Block& wire);
 
-  ///////////////////////////////////////////////////////////////////////////////
-  ///////////////////////////////////////////////////////////////////////////////
-  ///////////////////////////////////////////////////////////////////////////////
-
+public: // getters & setters
   int
   getMinSuffixComponents() const
   {
@@ -100,14 +90,7 @@
   }
 
   Selectors&
-  setMinSuffixComponents(int minSuffixComponents)
-  {
-    m_minSuffixComponents = minSuffixComponents;
-    m_wire.reset();
-    return *this;
-  }
-
-  //
+  setMinSuffixComponents(int minSuffixComponents);
 
   int
   getMaxSuffixComponents() const
@@ -116,14 +99,7 @@
   }
 
   Selectors&
-  setMaxSuffixComponents(int maxSuffixComponents)
-  {
-    m_maxSuffixComponents = maxSuffixComponents;
-    m_wire.reset();
-    return *this;
-  }
-
-  //
+  setMaxSuffixComponents(int maxSuffixComponents);
 
   const KeyLocator&
   getPublisherPublicKeyLocator() const
@@ -132,14 +108,7 @@
   }
 
   Selectors&
-  setPublisherPublicKeyLocator(const KeyLocator& keyLocator)
-  {
-    m_publisherPublicKeyLocator = keyLocator;
-    m_wire.reset();
-    return *this;
-  }
-
-  //
+  setPublisherPublicKeyLocator(const KeyLocator& keyLocator);
 
   const Exclude&
   getExclude() const
@@ -148,14 +117,7 @@
   }
 
   Selectors&
-  setExclude(const Exclude& exclude)
-  {
-    m_exclude = exclude;
-    m_wire.reset();
-    return *this;
-  }
-
-  //
+  setExclude(const Exclude& exclude);
 
   int
   getChildSelector() const
@@ -164,14 +126,7 @@
   }
 
   Selectors&
-  setChildSelector(int childSelector)
-  {
-    m_childSelector = childSelector;
-    m_wire.reset();
-    return *this;
-  }
-
-  //
+  setChildSelector(int childSelector);
 
   int
   getMustBeFresh() const
@@ -180,24 +135,16 @@
   }
 
   Selectors&
-  setMustBeFresh(bool mustBeFresh)
-  {
-    m_mustBeFresh = mustBeFresh;
-    m_wire.reset();
-    return *this;
-  }
+  setMustBeFresh(bool mustBeFresh);
 
 public: // EqualityComparable concept
   bool
-  operator==(const Selectors& other) const
-  {
-    return wireEncode() == other.wireEncode();
-  }
+  operator==(const Selectors& other) const;
 
   bool
   operator!=(const Selectors& other) const
   {
-    return !(*this == other);
+    return !this->operator==(other);
   }
 
 private:
@@ -211,147 +158,6 @@
   mutable Block m_wire;
 };
 
-inline bool
-Selectors::empty() const
-{
-  return
-    (m_minSuffixComponents < 0 &&
-     m_maxSuffixComponents < 0 &&
-     m_publisherPublicKeyLocator.empty() &&
-     m_exclude.empty() &&
-     m_childSelector < 0 &&
-     !m_mustBeFresh);
-}
-
-template<bool T>
-inline size_t
-Selectors::wireEncode(EncodingImpl<T>& block) const
-{
-  size_t totalLength = 0;
-
-  // Selectors ::= SELECTORS-TYPE TLV-LENGTH
-  //                 MinSuffixComponents?
-  //                 MaxSuffixComponents?
-  //                 PublisherPublicKeyLocator?
-  //                 Exclude?
-  //                 ChildSelector?
-  //                 MustBeFresh?
-
-  // (reverse encoding)
-
-  // MustBeFresh
-  if (getMustBeFresh())
-    {
-      totalLength += prependBooleanBlock(block, tlv::MustBeFresh);
-    }
-
-  // ChildSelector
-  if (getChildSelector() >= 0)
-    {
-      totalLength += prependNonNegativeIntegerBlock(block, tlv::ChildSelector, getChildSelector());
-    }
-
-  // Exclude
-  if (!getExclude().empty())
-    {
-      totalLength += getExclude().wireEncode(block);
-    }
-
-  // PublisherPublicKeyLocator
-  if (!getPublisherPublicKeyLocator().empty())
-    {
-      totalLength += getPublisherPublicKeyLocator().wireEncode(block);
-    }
-
-  // MaxSuffixComponents
-  if (getMaxSuffixComponents() >= 0)
-    {
-      totalLength += prependNonNegativeIntegerBlock(block, tlv::MaxSuffixComponents,
-                                                    getMaxSuffixComponents());
-    }
-
-  // MinSuffixComponents
-  if (getMinSuffixComponents() >= 0)
-    {
-      totalLength += prependNonNegativeIntegerBlock(block, tlv::MinSuffixComponents,
-                                                    getMinSuffixComponents());
-    }
-
-  totalLength += block.prependVarNumber(totalLength);
-  totalLength += block.prependVarNumber(tlv::Selectors);
-  return totalLength;
-}
-
-inline const Block&
-Selectors::wireEncode() const
-{
-  if (m_wire.hasWire())
-    return m_wire;
-
-  EncodingEstimator estimator;
-  size_t estimatedSize = wireEncode(estimator);
-
-  EncodingBuffer buffer(estimatedSize, 0);
-  wireEncode(buffer);
-
-  m_wire = buffer.block();
-  return m_wire;
-}
-
-inline void
-Selectors::wireDecode(const Block& wire)
-{
-  if (wire.type() != tlv::Selectors)
-    throw tlv::Error("Unexpected TLV type when decoding Selectors");
-
-  *this = Selectors();
-
-  m_wire = wire;
-  m_wire.parse();
-
-  // MinSuffixComponents
-  Block::element_const_iterator val = m_wire.find(tlv::MinSuffixComponents);
-  if (val != m_wire.elements_end())
-    {
-      m_minSuffixComponents = readNonNegativeInteger(*val);
-    }
-
-  // MaxSuffixComponents
-  val = m_wire.find(tlv::MaxSuffixComponents);
-  if (val != m_wire.elements_end())
-    {
-      m_maxSuffixComponents = readNonNegativeInteger(*val);
-    }
-
-  // PublisherPublicKeyLocator
-  val = m_wire.find(tlv::KeyLocator);
-  if (val != m_wire.elements_end())
-    {
-      m_publisherPublicKeyLocator.wireDecode(*val);
-    }
-
-  // Exclude
-  val = m_wire.find(tlv::Exclude);
-  if (val != m_wire.elements_end())
-    {
-      m_exclude.wireDecode(*val);
-    }
-
-  // ChildSelector
-  val = m_wire.find(tlv::ChildSelector);
-  if (val != m_wire.elements_end())
-    {
-      m_childSelector = readNonNegativeInteger(*val);
-    }
-
-  //MustBeFresh aka AnswerOriginKind
-  val = m_wire.find(tlv::MustBeFresh);
-  if (val != m_wire.elements_end())
-    {
-      m_mustBeFresh = true;
-    }
-}
-
 } // namespace ndn
 
 #endif // NDN_SELECTORS_HPP
diff --git a/src/signature-info.cpp b/src/signature-info.cpp
index 1e40b1f..13e5be3 100644
--- a/src/signature-info.cpp
+++ b/src/signature-info.cpp
@@ -21,11 +21,18 @@
 
 #include "signature-info.hpp"
 #include "encoding/block-helpers.hpp"
+#include "util/concepts.hpp"
 
 #include <boost/lexical_cast.hpp>
 
 namespace ndn {
 
+BOOST_CONCEPT_ASSERT((boost::EqualityComparable<SignatureInfo>));
+BOOST_CONCEPT_ASSERT((WireEncodable<SignatureInfo>));
+BOOST_CONCEPT_ASSERT((WireDecodable<SignatureInfo>));
+static_assert(std::is_base_of<tlv::Error, SignatureInfo::Error>::value,
+              "SignatureInfo::Error must inherit from tlv::Error");
+
 SignatureInfo::SignatureInfo()
   : m_type(-1)
   , m_hasKeyLocator(false)
diff --git a/src/signature.cpp b/src/signature.cpp
index 5ec68d5..723478c 100644
--- a/src/signature.cpp
+++ b/src/signature.cpp
@@ -23,6 +23,10 @@
 
 namespace ndn {
 
+BOOST_CONCEPT_ASSERT((boost::EqualityComparable<Signature>));
+static_assert(std::is_base_of<tlv::Error, Signature::Error>::value,
+              "Signature::Error must inherit from tlv::Error");
+
 Signature::Signature(const Block& info, const Block& value)
   : m_info(info)
   , m_value(value)
