diff --git a/src/data.cpp b/src/data.cpp
index 596e20b..d095382 100644
--- a/src/data.cpp
+++ b/src/data.cpp
@@ -25,7 +25,7 @@
 namespace ndn {
 
 Data::Data()
-  : m_content(Tlv::Content) // empty content
+  : m_content(tlv::Content) // empty content
 {
 }
 
@@ -79,7 +79,7 @@
   if (!unsignedPortion)
     {
       totalLength += block.prependVarNumber(totalLength);
-      totalLength += block.prependVarNumber(Tlv::Data);
+      totalLength += block.prependVarNumber(tlv::Data);
     }
   return totalLength;
 }
@@ -91,7 +91,7 @@
   totalLength += encoder.appendBlock(signatureValue);
 
   totalLength += encoder.prependVarNumber(totalLength);
-  encoder.prependVarNumber(Tlv::Data);
+  encoder.prependVarNumber(tlv::Data);
 
   const_cast<Data*>(this)->wireDecode(encoder.block());
   return m_wire;
@@ -127,23 +127,23 @@
   //            Signature
 
   // Name
-  m_name.wireDecode(m_wire.get(Tlv::Name));
+  m_name.wireDecode(m_wire.get(tlv::Name));
 
   // MetaInfo
-  m_metaInfo.wireDecode(m_wire.get(Tlv::MetaInfo));
+  m_metaInfo.wireDecode(m_wire.get(tlv::MetaInfo));
 
   // Content
-  m_content = m_wire.get(Tlv::Content);
+  m_content = m_wire.get(tlv::Content);
 
   ///////////////
   // Signature //
   ///////////////
 
   // SignatureInfo
-  m_signature.setInfo(m_wire.get(Tlv::SignatureInfo));
+  m_signature.setInfo(m_wire.get(tlv::SignatureInfo));
 
   // SignatureValue
-  Block::element_const_iterator val = m_wire.find(Tlv::SignatureValue);
+  Block::element_const_iterator val = m_wire.find(tlv::SignatureValue);
   if (val != m_wire.elements_end())
     m_signature.setValue(*val);
 }
@@ -212,7 +212,7 @@
 Data::getContent() const
 {
   if (m_content.empty())
-    m_content = dataBlock(Tlv::Content, reinterpret_cast<const uint8_t*>(0), 0);
+    m_content = dataBlock(tlv::Content, reinterpret_cast<const uint8_t*>(0), 0);
 
   if (!m_content.hasWire())
       m_content.encode();
@@ -224,7 +224,7 @@
 {
   onChanged();
 
-  m_content = dataBlock(Tlv::Content, content, contentLength);
+  m_content = dataBlock(tlv::Content, content, contentLength);
 
   return *this;
 }
@@ -234,7 +234,7 @@
 {
   onChanged();
 
-  m_content = Block(Tlv::Content, contentValue); // not a real wire encoding yet
+  m_content = Block(tlv::Content, contentValue); // not a real wire encoding yet
 
   return *this;
 }
@@ -244,10 +244,10 @@
 {
   onChanged();
 
-  if (content.type() == Tlv::Content)
+  if (content.type() == tlv::Content)
     m_content = content;
   else {
-    m_content = Block(Tlv::Content, content);
+    m_content = Block(tlv::Content, content);
   }
 
   return *this;
diff --git a/src/data.hpp b/src/data.hpp
index 1480103..170cad2 100644
--- a/src/data.hpp
+++ b/src/data.hpp
@@ -238,11 +238,11 @@
    *
    * Depending on type of the supplied block, there are two cases:
    *
-   * - if block.type() == Tlv::Content, then block will be used directly as Data packet's
+   * - if block.type() == tlv::Content, then block will be used directly as Data packet's
    *   content (no extra copying)
    *
-   * - if block.type() != Tlv::Content, then this method will create a new Block with type
-   *   Tlv::Content and put block as a nested element in the content Block.
+   * - if block.type() != tlv::Content, then this method will create a new Block with type
+   *   tlv::Content and put block as a nested element in the content Block.
    *
    * @param block The Block containing the content to assign
    *
@@ -254,7 +254,7 @@
   /**
    * @brief Set the content from the pointer to immutable buffer
    *
-   * This method will create a Block with Tlv::Content and set contentValue as a payload
+   * This method will create a Block with tlv::Content and set contentValue as a payload
    * for this block.  Note that this method is very different from setContent(const
    * Block&), since it does not require that payload should be a valid TLV element.
    *
diff --git a/src/encoding/block-helpers.hpp b/src/encoding/block-helpers.hpp
index 8163d0c..0a58aa0 100644
--- a/src/encoding/block-helpers.hpp
+++ b/src/encoding/block-helpers.hpp
@@ -45,7 +45,7 @@
 readNonNegativeInteger(const Block& block)
 {
   Buffer::const_iterator begin = block.value_begin();
-  return Tlv::readNonNegativeInteger(block.value_size(), begin, block.value_end());
+  return tlv::readNonNegativeInteger(block.value_size(), begin, block.value_end());
 }
 
 inline Block
@@ -87,8 +87,8 @@
 //     ++dataSize;
 
 //   OBufferStream os;
-//   Tlv::writeVarNumber(os, type);
-//   Tlv::writeVarNumber(os, dataSize);
+//   tlv::writeVarNumber(os, type);
+//   tlv::writeVarNumber(os, dataSize);
 //   std::copy(first, last, std::ostream_iterator<uint8_t>(os));
 
 //   return Block(os.buf());
diff --git a/src/encoding/block.cpp b/src/encoding/block.cpp
index eeb0c3f..9edebc2 100644
--- a/src/encoding/block.cpp
+++ b/src/encoding/block.cpp
@@ -51,11 +51,11 @@
   m_value_begin = m_begin;
   m_value_end   = m_end;
 
-  m_type = Tlv::readType(m_value_begin, m_value_end);
-  uint64_t length = Tlv::readVarNumber(m_value_begin, m_value_end);
+  m_type = tlv::readType(m_value_begin, m_value_end);
+  uint64_t length = tlv::readVarNumber(m_value_begin, m_value_end);
   if (length != static_cast<uint64_t>(m_value_end - m_value_begin))
     {
-      throw Tlv::Error("TLV length doesn't match buffer length");
+      throw tlv::Error("TLV length doesn't match buffer length");
     }
 }
 
@@ -82,12 +82,12 @@
   m_value_begin = m_begin;
   m_value_end   = m_end;
 
-  m_type = Tlv::readType(m_value_begin, m_value_end);
+  m_type = tlv::readType(m_value_begin, m_value_end);
 
-  uint64_t length = Tlv::readVarNumber(m_value_begin, m_value_end);
+  uint64_t length = tlv::readVarNumber(m_value_begin, m_value_end);
   if (length != static_cast<uint64_t>(m_value_end - m_value_begin))
     {
-      throw Tlv::Error("TLV length doesn't match buffer length");
+      throw tlv::Error("TLV length doesn't match buffer length");
     }
 }
 
@@ -102,13 +102,13 @@
   m_value_begin = m_begin;
   m_value_end   = m_end;
 
-  m_type = Tlv::readType(m_value_begin, m_value_end);
-  uint64_t length = Tlv::readVarNumber(m_value_begin, m_value_end);
+  m_type = tlv::readType(m_value_begin, m_value_end);
+  uint64_t length = tlv::readVarNumber(m_value_begin, m_value_end);
   if (verifyLength)
     {
       if (length != static_cast<uint64_t>(m_value_end - m_value_begin))
         {
-          throw Tlv::Error("TLV length doesn't match buffer length");
+          throw tlv::Error("TLV length doesn't match buffer length");
         }
     }
 }
@@ -119,12 +119,12 @@
   const uint8_t*  tmp_begin = buffer;
   const uint8_t*  tmp_end   = buffer + maxlength;
 
-  m_type = Tlv::readType(tmp_begin, tmp_end);
-  uint64_t length = Tlv::readVarNumber(tmp_begin, tmp_end);
+  m_type = tlv::readType(tmp_begin, tmp_end);
+  uint64_t length = tlv::readVarNumber(tmp_begin, tmp_end);
 
   if (length > static_cast<uint64_t>(tmp_end - tmp_begin))
     {
-      throw Tlv::Error("Not enough data in the buffer to fully parse TLV");
+      throw tlv::Error("Not enough data in the buffer to fully parse TLV");
     }
 
   m_buffer = make_shared<Buffer>(buffer, (tmp_begin - buffer) + length);
@@ -144,12 +144,12 @@
   const uint8_t* tmp_begin = buffer;
   const uint8_t* tmp_end   = buffer + maxlength;
 
-  m_type = Tlv::readType(tmp_begin, tmp_end);
-  uint64_t length = Tlv::readVarNumber(tmp_begin, tmp_end);
+  m_type = tlv::readType(tmp_begin, tmp_end);
+  uint64_t length = tlv::readVarNumber(tmp_begin, tmp_end);
 
   if (length > static_cast<uint64_t>(tmp_end - tmp_begin))
     {
-      throw Tlv::Error("Not enough data in the buffer to fully parse TLV");
+      throw tlv::Error("Not enough data in the buffer to fully parse TLV");
     }
 
   m_buffer = make_shared<Buffer>(buffer, (tmp_begin - buffer) + length);
@@ -175,7 +175,7 @@
   , m_value_begin(m_buffer->begin())
   , m_value_end(m_buffer->end())
 {
-  m_size = Tlv::sizeOfVarNumber(m_type) + Tlv::sizeOfVarNumber(value_size()) + value_size();
+  m_size = tlv::sizeOfVarNumber(m_type) + tlv::sizeOfVarNumber(value_size()) + value_size();
 }
 
 Block::Block(uint32_t type, const Block& value)
@@ -186,7 +186,7 @@
   , m_value_begin(value.begin())
   , m_value_end(value.end())
 {
-  m_size = Tlv::sizeOfVarNumber(m_type) + Tlv::sizeOfVarNumber(value_size()) + value_size();
+  m_size = tlv::sizeOfVarNumber(m_type) + tlv::sizeOfVarNumber(value_size()) + value_size();
 }
 
 Block
@@ -195,11 +195,11 @@
   std::istream_iterator<uint8_t> tmp_begin(is);
   std::istream_iterator<uint8_t> tmp_end;
 
-  uint32_t type = Tlv::readType(tmp_begin, tmp_end);
-  uint64_t length = Tlv::readVarNumber(tmp_begin, tmp_end);
+  uint32_t type = tlv::readType(tmp_begin, tmp_end);
+  uint64_t length = tlv::readVarNumber(tmp_begin, tmp_end);
 
   if (length > MAX_SIZE_OF_BLOCK_FROM_STREAM)
-    throw Tlv::Error("Length of block from stream is too large");
+    throw tlv::Error("Length of block from stream is too large");
 
   // We may still have some problem here, if some exception happens,
   // we may completely lose all the bytes extracted from the stream.
@@ -209,7 +209,7 @@
   is.read(buf+1, length-1);
 
   if (length != static_cast<uint64_t>(is.gcount()) + 1) {
-    throw Tlv::Error("Not enough data in the buffer to fully parse TLV");
+    throw tlv::Error("Not enough data in the buffer to fully parse TLV");
   }
 
   return dataBlock(type, buf, length);
@@ -221,12 +221,12 @@
   Buffer::const_iterator tempBegin = wire->begin() + offset;
 
   uint32_t type;
-  bool isOk = Tlv::readType(tempBegin, wire->end(), type);
+  bool isOk = tlv::readType(tempBegin, wire->end(), type);
   if (!isOk)
     return false;
 
   uint64_t length;
-  isOk = Tlv::readVarNumber(tempBegin, wire->end(), length);
+  isOk = tlv::readVarNumber(tempBegin, wire->end(), length);
   if (!isOk)
     return false;
 
@@ -249,12 +249,12 @@
   const uint8_t* tempEnd = buffer + maxSize;
 
   uint32_t type = 0;
-  bool isOk = Tlv::readType(tempBegin, tempEnd, type);
+  bool isOk = tlv::readType(tempBegin, tempEnd, type);
   if (!isOk)
     return false;
 
   uint64_t length;
-  isOk = Tlv::readVarNumber(tempBegin, tempEnd, length);
+  isOk = tlv::readVarNumber(tempBegin, tempEnd, length);
   if (!isOk)
     return false;
 
@@ -284,13 +284,13 @@
     {
       Buffer::const_iterator element_begin = begin;
 
-      uint32_t type = Tlv::readType(begin, end);
-      uint64_t length = Tlv::readVarNumber(begin, end);
+      uint32_t type = tlv::readType(begin, end);
+      uint64_t length = tlv::readVarNumber(begin, end);
 
       if (length > static_cast<uint64_t>(end - begin))
         {
           m_subBlocks.clear();
-          throw Tlv::Error("TLV length exceeds buffer length");
+          throw tlv::Error("TLV length exceeds buffer length");
         }
       Buffer::const_iterator element_end = begin + length;
 
@@ -311,16 +311,16 @@
     return;
 
   OBufferStream os;
-  Tlv::writeVarNumber(os, type());
+  tlv::writeVarNumber(os, type());
 
   if (hasValue())
     {
-      Tlv::writeVarNumber(os, value_size());
+      tlv::writeVarNumber(os, value_size());
       os.write(reinterpret_cast<const char*>(value()), value_size());
     }
   else if (m_subBlocks.size() == 0)
     {
-      Tlv::writeVarNumber(os, 0);
+      tlv::writeVarNumber(os, 0);
     }
   else
     {
@@ -329,14 +329,14 @@
         valueSize += i->size();
       }
 
-      Tlv::writeVarNumber(os, valueSize);
+      tlv::writeVarNumber(os, valueSize);
 
       for (element_const_iterator i = m_subBlocks.begin(); i != m_subBlocks.end(); ++i) {
         if (i->hasWire())
           os.write(reinterpret_cast<const char*>(i->wire()), i->size());
         else if (i->hasValue()) {
-          Tlv::writeVarNumber(os, i->type());
-          Tlv::writeVarNumber(os, i->value_size());
+          tlv::writeVarNumber(os, i->type());
+          tlv::writeVarNumber(os, i->value_size());
           os.write(reinterpret_cast<const char*>(i->value()), i->value_size());
         }
         else
@@ -354,8 +354,8 @@
   m_value_begin = m_buffer->begin();
   m_value_end   = m_buffer->end();
 
-  Tlv::readType(m_value_begin, m_value_end);
-  Tlv::readVarNumber(m_value_begin, m_value_end);
+  tlv::readType(m_value_begin, m_value_end);
+  tlv::readVarNumber(m_value_begin, m_value_end);
 }
 
 Block
@@ -369,11 +369,11 @@
 
   Buffer::const_iterator element_begin = begin;
 
-  uint32_t type = Tlv::readType(begin, end);
-  uint64_t length = Tlv::readVarNumber(begin, end);
+  uint32_t type = tlv::readType(begin, end);
+  uint64_t length = tlv::readVarNumber(begin, end);
 
   if (length != static_cast<uint64_t>(end - begin))
-    throw Tlv::Error("TLV length mismatches buffer length");
+    throw tlv::Error("TLV length mismatches buffer length");
 
   return Block(m_buffer,
                type,
diff --git a/src/encoding/block.hpp b/src/encoding/block.hpp
index 17192d8..9c2db13 100644
--- a/src/encoding/block.hpp
+++ b/src/encoding/block.hpp
@@ -51,12 +51,12 @@
   typedef element_container::const_iterator  element_const_iterator;
 
   /// @brief Error that can be thrown from Block
-  class Error : public Tlv::Error
+  class Error : public tlv::Error
   {
   public:
     explicit
     Error(const std::string& what)
-      : Tlv::Error(what)
+      : tlv::Error(what)
     {
     }
   };
diff --git a/src/encoding/tlv.hpp b/src/encoding/tlv.hpp
index 9d70ee6..87114eb 100644
--- a/src/encoding/tlv.hpp
+++ b/src/encoding/tlv.hpp
@@ -32,7 +32,7 @@
 /**
  * @brief Namespace defining NDN-TLV related constants and procedures
  */
-namespace Tlv {
+namespace tlv {
 
 class Error : public std::runtime_error
 {
@@ -125,7 +125,7 @@
 /**
  * @brief Read VAR-NUMBER in NDN-TLV encoding
  *
- * @throws This call will throw ndn::Tlv::Error (aka std::runtime_error) if number cannot be read
+ * @throws This call will throw ndn::tlv::Error (aka std::runtime_error) if number cannot be read
  *
  * Note that after call finished, begin will point to the first byte after the read VAR-NUMBER
  */
@@ -136,7 +136,7 @@
 /**
  * @brief Read TLV Type
  *
- * @throws This call will throw ndn::Tlv::Error (aka std::runtime_error) if number cannot be read
+ * @throws This call will throw ndn::tlv::Error (aka std::runtime_error) if number cannot be read
  *
  * This call is largely equivalent to tlv::readVarNumber, but exception will be thrown if type
  * is larger than 2^32-1 (type in this library is implemented as uint32_t)
@@ -160,7 +160,7 @@
 /**
  * @brief Read nonNegativeInteger in NDN-TLV encoding
  *
- * This call will throw ndn::Tlv::Error (aka std::runtime_error) if number cannot be read
+ * This call will throw ndn::tlv::Error (aka std::runtime_error) if number cannot be read
  *
  * Note that after call finished, begin will point to the first byte after the read VAR-NUMBER
  *
@@ -536,7 +536,10 @@
 }
 
 
-} // namespace Tlv
+} // namespace tlv
+
+/// @deprecated use namespace tlv instead
+namespace Tlv = tlv;
 
 } // namespace ndn
 
diff --git a/src/exclude.hpp b/src/exclude.hpp
index 48df17e..64eb653 100644
--- a/src/exclude.hpp
+++ b/src/exclude.hpp
@@ -36,12 +36,12 @@
 class Exclude
 {
 public:
-  class Error : public Tlv::Error
+  class Error : public tlv::Error
   {
   public:
     explicit
     Error(const std::string& what)
-      : Tlv::Error(what)
+      : tlv::Error(what)
     {
     }
   };
@@ -278,7 +278,7 @@
     {
       if (i->second)
         {
-          totalLength += prependBooleanBlock(block, Tlv::Any);
+          totalLength += prependBooleanBlock(block, tlv::Any);
         }
       if (!i->first.empty())
         {
@@ -287,7 +287,7 @@
     }
 
   totalLength += block.prependVarNumber(totalLength);
-  totalLength += block.prependVarNumber(Tlv::Exclude);
+  totalLength += block.prependVarNumber(tlv::Exclude);
   return totalLength;
 }
 
@@ -317,7 +317,7 @@
   // Any     ::= ANY-TYPE TLV-LENGTH(=0)
 
   Block::element_const_iterator i = m_wire.elements_begin();
-  if (i->type() == Tlv::Any)
+  if (i->type() == tlv::Any)
     {
       appendExclude(name::Component(), true);
       ++i;
@@ -325,7 +325,7 @@
 
   while (i != m_wire.elements_end())
     {
-      if (i->type() != Tlv::NameComponent)
+      if (i->type() != tlv::NameComponent)
         throw Error("Incorrect format of Exclude filter");
 
       name::Component excludedComponent(i->value(), i->value_size());
@@ -333,7 +333,7 @@
 
       if (i != m_wire.elements_end())
         {
-          if (i->type() == Tlv::Any)
+          if (i->type() == tlv::Any)
             {
               appendExclude(excludedComponent, true);
               ++i;
diff --git a/src/face.cpp b/src/face.cpp
index f547f45..e67b9a1 100644
--- a/src/face.cpp
+++ b/src/face.cpp
@@ -384,7 +384,7 @@
 {
   const Block& block = nfd::LocalControlHeader::getPayload(blockFromDaemon);
 
-  if (block.type() == Tlv::Interest)
+  if (block.type() == tlv::Interest)
     {
       shared_ptr<Interest> interest = make_shared<Interest>();
       interest->wireDecode(block);
@@ -393,7 +393,7 @@
 
       m_impl->processInterestFilters(*interest);
     }
-  else if (block.type() == Tlv::Data)
+  else if (block.type() == tlv::Data)
     {
       shared_ptr<Data> data = make_shared<Data>();
       data->wireDecode(block);
diff --git a/src/interest.cpp b/src/interest.cpp
index f5ff57b..8bf60e3 100644
--- a/src/interest.cpp
+++ b/src/interest.cpp
@@ -49,7 +49,7 @@
     std::memcpy(const_cast<uint8_t*>(m_nonce.value()), &nonce, sizeof(nonce));
   }
   else {
-    m_nonce = dataBlock(Tlv::Nonce,
+    m_nonce = dataBlock(tlv::Nonce,
                         reinterpret_cast<const uint8_t*>(&nonce),
                         sizeof(nonce));
     m_wire.reset();
@@ -168,7 +168,7 @@
   if (!publisherPublicKeyLocator.empty()) {
     const Signature& signature = data.getSignature();
     const Block& signatureInfo = signature.getInfo();
-    Block::element_const_iterator it = signatureInfo.find(Tlv::KeyLocator);
+    Block::element_const_iterator it = signatureInfo.find(tlv::KeyLocator);
     if (it == signatureInfo.elements_end()) {
       return false;
     }
@@ -200,14 +200,14 @@
       getInterestLifetime() != DEFAULT_INTEREST_LIFETIME)
     {
       totalLength += prependNonNegativeIntegerBlock(block,
-                                                    Tlv::InterestLifetime,
+                                                    tlv::InterestLifetime,
                                                     getInterestLifetime().count());
     }
 
   // Scope
   if (getScope() >= 0)
     {
-      totalLength += prependNonNegativeIntegerBlock(block, Tlv::Scope, getScope());
+      totalLength += prependNonNegativeIntegerBlock(block, tlv::Scope, getScope());
     }
 
   // Nonce
@@ -224,7 +224,7 @@
   totalLength += getName().wireEncode(block);
 
   totalLength += block.prependVarNumber(totalLength);
-  totalLength += block.prependVarNumber(Tlv::Interest);
+  totalLength += block.prependVarNumber(tlv::Interest);
   return totalLength;
 }
 
@@ -259,14 +259,14 @@
   //                Scope?
   //                InterestLifetime?
 
-  if (m_wire.type() != Tlv::Interest)
-    throw Tlv::Error("Unexpected TLV number when decoding Interest");
+  if (m_wire.type() != tlv::Interest)
+    throw tlv::Error("Unexpected TLV number when decoding Interest");
 
   // Name
-  m_name.wireDecode(m_wire.get(Tlv::Name));
+  m_name.wireDecode(m_wire.get(tlv::Name));
 
   // Selectors
-  Block::element_const_iterator val = m_wire.find(Tlv::Selectors);
+  Block::element_const_iterator val = m_wire.find(tlv::Selectors);
   if (val != m_wire.elements_end())
     {
       m_selectors.wireDecode(*val);
@@ -275,10 +275,10 @@
     m_selectors = Selectors();
 
   // Nonce
-  m_nonce = m_wire.get(Tlv::Nonce);
+  m_nonce = m_wire.get(tlv::Nonce);
 
   // Scope
-  val = m_wire.find(Tlv::Scope);
+  val = m_wire.find(tlv::Scope);
   if (val != m_wire.elements_end())
     {
       m_scope = readNonNegativeInteger(*val);
@@ -287,7 +287,7 @@
     m_scope = -1;
 
   // InterestLifetime
-  val = m_wire.find(Tlv::InterestLifetime);
+  val = m_wire.find(tlv::InterestLifetime);
   if (val != m_wire.elements_end())
     {
       m_interestLifetime = time::milliseconds(readNonNegativeInteger(*val));
diff --git a/src/key-locator.hpp b/src/key-locator.hpp
index 69b458b..33e4584 100644
--- a/src/key-locator.hpp
+++ b/src/key-locator.hpp
@@ -139,7 +139,7 @@
   }
 
   totalLength += block.prependVarNumber(totalLength);
-  totalLength += block.prependVarNumber(Tlv::KeyLocator);
+  totalLength += block.prependVarNumber(tlv::KeyLocator);
   return totalLength;
 }
 
@@ -162,13 +162,13 @@
 inline void
 KeyLocator::wireDecode(const Block& value)
 {
-  if (value.type() != Tlv::KeyLocator)
+  if (value.type() != tlv::KeyLocator)
     throw Error("Unexpected TLV type during KeyLocator decoding");
 
   m_wire = value;
   m_wire.parse();
 
-  if (!m_wire.elements().empty() && m_wire.elements_begin()->type() == Tlv::Name)
+  if (!m_wire.elements().empty() && m_wire.elements_begin()->type() == tlv::Name)
     {
       m_type = KeyLocator_Name;
       m_name.wireDecode(*m_wire.elements_begin());
diff --git a/src/management/nfd-channel-status.hpp b/src/management/nfd-channel-status.hpp
index ca746d7..78a2066 100644
--- a/src/management/nfd-channel-status.hpp
+++ b/src/management/nfd-channel-status.hpp
@@ -39,12 +39,12 @@
 class ChannelStatus
 {
 public:
-  class Error : public Tlv::Error
+  class Error : public tlv::Error
   {
   public:
     explicit
     Error(const std::string& what)
-      : Tlv::Error(what)
+      : tlv::Error(what)
     {
     }
   };
diff --git a/src/management/nfd-control-parameters.hpp b/src/management/nfd-control-parameters.hpp
index b546d5e..82c08ad 100644
--- a/src/management/nfd-control-parameters.hpp
+++ b/src/management/nfd-control-parameters.hpp
@@ -72,12 +72,12 @@
 class ControlParameters
 {
 public:
-  class Error : public Tlv::Error
+  class Error : public tlv::Error
   {
   public:
     explicit
     Error(const std::string& what)
-      : Tlv::Error(what)
+      : tlv::Error(what)
     {
     }
   };
@@ -471,7 +471,7 @@
   m_wire.parse();
   Block::element_const_iterator val;
 
-  val = m_wire.find(Tlv::Name);
+  val = m_wire.find(tlv::Name);
   m_hasFields[CONTROL_PARAMETER_NAME] = val != m_wire.elements_end();
   if (this->hasName()) {
     m_name.wireDecode(*val);
diff --git a/src/management/nfd-control-response.hpp b/src/management/nfd-control-response.hpp
index 5b78405..29aa832 100644
--- a/src/management/nfd-control-response.hpp
+++ b/src/management/nfd-control-response.hpp
@@ -38,12 +38,12 @@
 class ControlResponse
 {
 public:
-  class Error : public Tlv::Error
+  class Error : public tlv::Error
   {
   public:
     explicit
     Error(const std::string& what)
-      : Tlv::Error(what)
+      : tlv::Error(what)
     {
     }
   };
diff --git a/src/management/nfd-controller.cpp b/src/management/nfd-controller.cpp
index 8d82319..3b7056e 100644
--- a/src/management/nfd-controller.cpp
+++ b/src/management/nfd-controller.cpp
@@ -45,7 +45,7 @@
   try {
     response.wireDecode(data.getContent().blockFromValue());
   }
-  catch (ndn::Tlv::Error& e) {
+  catch (ndn::tlv::Error& e) {
     if (static_cast<bool>(onFailure))
       onFailure(serverErrorCode, e.what());
     return;
@@ -63,7 +63,7 @@
   try {
     parameters.wireDecode(response.getBody());
   }
-  catch (ndn::Tlv::Error& e) {
+  catch (ndn::tlv::Error& e) {
     if (static_cast<bool>(onFailure))
       onFailure(serverErrorCode, e.what());
     return;
diff --git a/src/management/nfd-face-event-notification.hpp b/src/management/nfd-face-event-notification.hpp
index 7afb852..a455e57 100644
--- a/src/management/nfd-face-event-notification.hpp
+++ b/src/management/nfd-face-event-notification.hpp
@@ -48,12 +48,12 @@
 class FaceEventNotification : public FaceFlagsTraits<FaceEventNotification>
 {
 public:
-  class Error : public Tlv::Error
+  class Error : public tlv::Error
   {
   public:
     explicit
     Error(const std::string& what)
-      : Tlv::Error(what)
+      : tlv::Error(what)
     {
     }
   };
diff --git a/src/management/nfd-face-status.hpp b/src/management/nfd-face-status.hpp
index 1b33dea..eff9c83 100644
--- a/src/management/nfd-face-status.hpp
+++ b/src/management/nfd-face-status.hpp
@@ -41,12 +41,12 @@
 class FaceStatus : public FaceFlagsTraits<FaceStatus>
 {
 public:
-  class Error : public Tlv::Error
+  class Error : public tlv::Error
   {
   public:
     explicit
     Error(const std::string& what)
-      : Tlv::Error(what)
+      : tlv::Error(what)
     {
     }
   };
diff --git a/src/management/nfd-fib-entry.hpp b/src/management/nfd-fib-entry.hpp
index 77b4369..1086707 100644
--- a/src/management/nfd-fib-entry.hpp
+++ b/src/management/nfd-fib-entry.hpp
@@ -42,10 +42,10 @@
 class NextHopRecord
 {
 public:
-  class Error : public Tlv::Error
+  class Error : public tlv::Error
   {
   public:
-    Error(const std::string& what) : Tlv::Error(what) {}
+    Error(const std::string& what) : tlv::Error(what) {}
   };
 
   NextHopRecord()
@@ -189,10 +189,10 @@
 class FibEntry
 {
 public:
-    class Error : public Tlv::Error
+    class Error : public tlv::Error
     {
     public:
-      Error(const std::string& what) : Tlv::Error(what)
+      Error(const std::string& what) : tlv::Error(what)
       {
       }
     };
@@ -307,7 +307,7 @@
       {
         throw Error("Unexpected end of FibEntry");
       }
-    else if (val->type() != Tlv::Name)
+    else if (val->type() != tlv::Name)
       {
         std::stringstream error;
         error << "Expected Name, but Block is of a different type: #"
diff --git a/src/management/nfd-forwarder-status.hpp b/src/management/nfd-forwarder-status.hpp
index 7dcf2a4..9ac58c4 100644
--- a/src/management/nfd-forwarder-status.hpp
+++ b/src/management/nfd-forwarder-status.hpp
@@ -39,12 +39,12 @@
 class ForwarderStatus
 {
 public:
-  class Error : public Tlv::Error
+  class Error : public tlv::Error
   {
   public:
     explicit
     Error(const std::string& what)
-      : Tlv::Error(what)
+      : tlv::Error(what)
     {
     }
   };
@@ -314,7 +314,7 @@
                                                 m_nfdVersion);
 
   totalLength += encoder.prependVarNumber(totalLength);
-  totalLength += encoder.prependVarNumber(Tlv::Content);
+  totalLength += encoder.prependVarNumber(tlv::Content);
   return totalLength;
 }
 
@@ -337,7 +337,7 @@
 inline void
 ForwarderStatus::wireDecode(const Block& block)
 {
-  if (block.type() != Tlv::Content) {
+  if (block.type() != tlv::Content) {
     throw Error("expecting Content block for Status payload");
   }
   m_wire = block;
diff --git a/src/management/nfd-rib-entry.cpp b/src/management/nfd-rib-entry.cpp
index d075cc6..f97fa66 100644
--- a/src/management/nfd-rib-entry.cpp
+++ b/src/management/nfd-rib-entry.cpp
@@ -266,7 +266,7 @@
 
   Block::element_const_iterator val = m_wire.elements_begin();
 
-  if (val != m_wire.elements_end() && val->type() == Tlv::Name) {
+  if (val != m_wire.elements_end() && val->type() == tlv::Name) {
     m_prefix.wireDecode(*val);
     ++val;
   }
diff --git a/src/management/nfd-rib-entry.hpp b/src/management/nfd-rib-entry.hpp
index 9ea84c2..738b8f5 100644
--- a/src/management/nfd-rib-entry.hpp
+++ b/src/management/nfd-rib-entry.hpp
@@ -52,11 +52,11 @@
 class Route
 {
 public:
-  class Error : public Tlv::Error
+  class Error : public tlv::Error
   {
   public:
     explicit
-    Error(const std::string& what) : Tlv::Error(what)
+    Error(const std::string& what) : tlv::Error(what)
     {
     }
   };
@@ -187,10 +187,10 @@
 class RibEntry
 {
 public:
-  class Error : public Tlv::Error
+  class Error : public tlv::Error
   {
   public:
-    Error(const std::string& what) : Tlv::Error(what)
+    Error(const std::string& what) : tlv::Error(what)
     {
     }
   };
diff --git a/src/management/nfd-strategy-choice.hpp b/src/management/nfd-strategy-choice.hpp
index 531d1d1..2d9bbd5 100644
--- a/src/management/nfd-strategy-choice.hpp
+++ b/src/management/nfd-strategy-choice.hpp
@@ -38,12 +38,12 @@
 class StrategyChoice
 {
 public:
-  class Error : public Tlv::Error
+  class Error : public tlv::Error
   {
   public:
     explicit
     Error(const std::string& what)
-      : Tlv::Error(what)
+      : tlv::Error(what)
     {
     }
   };
@@ -145,7 +145,7 @@
   m_wire.parse();
   Block::element_const_iterator val = m_wire.elements_begin();
 
-  if (val != m_wire.elements_end() && val->type() == Tlv::Name) {
+  if (val != m_wire.elements_end() && val->type() == tlv::Name) {
     m_name.wireDecode(*val);
     ++val;
   }
diff --git a/src/meta-info.hpp b/src/meta-info.hpp
index abb9208..04cded1 100644
--- a/src/meta-info.hpp
+++ b/src/meta-info.hpp
@@ -142,24 +142,24 @@
   // FinalBlockId
   if (!m_finalBlockId.empty())
     {
-      totalLength += prependNestedBlock(blk, Tlv::FinalBlockId, m_finalBlockId);
+      totalLength += prependNestedBlock(blk, tlv::FinalBlockId, m_finalBlockId);
     }
 
   // FreshnessPeriod
   if (m_freshnessPeriod >= time::milliseconds::zero())
     {
-      totalLength += prependNonNegativeIntegerBlock(blk, Tlv::FreshnessPeriod,
+      totalLength += prependNonNegativeIntegerBlock(blk, tlv::FreshnessPeriod,
                                                     m_freshnessPeriod.count());
     }
 
   // ContentType
   if (m_type != TYPE_DEFAULT)
     {
-      totalLength += prependNonNegativeIntegerBlock(blk, Tlv::ContentType, m_type);
+      totalLength += prependNonNegativeIntegerBlock(blk, tlv::ContentType, m_type);
     }
 
   totalLength += blk.prependVarNumber(totalLength);
-  totalLength += blk.prependVarNumber(Tlv::MetaInfo);
+  totalLength += blk.prependVarNumber(tlv::MetaInfo);
   return totalLength;
 }
 
@@ -190,7 +190,7 @@
   //                FreshnessPeriod?
 
   // ContentType
-  Block::element_const_iterator val = m_wire.find(Tlv::ContentType);
+  Block::element_const_iterator val = m_wire.find(tlv::ContentType);
   if (val != m_wire.elements().end())
     {
       m_type = readNonNegativeInteger(*val);
@@ -199,7 +199,7 @@
     m_type = TYPE_DEFAULT;
 
   // FreshnessPeriod
-  val = m_wire.find(Tlv::FreshnessPeriod);
+  val = m_wire.find(tlv::FreshnessPeriod);
   if (val != m_wire.elements().end())
     {
       m_freshnessPeriod = time::milliseconds(readNonNegativeInteger(*val));
@@ -208,11 +208,11 @@
     m_freshnessPeriod = time::milliseconds::min();
 
   // FinalBlockId
-  val = m_wire.find(Tlv::FinalBlockId);
+  val = m_wire.find(tlv::FinalBlockId);
   if (val != m_wire.elements().end())
     {
       m_finalBlockId = val->blockFromValue();
-      if (m_finalBlockId.type() != Tlv::NameComponent)
+      if (m_finalBlockId.type() != tlv::NameComponent)
         {
           /// @todo May or may not throw exception later...
           m_finalBlockId.reset();
diff --git a/src/name-component.hpp b/src/name-component.hpp
index 0e17580..a9be6a8 100644
--- a/src/name-component.hpp
+++ b/src/name-component.hpp
@@ -62,8 +62,8 @@
   /**
    * @brief Create name::Component from a wire block
    *
-   * @param wire Tlv::NameComponent Block from which to create name::Component
-   * @throws Error if wire.type() is not Tlv::NameComponent
+   * @param wire tlv::NameComponent Block from which to create name::Component
+   * @throws Error if wire.type() is not tlv::NameComponent
    *
    * Any block can be implicitly converted to name::Component
    */
@@ -74,7 +74,7 @@
    *
    * @param buffer A pointer to an immutable buffer
    *
-   * This constructor will create a new Tlv::NameComponent Block with `buffer` as a payload.
+   * This constructor will create a new tlv::NameComponent Block with `buffer` as a payload.
    * Note that this method **will not** allocate new memory for and copy the payload until
    * toWire() method is called.
    */
@@ -85,7 +85,7 @@
    * @brief Create a new name::Component from the buffer (data from buffer will be copied)
    * @param buffer A reference to the buffer
    *
-   * This constructor will create a new Tlv::NameComponent Block with `buffer` as a payload.
+   * This constructor will create a new tlv::NameComponent Block with `buffer` as a payload.
    * Note that this method **will** allocate new memory for and copy the payload.
    */
   explicit
@@ -96,7 +96,7 @@
    * @param buffer     A pointer to the first byte of the buffer
    * @param bufferSize Size of the buffer
    *
-   * This constructor will create a new Tlv::NameComponent Block with `buffer` as a payload.
+   * This constructor will create a new tlv::NameComponent Block with `buffer` as a payload.
    * Note that this method **will** allocate new memory for and copy the payload.
    */
   Component(const uint8_t* buffer, size_t bufferSize);
@@ -106,7 +106,7 @@
    * @param begin Iterator pointing to the beginning of the buffer
    * @param end   Iterator pointing to the ending of the buffer
    *
-   * This constructor will create a new Tlv::NameComponent Block with `buffer` as a payload.
+   * This constructor will create a new tlv::NameComponent Block with `buffer` as a payload.
    * Note that this method **will** allocate new memory for and copy the payload.
    */
   template<class InputIterator>
@@ -118,7 +118,7 @@
    * @param str Zero-ended string.  Note that this string will be interpreted as is (i.e.,
    *            it will not be interpreted as URI)
    *
-   * This constructor will create a new Tlv::NameComponent Block with `buffer` as a payload.
+   * This constructor will create a new tlv::NameComponent Block with `buffer` as a payload.
    * Note that this method **will** allocate new memory for and copy the payload.
    */
   explicit
@@ -130,7 +130,7 @@
    * @param str Const reference to STL string.  Note that this string will be interpreted
    *            as is (i.e., it will not be interpreted as URI)
    *
-   * This constructor will create a new Tlv::NameComponent Block with `buffer` as a payload.
+   * This constructor will create a new tlv::NameComponent Block with `buffer` as a payload.
    * Note that this method **will** allocate new memory for and copy the payload.
    */
   explicit
@@ -410,7 +410,7 @@
 
 inline
 Component::Component()
-  : Block(Tlv::NameComponent)
+  : Block(tlv::NameComponent)
 {
 }
 
@@ -418,44 +418,44 @@
 Component::Component(const Block& wire)
   : Block(wire)
 {
-  if (type() != Tlv::NameComponent)
+  if (type() != tlv::NameComponent)
     throw Error("Constructing name component from non name component TLV wire block");
 }
 
 inline
 Component::Component(const ConstBufferPtr& buffer)
-  : Block(Tlv::NameComponent, buffer)
+  : Block(tlv::NameComponent, buffer)
 {
 }
 
 inline
 Component::Component(const Buffer& value)
-  : Block(dataBlock(Tlv::NameComponent, value.buf(), value.size()))
+  : Block(dataBlock(tlv::NameComponent, value.buf(), value.size()))
 {
 }
 
 inline
 Component::Component(const uint8_t* value, size_t valueLen)
-  : Block(dataBlock(Tlv::NameComponent, value, valueLen))
+  : Block(dataBlock(tlv::NameComponent, value, valueLen))
 {
 }
 
 template<class InputIterator>
 inline
 Component::Component(InputIterator begin, InputIterator end)
-  : Block(dataBlock(Tlv::NameComponent, begin, end))
+  : Block(dataBlock(tlv::NameComponent, begin, end))
 {
 }
 
 inline
 Component::Component(const char* str)
-  : Block(dataBlock(Tlv::NameComponent, str, ::strlen(str)))
+  : Block(dataBlock(tlv::NameComponent, str, ::strlen(str)))
 {
 }
 
 inline
 Component::Component(const std::string& str)
-  : Block(dataBlock(Tlv::NameComponent, str.c_str(), str.size()))
+  : Block(dataBlock(tlv::NameComponent, str.c_str(), str.size()))
 {
 }
 
@@ -528,15 +528,15 @@
 inline Component
 Component::fromNumber(uint64_t number)
 {
-  /// \todo Change to Tlv::NumberComponent
-  return nonNegativeIntegerBlock(Tlv::NameComponent, number);
+  /// \todo Change to tlv::NumberComponent
+  return nonNegativeIntegerBlock(tlv::NameComponent, number);
 }
 
 
 inline uint64_t
 Component::toNumber() const
 {
-  /// \todo Check if Component is of Tlv::NumberComponent type
+  /// \todo Check if Component is of tlv::NumberComponent type
   return readNonNegativeInteger(static_cast<const Block&>(*this));
 }
 
@@ -592,7 +592,7 @@
   }
 
   totalLength += encoder.prependVarNumber(totalLength);
-  totalLength += encoder.prependVarNumber(Tlv::NameComponent);
+  totalLength += encoder.prependVarNumber(tlv::NameComponent);
 
   return encoder.block();
 }
@@ -606,7 +606,7 @@
   if (value_size() > 0)
     totalLength += block.prependByteArray(value(), value_size());
   totalLength += block.prependVarNumber(value_size());
-  totalLength += block.prependVarNumber(Tlv::NameComponent);
+  totalLength += block.prependVarNumber(tlv::NameComponent);
   return totalLength;
 }
 
@@ -629,7 +629,7 @@
 inline void
 Component::wireDecode(const Block& wire)
 {
-  if (wire.type() != Tlv::NameComponent)
+  if (wire.type() != tlv::NameComponent)
     throw Error("wireDecode name component from non name component TLV wire block");
 
   *this = wire;
diff --git a/src/name.hpp b/src/name.hpp
index 7522a19..0e8c840 100644
--- a/src/name.hpp
+++ b/src/name.hpp
@@ -77,7 +77,7 @@
    * Create a new Name with no components.
    */
   Name()
-    : m_nameBlock(Tlv::Name)
+    : m_nameBlock(tlv::Name)
   {
   }
 
@@ -198,10 +198,10 @@
   Name&
   append(const Block& value)
   {
-    if (value.type() == Tlv::NameComponent)
+    if (value.type() == tlv::NameComponent)
       m_nameBlock.push_back(value);
     else
-      m_nameBlock.push_back(Block(Tlv::NameComponent, value));
+      m_nameBlock.push_back(Block(tlv::NameComponent, value));
 
     return *this;
   }
@@ -220,7 +220,7 @@
   void
   clear()
   {
-    m_nameBlock = Block(Tlv::Name);
+    m_nameBlock = Block(tlv::Name);
   }
 
   /**
@@ -752,7 +752,7 @@
     }
 
   totalLength += blk.prependVarNumber(totalLength);
-  totalLength += blk.prependVarNumber(Tlv::Name);
+  totalLength += blk.prependVarNumber(tlv::Name);
   return totalLength;
 }
 
@@ -777,8 +777,8 @@
 inline void
 Name::wireDecode(const Block& wire)
 {
-  if (wire.type() != Tlv::Name)
-    throw Tlv::Error("Unexpected TLV type when decoding Name");
+  if (wire.type() != tlv::Name)
+    throw tlv::Error("Unexpected TLV type when decoding Name");
 
   m_nameBlock = wire;
   m_nameBlock.parse();
diff --git a/src/security/conf/checker.hpp b/src/security/conf/checker.hpp
index 9284191..040d343 100644
--- a/src/security/conf/checker.hpp
+++ b/src/security/conf/checker.hpp
@@ -99,15 +99,15 @@
   {
     switch (sigType)
       {
-      case Tlv::SignatureSha256WithRsa:
-      case Tlv::SignatureSha256WithEcdsa:
+      case tlv::SignatureSha256WithRsa:
+      case tlv::SignatureSha256WithEcdsa:
         {
           if (!static_cast<bool>(m_keyLocatorChecker))
             throw Error("Strong signature requires KeyLocatorChecker");
 
           return;
         }
-      case Tlv::DigestSha256:
+      case tlv::DigestSha256:
         return;
       default:
         throw Error("Unsupported signature type");
@@ -139,7 +139,7 @@
         onValidationFailed(interest.shared_from_this(), "Invalid signature");
         return -1;
       }
-    catch (Tlv::Error& e)
+    catch (tlv::Error& e)
       {
         onValidationFailed(interest.shared_from_this(), "Cannot decode signature related TLVs");
         return -1;
@@ -163,15 +163,15 @@
         return -1;
       }
 
-    if (signature.getType() == Tlv::DigestSha256)
+    if (signature.getType() == tlv::DigestSha256)
       return 0;
 
     try
       {
         switch (signature.getType())
           {
-          case Tlv::SignatureSha256WithRsa:
-          case Tlv::SignatureSha256WithEcdsa:
+          case tlv::SignatureSha256WithRsa:
+          case tlv::SignatureSha256WithEcdsa:
             {
               if (!signature.hasKeyLocator()) {
                 onValidationFailed(packet.shared_from_this(),
@@ -188,7 +188,7 @@
             }
           }
       }
-    catch (Tlv::Error& e)
+    catch (tlv::Error& e)
       {
         onValidationFailed(packet.shared_from_this(),
                            "Cannot decode signature");
@@ -241,8 +241,8 @@
          it != signers.end(); it++)
       m_signers[(*it)->getName().getPrefix(-1)] = (*it);
 
-    if (sigType != Tlv::SignatureSha256WithRsa &&
-        sigType != Tlv::SignatureSha256WithEcdsa)
+    if (sigType != tlv::SignatureSha256WithRsa &&
+        sigType != tlv::SignatureSha256WithEcdsa)
       {
         throw Error("FixedSigner is only meaningful for strong signature type");
       }
@@ -274,7 +274,7 @@
         onValidationFailed(interest.shared_from_this(), "Invalid signature");
         return -1;
       }
-    catch (Tlv::Error& e)
+    catch (tlv::Error& e)
       {
         onValidationFailed(interest.shared_from_this(), "Cannot decode signature related TLVs");
         return -1;
@@ -298,7 +298,7 @@
         return -1;
       }
 
-    if (signature.getType() == Tlv::DigestSha256)
+    if (signature.getType() == tlv::DigestSha256)
       {
         onValidationFailed(packet.shared_from_this(),
                            "FixedSigner does not allow Sha256 signature type");
@@ -309,8 +309,8 @@
       {
         switch (signature.getType())
           {
-          case Tlv::SignatureSha256WithRsa:
-          case Tlv::SignatureSha256WithEcdsa:
+          case tlv::SignatureSha256WithRsa:
+          case tlv::SignatureSha256WithEcdsa:
             {
               if (!signature.hasKeyLocator()) {
                 onValidationFailed(packet.shared_from_this(),
@@ -356,7 +356,7 @@
                            "KeyLocator does not have name");
         return -1;
       }
-    catch (Tlv::Error& e)
+    catch (tlv::Error& e)
       {
         onValidationFailed(packet.shared_from_this(),
                            "Cannot decode signature");
@@ -546,11 +546,11 @@
   getSigType(const std::string& sigType)
   {
     if (boost::iequals(sigType, "rsa-sha256"))
-      return Tlv::SignatureSha256WithRsa;
+      return tlv::SignatureSha256WithRsa;
     else if (boost::iequals(sigType, "ecdsa-sha256"))
-      return Tlv::SignatureSha256WithEcdsa;
+      return tlv::SignatureSha256WithEcdsa;
     else if (boost::iequals(sigType, "sha256"))
-      return Tlv::DigestSha256;
+      return tlv::DigestSha256;
     else
       throw Error("Unsupported signature type");
   }
diff --git a/src/security/digest-sha256.cpp b/src/security/digest-sha256.cpp
index 6d450a2..3af551a 100644
--- a/src/security/digest-sha256.cpp
+++ b/src/security/digest-sha256.cpp
@@ -24,14 +24,14 @@
 namespace ndn {
 
 DigestSha256::DigestSha256()
-  : Signature(SignatureInfo(Tlv::DigestSha256))
+  : Signature(SignatureInfo(tlv::DigestSha256))
 {
 }
 
 DigestSha256::DigestSha256(const Signature& signature)
   : Signature(signature)
 {
-  if (getType() != Tlv::DigestSha256)
+  if (getType() != tlv::DigestSha256)
     throw Error("Incorrect signature type");
 }
 
diff --git a/src/security/key-chain.cpp b/src/security/key-chain.cpp
index 180d37d..1809079 100644
--- a/src/security/key-chain.cpp
+++ b/src/security/key-chain.cpp
@@ -550,7 +550,7 @@
   DigestSha256 sig;
   data.setSignature(sig);
 
-  Block sigValue(Tlv::SignatureValue,
+  Block sigValue(tlv::SignatureValue,
                  crypto::sha256(data.wireEncode().value(),
                                 data.wireEncode().value_size() -
                                 data.getSignature().getValue().size()));
diff --git a/src/security/sec-public-info-sqlite3.cpp b/src/security/sec-public-info-sqlite3.cpp
index 774dfb3..0c70d02 100644
--- a/src/security/sec-public-info-sqlite3.cpp
+++ b/src/security/sec-public-info-sqlite3.cpp
@@ -485,7 +485,7 @@
       std::string signerName = certificate.getSignature().getKeyLocator().getName().toUri();
       sqlite3_bind_text(statement, 2, signerName, SQLITE_TRANSIENT);
     }
-  catch (Tlv::Error& e)
+  catch (tlv::Error& e)
     {
       return;
     }
diff --git a/src/security/sec-rule-relative.cpp b/src/security/sec-rule-relative.cpp
index 42272bc..958eb66 100644
--- a/src/security/sec-rule-relative.cpp
+++ b/src/security/sec-rule-relative.cpp
@@ -69,7 +69,7 @@
       const Name& signerName = keyLocator.getName();
       return satisfy(dataName, signerName);
     }
-  catch (Tlv::Error& e)
+  catch (tlv::Error& e)
     {
       return false;
     }
@@ -120,7 +120,7 @@
       const Name& signerName = keyLocator.getName();
       return m_signerNameRegex.match(signerName);
     }
-  catch (Tlv::Error& e)
+  catch (tlv::Error& e)
     {
       return false;
     }
diff --git a/src/security/sec-rule-specific.cpp b/src/security/sec-rule-specific.cpp
index af89e91..cb7adf4 100644
--- a/src/security/sec-rule-specific.cpp
+++ b/src/security/sec-rule-specific.cpp
@@ -76,7 +76,7 @@
       const Name& signerName = keyLocator.getName();
       return m_signerRegex->match(signerName);
     }
-  catch (Tlv::Error& e)
+  catch (tlv::Error& e)
     {
       return false;
     }
diff --git a/src/security/sec-tpm-file.cpp b/src/security/sec-tpm-file.cpp
index 03ce634..7d0748d 100644
--- a/src/security/sec-tpm-file.cpp
+++ b/src/security/sec-tpm-file.cpp
@@ -332,7 +332,7 @@
                                  true,
                                  new SignerFilter(rng, signer, new FileSink(os)));
 
-                    return Block(Tlv::SignatureValue, os.buf());
+                    return Block(tlv::SignatureValue, os.buf());
                   }
                 default:
                   throw Error("Unsupported digest algorithm!");
@@ -368,7 +368,7 @@
 
                   shared_ptr<Buffer> sigBuffer = make_shared<Buffer>(buf, bufSize);
 
-                  return Block(Tlv::SignatureValue, sigBuffer);
+                  return Block(tlv::SignatureValue, sigBuffer);
                 }
               default:
                 throw Error("Unsupported digest algorithm!");
diff --git a/src/security/sec-tpm-osx.cpp b/src/security/sec-tpm-osx.cpp
index 3064d84..9f722fd 100644
--- a/src/security/sec-tpm-osx.cpp
+++ b/src/security/sec-tpm-osx.cpp
@@ -868,7 +868,7 @@
   if (signature.get() == 0)
     throw Error("Signature is NULL!\n");
 
-  return Block(Tlv::SignatureValue,
+  return Block(tlv::SignatureValue,
                make_shared<Buffer>(CFDataGetBytePtr(signature.get()),
                                    CFDataGetLength(signature.get())));
 }
diff --git a/src/security/signature-sha256-with-ecdsa.cpp b/src/security/signature-sha256-with-ecdsa.cpp
index 91b4a29..642912b 100644
--- a/src/security/signature-sha256-with-ecdsa.cpp
+++ b/src/security/signature-sha256-with-ecdsa.cpp
@@ -24,14 +24,14 @@
 namespace ndn {
 
 SignatureSha256WithEcdsa::SignatureSha256WithEcdsa(const KeyLocator& keyLocator)
-  : Signature(SignatureInfo(Tlv::SignatureSha256WithEcdsa, keyLocator))
+  : Signature(SignatureInfo(tlv::SignatureSha256WithEcdsa, keyLocator))
 {
 }
 
 SignatureSha256WithEcdsa::SignatureSha256WithEcdsa(const Signature& signature)
   : Signature(signature)
 {
-  if (getType() != Tlv::SignatureSha256WithEcdsa)
+  if (getType() != tlv::SignatureSha256WithEcdsa)
     throw Error("Incorrect signature type");
 
   if (!hasKeyLocator()) {
diff --git a/src/security/signature-sha256-with-rsa.cpp b/src/security/signature-sha256-with-rsa.cpp
index 3c84b54..cda06e6 100644
--- a/src/security/signature-sha256-with-rsa.cpp
+++ b/src/security/signature-sha256-with-rsa.cpp
@@ -24,14 +24,14 @@
 namespace ndn {
 
 SignatureSha256WithRsa::SignatureSha256WithRsa(const KeyLocator& keyLocator)
-  : Signature(SignatureInfo(Tlv::SignatureSha256WithRsa, keyLocator))
+  : Signature(SignatureInfo(tlv::SignatureSha256WithRsa, keyLocator))
 {
 }
 
 SignatureSha256WithRsa::SignatureSha256WithRsa(const Signature& signature)
   : Signature(signature)
 {
-  if (getType() != Tlv::SignatureSha256WithRsa)
+  if (getType() != tlv::SignatureSha256WithRsa)
     throw Error("Incorrect signature type");
 
   if (!hasKeyLocator()) {
diff --git a/src/security/validator-config.cpp b/src/security/validator-config.cpp
index 387cfe0..83b7a62 100644
--- a/src/security/validator-config.cpp
+++ b/src/security/validator-config.cpp
@@ -537,7 +537,7 @@
       return onValidationFailed(interest.shared_from_this(),
                                 "No valid signature");
     }
-  catch (Tlv::Error& e)
+  catch (tlv::Error& e)
     {
       return onValidationFailed(interest.shared_from_this(),
                                 "Cannot decode signature");
@@ -569,7 +569,7 @@
         time::fromUnixTimestamp(
           time::milliseconds(interestName.get(-signed_interest::MIN_LENGTH).toNumber()));
     }
-  catch (Tlv::Error& e)
+  catch (tlv::Error& e)
     {
       return onValidationFailed(interest,
                                 "Cannot decode signature related TLVs");
diff --git a/src/security/validator-config.hpp b/src/security/validator-config.hpp
index d3e4be4..69f626d 100644
--- a/src/security/validator-config.hpp
+++ b/src/security/validator-config.hpp
@@ -293,7 +293,7 @@
                                 const OnFailed& onValidationFailed,
                                 std::vector<shared_ptr<ValidationRequest> >& nextSteps)
 {
-  if (signature.getType() == Tlv::DigestSha256)
+  if (signature.getType() == tlv::DigestSha256)
     {
       DigestSha256 sigSha256(signature);
 
@@ -306,8 +306,8 @@
 
   try {
     switch (signature.getType()) {
-    case Tlv::SignatureSha256WithRsa:
-    case Tlv::SignatureSha256WithEcdsa:
+    case tlv::SignatureSha256WithRsa:
+    case tlv::SignatureSha256WithEcdsa:
       {
         if (!signature.hasKeyLocator()) {
           return onValidationFailed(packet.shared_from_this(),
@@ -320,7 +320,7 @@
                               "Unsupported signature type");
     }
   }
-  catch (Tlv::Error& e) {
+  catch (tlv::Error& e) {
     return onValidationFailed(packet.shared_from_this(),
                               "Cannot decode public key signature");
   }
diff --git a/src/security/validator-regex.cpp b/src/security/validator-regex.cpp
index 97f796c..194aaf1 100644
--- a/src/security/validator-regex.cpp
+++ b/src/security/validator-regex.cpp
@@ -161,7 +161,7 @@
                   return;
                 }
             }
-          catch (Tlv::Error& e)
+          catch (tlv::Error& e)
             {
               return onValidationFailed(data.shared_from_this(),
                                         "Cannot decode signature");
diff --git a/src/security/validator.cpp b/src/security/validator.cpp
index 2bc9364..de8c311 100644
--- a/src/security/validator.cpp
+++ b/src/security/validator.cpp
@@ -170,7 +170,7 @@
 
       switch (sig.getType())
         {
-        case Tlv::SignatureSha256WithRsa:
+        case tlv::SignatureSha256WithRsa:
           {
             if (key.getKeyType() != KEY_TYPE_RSA)
               return false;
@@ -185,7 +185,7 @@
             return verifier.VerifyMessage(buf, size,
                                           sig.getValue().value(), sig.getValue().value_size());
           }
-        case Tlv::SignatureSha256WithEcdsa:
+        case tlv::SignatureSha256WithEcdsa:
           {
             if (key.getKeyType() != KEY_TYPE_ECDSA)
               return false;
diff --git a/src/selectors.hpp b/src/selectors.hpp
index b180309..e09acea 100644
--- a/src/selectors.hpp
+++ b/src/selectors.hpp
@@ -241,13 +241,13 @@
   // MustBeFresh
   if (getMustBeFresh())
     {
-      totalLength += prependBooleanBlock(block, Tlv::MustBeFresh);
+      totalLength += prependBooleanBlock(block, tlv::MustBeFresh);
     }
 
   // ChildSelector
   if (getChildSelector() >= 0)
     {
-      totalLength += prependNonNegativeIntegerBlock(block, Tlv::ChildSelector, getChildSelector());
+      totalLength += prependNonNegativeIntegerBlock(block, tlv::ChildSelector, getChildSelector());
     }
 
   // Exclude
@@ -265,19 +265,19 @@
   // MaxSuffixComponents
   if (getMaxSuffixComponents() >= 0)
     {
-      totalLength += prependNonNegativeIntegerBlock(block, Tlv::MaxSuffixComponents,
+      totalLength += prependNonNegativeIntegerBlock(block, tlv::MaxSuffixComponents,
                                                     getMaxSuffixComponents());
     }
 
   // MinSuffixComponents
   if (getMinSuffixComponents() >= 0)
     {
-      totalLength += prependNonNegativeIntegerBlock(block, Tlv::MinSuffixComponents,
+      totalLength += prependNonNegativeIntegerBlock(block, tlv::MinSuffixComponents,
                                                     getMinSuffixComponents());
     }
 
   totalLength += block.prependVarNumber(totalLength);
-  totalLength += block.prependVarNumber(Tlv::Selectors);
+  totalLength += block.prependVarNumber(tlv::Selectors);
   return totalLength;
 }
 
@@ -300,8 +300,8 @@
 inline void
 Selectors::wireDecode(const Block& wire)
 {
-  if (wire.type() != Tlv::Selectors)
-    throw Tlv::Error("Unexpected TLV type when decoding Selectors");
+  if (wire.type() != tlv::Selectors)
+    throw tlv::Error("Unexpected TLV type when decoding Selectors");
 
   *this = Selectors();
 
@@ -309,42 +309,42 @@
   m_wire.parse();
 
   // MinSuffixComponents
-  Block::element_const_iterator val = m_wire.find(Tlv::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);
+  val = m_wire.find(tlv::MaxSuffixComponents);
   if (val != m_wire.elements_end())
     {
       m_maxSuffixComponents = readNonNegativeInteger(*val);
     }
 
   // PublisherPublicKeyLocator
-  val = m_wire.find(Tlv::KeyLocator);
+  val = m_wire.find(tlv::KeyLocator);
   if (val != m_wire.elements_end())
     {
       m_publisherPublicKeyLocator.wireDecode(*val);
     }
 
   // Exclude
-  val = m_wire.find(Tlv::Exclude);
+  val = m_wire.find(tlv::Exclude);
   if (val != m_wire.elements_end())
     {
       m_exclude.wireDecode(*val);
     }
 
   // ChildSelector
-  val = m_wire.find(Tlv::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);
+  val = m_wire.find(tlv::MustBeFresh);
   if (val != m_wire.elements_end())
     {
       m_mustBeFresh = true;
diff --git a/src/signature-info.cpp b/src/signature-info.cpp
index 20e013f..469bdee 100644
--- a/src/signature-info.cpp
+++ b/src/signature-info.cpp
@@ -30,13 +30,13 @@
 {
 }
 
-SignatureInfo::SignatureInfo(Tlv::SignatureTypeValue type)
+SignatureInfo::SignatureInfo(tlv::SignatureTypeValue type)
   : m_type(type)
   , m_hasKeyLocator(false)
 {
 }
 
-SignatureInfo::SignatureInfo(Tlv::SignatureTypeValue type, const KeyLocator& keyLocator)
+SignatureInfo::SignatureInfo(tlv::SignatureTypeValue type, const KeyLocator& keyLocator)
   : m_type(type)
   , m_hasKeyLocator(true)
   , m_keyLocator(keyLocator)
@@ -49,7 +49,7 @@
 }
 
 void
-SignatureInfo::setSignatureType(Tlv::SignatureTypeValue type)
+SignatureInfo::setSignatureType(tlv::SignatureTypeValue type)
 {
   m_wire.reset();
   m_type = type;
@@ -114,10 +114,10 @@
   if (m_hasKeyLocator)
     totalLength += m_keyLocator.wireEncode(block);
 
-  totalLength += prependNonNegativeIntegerBlock(block, Tlv::SignatureType, m_type);
+  totalLength += prependNonNegativeIntegerBlock(block, tlv::SignatureType, m_type);
 
   totalLength += block.prependVarNumber(totalLength);
-  totalLength += block.prependVarNumber(Tlv::SignatureInfo);
+  totalLength += block.prependVarNumber(tlv::SignatureInfo);
   return totalLength;
 }
 
@@ -156,13 +156,13 @@
   m_wire = wire;
   m_wire.parse();
 
-  if (m_wire.type() != Tlv::SignatureInfo)
-    throw Tlv::Error("Unexpected TLV type when decoding Name");
+  if (m_wire.type() != tlv::SignatureInfo)
+    throw tlv::Error("Unexpected TLV type when decoding Name");
 
   Block::element_const_iterator it = m_wire.elements_begin();
 
   // the first block must be SignatureType
-  if (it != m_wire.elements_end() && it->type() == Tlv::SignatureType) {
+  if (it != m_wire.elements_end() && it->type() == tlv::SignatureType) {
     m_type = readNonNegativeInteger(*it);
     it++;
   }
@@ -170,7 +170,7 @@
     throw Error("SignatureInfo does not have sub-TLV or the first sub-TLV is not SignatureType");
 
   // the second block could be KeyLocator
-  if (it != m_wire.elements_end() && it->type() == Tlv::KeyLocator) {
+  if (it != m_wire.elements_end() && it->type() == tlv::KeyLocator) {
     m_keyLocator.wireDecode(*it);
     m_hasKeyLocator = true;
     it++;
diff --git a/src/signature-info.hpp b/src/signature-info.hpp
index 4ef60fc..5dcdcff 100644
--- a/src/signature-info.hpp
+++ b/src/signature-info.hpp
@@ -31,12 +31,12 @@
 class SignatureInfo
 {
 public:
-  class Error : public Tlv::Error
+  class Error : public tlv::Error
   {
   public:
     explicit
     Error(const std::string& what)
-      : Tlv::Error(what)
+      : tlv::Error(what)
     {
     }
   };
@@ -44,21 +44,21 @@
   SignatureInfo();
 
   explicit
-  SignatureInfo(Tlv::SignatureTypeValue type);
+  SignatureInfo(tlv::SignatureTypeValue type);
 
-  SignatureInfo(Tlv::SignatureTypeValue type, const KeyLocator& keyLocator);
+  SignatureInfo(tlv::SignatureTypeValue type, const KeyLocator& keyLocator);
 
   /**
    * @brief Generate SignatureInfo from a block
    *
-   * @throws Tlv::Error if supplied block is not formatted correctly
+   * @throws tlv::Error if supplied block is not formatted correctly
    */
   explicit
   SignatureInfo(const Block& block);
 
   /// @brief Set SignatureType
   void
-  setSignatureType(Tlv::SignatureTypeValue type);
+  setSignatureType(tlv::SignatureTypeValue type);
 
   /// @brief Get SignatureType
   int32_t
diff --git a/src/signature.hpp b/src/signature.hpp
index c2cb8c2..9d7749b 100644
--- a/src/signature.hpp
+++ b/src/signature.hpp
@@ -33,21 +33,21 @@
 class Signature
 {
 public:
-  class Error : public Tlv::Error
+  class Error : public tlv::Error
   {
   public:
     explicit
     Error(const std::string& what)
-      : Tlv::Error(what)
+      : tlv::Error(what)
     {
     }
   };
 
-  /// @deprecated use Tlv::SignatureTypeValue instead.
+  /// @deprecated use tlv::SignatureTypeValue instead.
   enum {
-    Sha256 = Tlv::DigestSha256,
-    Sha256WithRsa = Tlv::SignatureSha256WithRsa,
-    Sha256WithEcdsa = Tlv::SignatureSha256WithEcdsa
+    Sha256 = tlv::DigestSha256,
+    Sha256WithRsa = tlv::SignatureSha256WithRsa,
+    Sha256WithEcdsa = tlv::SignatureSha256WithEcdsa
   };
 
   Signature()
@@ -75,7 +75,7 @@
   /**
    * @brief Set SignatureInfo from a block
    *
-   * @throws Tlv::Error if supplied block is not formatted correctly
+   * @throws tlv::Error if supplied block is not formatted correctly
    */
   void
   setInfo(const Block& info);
diff --git a/src/util/command-interest-validator.hpp b/src/util/command-interest-validator.hpp
index d132231..689b450 100644
--- a/src/util/command-interest-validator.hpp
+++ b/src/util/command-interest-validator.hpp
@@ -177,7 +177,7 @@
       Signature signature(interestName[POS_SIG_INFO].blockFromValue(),
                           interestName[POS_SIG_VALUE].blockFromValue());
 
-      if (signature.getType() != Tlv::SignatureSha256WithRsa)
+      if (signature.getType() != tlv::SignatureSha256WithRsa)
         return onValidationFailed(interest.shared_from_this(),
                                   "Require SignatureSha256WithRsa");
 
@@ -265,7 +265,7 @@
       return onValidationFailed(interest.shared_from_this(),
                                 "Cannot locate the signing key");
     }
-  catch (Tlv::Error& e)
+  catch (tlv::Error& e)
     {
       return onValidationFailed(interest.shared_from_this(),
                                 "Cannot decode signature related TLVs");
diff --git a/src/util/io.hpp b/src/util/io.hpp
index 8e81aca..09ed90c 100644
--- a/src/util/io.hpp
+++ b/src/util/io.hpp
@@ -93,7 +93,7 @@
     {
       return shared_ptr<T>();
     }
-  catch (Tlv::Error& e)
+  catch (tlv::Error& e)
     {
       return shared_ptr<T>();
     }
@@ -151,7 +151,7 @@
     {
       throw Error(e.what());
     }
-  catch (Tlv::Error& e)
+  catch (tlv::Error& e)
     {
       throw Error(e.what());
     }
diff --git a/tests/unit-tests/security/test-conf-checker.cpp b/tests/unit-tests/security/test-conf-checker.cpp
index 9135a50..23df0cd 100644
--- a/tests/unit-tests/security/test-conf-checker.cpp
+++ b/tests/unit-tests/security/test-conf-checker.cpp
@@ -115,7 +115,7 @@
   shared_ptr<RelationKeyLocatorNameChecker> keyLocatorCheckerEqual1 =
     make_shared<RelationKeyLocatorNameChecker>(certName.getPrefix(-1),
                                                KeyLocatorChecker::RELATION_EQUAL);
-  CustomizedChecker checker1(Tlv::SignatureSha256WithRsa, keyLocatorCheckerEqual1);
+  CustomizedChecker checker1(tlv::SignatureSha256WithRsa, keyLocatorCheckerEqual1);
 
   result = checker1.check(*data1,
                           bind(dataChecked, _1),
@@ -141,7 +141,7 @@
   shared_ptr<RelationKeyLocatorNameChecker> keyLocatorCheckerEqual2 =
     make_shared<RelationKeyLocatorNameChecker>(identity,
                                                KeyLocatorChecker::RELATION_EQUAL);
-  CustomizedChecker checker2(Tlv::SignatureSha256WithRsa, keyLocatorCheckerEqual2);
+  CustomizedChecker checker2(tlv::SignatureSha256WithRsa, keyLocatorCheckerEqual2);
 
   result = checker2.check(*data1,
                           bind(dataCheckedFalse, _1),
@@ -157,7 +157,7 @@
   shared_ptr<RelationKeyLocatorNameChecker> keyLocatorCheckerPrefix1 =
     make_shared<RelationKeyLocatorNameChecker>(certName.getPrefix(-1),
                                                KeyLocatorChecker::RELATION_IS_PREFIX_OF);
-  CustomizedChecker checker3(Tlv::SignatureSha256WithRsa, keyLocatorCheckerPrefix1);
+  CustomizedChecker checker3(tlv::SignatureSha256WithRsa, keyLocatorCheckerPrefix1);
 
   result = checker3.check(*data1,
                           bind(dataChecked, _1),
@@ -173,7 +173,7 @@
   shared_ptr<RelationKeyLocatorNameChecker> keyLocatorCheckerPrefix2 =
     make_shared<RelationKeyLocatorNameChecker>(identity,
                                                KeyLocatorChecker::RELATION_IS_PREFIX_OF);
-  CustomizedChecker checker4(Tlv::SignatureSha256WithRsa, keyLocatorCheckerPrefix2);
+  CustomizedChecker checker4(tlv::SignatureSha256WithRsa, keyLocatorCheckerPrefix2);
 
   result = checker4.check(*data1,
                           bind(dataChecked, _1),
@@ -189,7 +189,7 @@
   shared_ptr<RelationKeyLocatorNameChecker> keyLocatorCheckerStrict1 =
     make_shared<RelationKeyLocatorNameChecker>(certName.getPrefix(-1),
                                                KeyLocatorChecker::RELATION_IS_STRICT_PREFIX_OF);
-  CustomizedChecker checker5(Tlv::SignatureSha256WithRsa, keyLocatorCheckerStrict1);
+  CustomizedChecker checker5(tlv::SignatureSha256WithRsa, keyLocatorCheckerStrict1);
 
   result = checker5.check(*data1,
                           bind(dataCheckedFalse, _1),
@@ -204,7 +204,7 @@
   shared_ptr<RelationKeyLocatorNameChecker> keyLocatorCheckerStrict2 =
     make_shared<RelationKeyLocatorNameChecker>(identity,
                                                KeyLocatorChecker::RELATION_IS_STRICT_PREFIX_OF);
-  CustomizedChecker checker6(Tlv::SignatureSha256WithRsa, keyLocatorCheckerStrict2);
+  CustomizedChecker checker6(tlv::SignatureSha256WithRsa, keyLocatorCheckerStrict2);
 
   result = checker6.check(*data1,
                           bind(dataCheckedFalse, _1),
@@ -254,7 +254,7 @@
   shared_ptr<RegexKeyLocatorNameChecker> keyLocatorCheckerRegex1 =
     make_shared<RegexKeyLocatorNameChecker>(
       Regex("^<SecurityTestConfChecker><CustomizedCheckerTest2>"));
-  CustomizedChecker checker1(Tlv::SignatureSha256WithRsa, keyLocatorCheckerRegex1);
+  CustomizedChecker checker1(tlv::SignatureSha256WithRsa, keyLocatorCheckerRegex1);
 
   result = checker1.check(*data1,
                           bind(dataChecked, _1),
@@ -315,7 +315,7 @@
   shared_ptr<RegexKeyLocatorNameChecker> keyLocatorCheckerRegex1 =
     make_shared<RegexKeyLocatorNameChecker>(
       Regex("^<SecurityTestConfChecker><CustomizedCheckerTest3>"));
-  CustomizedChecker checker1(Tlv::SignatureSha256WithEcdsa, keyLocatorCheckerRegex1);
+  CustomizedChecker checker1(tlv::SignatureSha256WithEcdsa, keyLocatorCheckerRegex1);
 
   result = checker1.check(*data1,
                           bind(dataChecked, _1),
@@ -338,7 +338,7 @@
   BOOST_CHECK_EQUAL(result, -1);
 
 
-  CustomizedChecker checker2(Tlv::SignatureSha256WithRsa, keyLocatorCheckerRegex1);
+  CustomizedChecker checker2(tlv::SignatureSha256WithRsa, keyLocatorCheckerRegex1);
 
   result = checker2.check(*data1,
                           bind(dataCheckedFalse, _1),
@@ -388,7 +388,7 @@
 
   int8_t result = 0;
 
-  HierarchicalChecker checker1(Tlv::SignatureSha256WithEcdsa);
+  HierarchicalChecker checker1(tlv::SignatureSha256WithEcdsa);
 
   result = checker1.check(*data1,
                           bind(dataChecked, _1),
@@ -421,7 +421,7 @@
   BOOST_CHECK_EQUAL(result, -1);
 
 
-  HierarchicalChecker checker2(Tlv::SignatureSha256WithRsa);
+  HierarchicalChecker checker2(tlv::SignatureSha256WithRsa);
 
   result = checker2.check(*data1,
                           bind(dataCheckedFalse, _1),
@@ -491,7 +491,7 @@
 
   int8_t result = 0;
 
-  FixedSignerChecker checker1(Tlv::SignatureSha256WithEcdsa, certSet1);
+  FixedSignerChecker checker1(tlv::SignatureSha256WithEcdsa, certSet1);
 
   result = checker1.check(*data1,
                           bind(dataChecked, _1),
@@ -504,7 +504,7 @@
   BOOST_CHECK_EQUAL(result, -1);
 
 
-  FixedSignerChecker checker2(Tlv::SignatureSha256WithRsa, certSet1);
+  FixedSignerChecker checker2(tlv::SignatureSha256WithRsa, certSet1);
 
   result = checker2.check(*data1,
                           bind(dataCheckedFalse, _1),
@@ -517,7 +517,7 @@
   BOOST_CHECK_EQUAL(result, -1);
 
 
-  FixedSignerChecker checker3(Tlv::SignatureSha256WithEcdsa, certSet2);
+  FixedSignerChecker checker3(tlv::SignatureSha256WithEcdsa, certSet2);
 
   result = checker3.check(*data1,
                           bind(dataCheckedFalse, _1),
@@ -530,7 +530,7 @@
   BOOST_CHECK_EQUAL(result, -1);
 
 
-  FixedSignerChecker checker4(Tlv::SignatureSha256WithRsa, certSet2);
+  FixedSignerChecker checker4(tlv::SignatureSha256WithRsa, certSet2);
 
   result = checker4.check(*data1,
                           bind(dataCheckedFalse, _1),
diff --git a/tests/unit-tests/test-block.cpp b/tests/unit-tests/test-block.cpp
index c653177..cc860b7 100644
--- a/tests/unit-tests/test-block.cpp
+++ b/tests/unit-tests/test-block.cpp
@@ -40,7 +40,7 @@
     0xff, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00 // == 4294967296LL
   };
 
-  using namespace Tlv;
+  using namespace tlv;
 
   const uint8_t* begin;
   uint64_t value;
@@ -117,7 +117,7 @@
     0xff, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00 // == 4294967296LL
   };
 
-  using namespace Tlv;
+  using namespace tlv;
 
   typedef boost::iostreams::stream<boost::iostreams::array_source> ArrayStream;
   typedef std::istream_iterator<uint8_t> Iterator;
@@ -257,7 +257,7 @@
     0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01
   };
 
-  using namespace Tlv;
+  using namespace tlv;
 
   const uint8_t* begin;
   uint64_t value;
@@ -292,7 +292,7 @@
     0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01
   };
 
-  using namespace Tlv;
+  using namespace tlv;
 
   typedef boost::iostreams::stream<boost::iostreams::array_source> ArrayStream;
   typedef std::istream_iterator<uint8_t> Iterator;
@@ -579,7 +579,7 @@
   BOOST_CHECK_EQUAL(*testBlock.wire(),  0x01);
   BOOST_CHECK_EQUAL(*testBlock.value(), 0xfb);
 
-  BOOST_CHECK_THROW(Block::fromStream(stream), Tlv::Error);
+  BOOST_CHECK_THROW(Block::fromStream(stream), tlv::Error);
 }
 
 BOOST_AUTO_TEST_CASE(Equality)
diff --git a/tests/unit-tests/test-data.cpp b/tests/unit-tests/test-data.cpp
index 5ce434e..8de7a42 100644
--- a/tests/unit-tests/test-data.cpp
+++ b/tests/unit-tests/test-data.cpp
@@ -223,7 +223,7 @@
 
   b = SignatureSha256WithRsa();
   static const uint8_t someData[256] = {};
-  Block signatureValue = dataBlock(Tlv::SignatureValue, someData, sizeof(someData));
+  Block signatureValue = dataBlock(tlv::SignatureValue, someData, sizeof(someData));
   b.setValue(signatureValue);
   BOOST_CHECK_EQUAL(a == b, false);
   BOOST_CHECK_EQUAL(a != b, true);
@@ -277,7 +277,7 @@
   ndn::Block block = d.getSignature().getInfo();
   block.parse();
   KeyLocator keyLocator;
-  BOOST_REQUIRE_NO_THROW(keyLocator.wireDecode(block.get(Tlv::KeyLocator)));
+  BOOST_REQUIRE_NO_THROW(keyLocator.wireDecode(block.get(tlv::KeyLocator)));
 
   BOOST_REQUIRE_EQUAL(keyLocator.getName().toUri(), "/test/key/locator");
 
@@ -301,11 +301,11 @@
 
   d.setContent(Content1, sizeof(Content1));
 
-  Block signatureInfo(Tlv::SignatureInfo);
+  Block signatureInfo(tlv::SignatureInfo);
   // SignatureType
   {
     signatureInfo.push_back
-      (nonNegativeIntegerBlock(Tlv::SignatureType, Signature::Sha256WithRsa));
+      (nonNegativeIntegerBlock(tlv::SignatureType, Signature::Sha256WithRsa));
   }
   // KeyLocator
   {
@@ -318,7 +318,7 @@
 
   // SignatureValue
   OBufferStream os;
-  Tlv::writeVarNumber(os, Tlv::SignatureValue);
+  tlv::writeVarNumber(os, tlv::SignatureValue);
 
   using namespace CryptoPP;
 
@@ -334,7 +334,7 @@
   SecByteBlock buf(length);
   signer.Sign(rng_, hash, buf);
 
-  Tlv::writeVarNumber(os, buf.size());
+  tlv::writeVarNumber(os, buf.size());
   os.write(reinterpret_cast<const char *>(buf.BytePtr()), buf.size());
 
   ndn::Block signatureValue(Block(os.buf()));
diff --git a/tests/unit-tests/test-interest.cpp b/tests/unit-tests/test-interest.cpp
index 82bf8bd..5430bbd 100644
--- a/tests/unit-tests/test-interest.cpp
+++ b/tests/unit-tests/test-interest.cpp
@@ -425,7 +425,7 @@
   const Block& payload = nfd::LocalControlHeader::getPayload(wireBlock);
   BOOST_REQUIRE_NE(&payload, &wireBlock);
 
-  BOOST_CHECK_EQUAL(payload.type(), static_cast<uint32_t>(Tlv::Interest));
+  BOOST_CHECK_EQUAL(payload.type(), static_cast<uint32_t>(tlv::Interest));
   BOOST_CHECK_EQUAL(wireBlock.type(), static_cast<uint32_t>(tlv::nfd::LocalControlHeader));
 
   Interest interest(payload);
diff --git a/tests/unit-tests/test-signature-info.cpp b/tests/unit-tests/test-signature-info.cpp
index ad7d8f9..fc2cb52 100644
--- a/tests/unit-tests/test-signature-info.cpp
+++ b/tests/unit-tests/test-signature-info.cpp
@@ -48,14 +48,14 @@
   BOOST_CHECK_EQUAL(info.hasKeyLocator(), false);
   BOOST_CHECK_THROW(info.getKeyLocator(), SignatureInfo::Error);
 
-  SignatureInfo sha256Info(Tlv::DigestSha256);
-  BOOST_CHECK_EQUAL(sha256Info.getSignatureType(), Tlv::DigestSha256);
+  SignatureInfo sha256Info(tlv::DigestSha256);
+  BOOST_CHECK_EQUAL(sha256Info.getSignatureType(), tlv::DigestSha256);
   BOOST_CHECK_EQUAL(sha256Info.hasKeyLocator(), false);
   BOOST_CHECK_THROW(sha256Info.getKeyLocator(), SignatureInfo::Error);
 
   KeyLocator keyLocator("/test/key/locator");
-  SignatureInfo sha256RsaInfo(Tlv::SignatureSha256WithRsa, keyLocator);
-  BOOST_CHECK_EQUAL(sha256RsaInfo.getSignatureType(), Tlv::SignatureSha256WithRsa);
+  SignatureInfo sha256RsaInfo(tlv::SignatureSha256WithRsa, keyLocator);
+  BOOST_CHECK_EQUAL(sha256RsaInfo.getSignatureType(), tlv::SignatureSha256WithRsa);
   BOOST_CHECK_EQUAL(sha256RsaInfo.hasKeyLocator(), true);
   BOOST_CHECK_NO_THROW(sha256RsaInfo.getKeyLocator());
   BOOST_CHECK_EQUAL(sha256RsaInfo.getKeyLocator().getName(), Name("/test/key/locator"));
@@ -69,7 +69,7 @@
                                 encoded.wire() + encoded.size());
 
   sha256RsaInfo = SignatureInfo(sigInfoBlock);
-  BOOST_CHECK_EQUAL(sha256RsaInfo.getSignatureType(), Tlv::SignatureSha256WithRsa);
+  BOOST_CHECK_EQUAL(sha256RsaInfo.getSignatureType(), tlv::SignatureSha256WithRsa);
   BOOST_CHECK_EQUAL(sha256RsaInfo.hasKeyLocator(), true);
   BOOST_CHECK_NO_THROW(sha256RsaInfo.getKeyLocator());
   BOOST_CHECK_EQUAL(sha256RsaInfo.getKeyLocator().getName(), Name("/test/key/locator"));
@@ -91,14 +91,14 @@
             0x6c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72
   };
   Block errorBlock1(error1, sizeof(error1));
-  BOOST_CHECK_THROW(SignatureInfo info(errorBlock1), Tlv::Error);
+  BOOST_CHECK_THROW(SignatureInfo info(errorBlock1), tlv::Error);
 
   const uint8_t error2[] = {
     0x16, 0x01, // SignatureInfo
       0x01 // Wrong SignatureInfo value
   };
   Block errorBlock2(error2, sizeof(error2));
-  BOOST_CHECK_THROW(SignatureInfo info(errorBlock2), Tlv::Error);
+  BOOST_CHECK_THROW(SignatureInfo info(errorBlock2), tlv::Error);
 
   const uint8_t error3[] = {
     0x16, 0x01, // SignatureInfo
@@ -114,13 +114,13 @@
             0x6c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72
   };
   Block errorBlock3(error3, sizeof(error3));
-  BOOST_CHECK_THROW(SignatureInfo info(errorBlock3), Tlv::Error);
+  BOOST_CHECK_THROW(SignatureInfo info(errorBlock3), tlv::Error);
 
   const uint8_t error4[] = {
     0x16, 0x00 // Empty SignatureInfo
   };
   Block errorBlock4(error4, sizeof(error4));
-  BOOST_CHECK_THROW(SignatureInfo info(errorBlock4), Tlv::Error);
+  BOOST_CHECK_THROW(SignatureInfo info(errorBlock4), tlv::Error);
 
 }
 
@@ -131,8 +131,8 @@
   BOOST_CHECK_EQUAL(info.hasKeyLocator(), false);
   BOOST_CHECK_THROW(info.getKeyLocator(), SignatureInfo::Error);
 
-  info.setSignatureType(Tlv::SignatureSha256WithRsa);
-  BOOST_CHECK_EQUAL(info.getSignatureType(), Tlv::SignatureSha256WithRsa);
+  info.setSignatureType(tlv::SignatureSha256WithRsa);
+  BOOST_CHECK_EQUAL(info.getSignatureType(), tlv::SignatureSha256WithRsa);
   BOOST_CHECK_EQUAL(info.hasKeyLocator(), false);
 
   KeyLocator keyLocator("/test/key/locator");
diff --git a/tests/unit-tests/transport/dummy-face.hpp b/tests/unit-tests/transport/dummy-face.hpp
index fd724b0..faeae55 100644
--- a/tests/unit-tests/transport/dummy-face.hpp
+++ b/tests/unit-tests/transport/dummy-face.hpp
@@ -54,10 +54,10 @@
   virtual void
   send(const Block& wire)
   {
-    if (wire.type() == Tlv::Interest) {
+    if (wire.type() == tlv::Interest) {
       m_sentInterests->push_back(Interest(wire));
     }
-    else if (wire.type() == Tlv::Data) {
+    else if (wire.type() == tlv::Data) {
       m_sentDatas->push_back(Data(wire));
     }
   }
diff --git a/tools/tlvdump.cpp b/tools/tlvdump.cpp
index e66482b..0273861 100644
--- a/tools/tlvdump.cpp
+++ b/tools/tlvdump.cpp
@@ -94,10 +94,10 @@
   std::cout << " (size: " << block.value_size() << ")";
 
   try {
-    // if (block.type() != ndn::Tlv::Content && block.type() != ndn::Tlv::SignatureValue)
+    // if (block.type() != ndn::tlv::Content && block.type() != ndn::tlv::SignatureValue)
     block.parse();
   }
-  catch (ndn::Tlv::Error& e) {
+  catch (ndn::tlv::Error& e) {
     // pass (e.g., leaf block reached)
 
     // @todo: Figure how to deterministically figure out that value is not recursive TLV block
