diff --git a/src/encoding/block.cpp b/src/encoding/block.cpp
index ed8f5c9..639ed68 100644
--- a/src/encoding/block.cpp
+++ b/src/encoding/block.cpp
@@ -50,7 +50,7 @@
 }
 
 Block::Block(const EncodingBuffer& buffer)
-  : Block(const_cast<EncodingBuffer&>(buffer).getBuffer(), buffer.begin(), buffer.end(), true)
+  : Block(buffer.getBuffer(), buffer.begin(), buffer.end(), true)
 {
 }
 
diff --git a/src/encoding/encoder.hpp b/src/encoding/encoder.hpp
index 06a7ca1..b253a8a 100644
--- a/src/encoding/encoder.hpp
+++ b/src/encoding/encoder.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -32,23 +32,10 @@
  * Interface of this class (mostly) matches interface of Estimator class
  * @sa Estimator
  */
-class Encoder
+class Encoder : noncopyable
 {
 public: // common interface between Encoder and Estimator
   /**
-   * @brief Create instance of the encoder with the specified reserved sizes
-   * @param totalReserve    initial buffer size to reserve
-   * @param reserveFromBack number of bytes to reserve for append* operations
-   */
-  explicit
-  Encoder(size_t totalReserve = MAX_NDN_PACKET_SIZE, size_t reserveFromBack = 400);
-
-  Encoder(const Encoder&) = delete;
-
-  Encoder&
-  operator=(const Encoder&) = delete;
-
-  /**
    * @brief Prepend a byte
    */
   size_t
@@ -144,6 +131,14 @@
   using const_iterator = Buffer::const_iterator;
 
   /**
+   * @brief Create instance of the encoder with the specified reserved sizes
+   * @param totalReserve    initial buffer size to reserve
+   * @param reserveFromBack number of bytes to reserve for append* operations
+   */
+  explicit
+  Encoder(size_t totalReserve = MAX_NDN_PACKET_SIZE, size_t reserveFromBack = 400);
+
+  /**
    * @brief Create EncodingBlock from existing block
    *
    * This is a dangerous constructor and should be used with caution.
@@ -188,16 +183,15 @@
    * @brief Get size of the underlying buffer
    */
   size_t
-  capacity() const;
+  capacity() const noexcept;
 
   /**
    * @brief Get underlying buffer
    */
   shared_ptr<Buffer>
-  getBuffer();
+  getBuffer() const noexcept;
 
 public: // accessors
-
   /**
    * @brief Get an iterator pointing to the first byte of the encoded buffer
    */
@@ -216,6 +210,9 @@
   const_iterator
   begin() const;
 
+  /**
+   * @brief Get an iterator pointing to the past-the-end byte of the encoded buffer
+   */
   const_iterator
   end() const;
 
@@ -232,10 +229,10 @@
   buf() const;
 
   /**
-   * @brief Get size of the encoded buffer
+   * @brief Get the size of the encoded buffer
    */
   size_t
-  size() const;
+  size() const noexcept;
 
   /**
    * @brief Create Block from the underlying buffer
@@ -256,21 +253,20 @@
   iterator m_end;
 };
 
-
 inline size_t
-Encoder::size() const
+Encoder::size() const noexcept
 {
   return m_end - m_begin;
 }
 
 inline shared_ptr<Buffer>
-Encoder::getBuffer()
+Encoder::getBuffer() const noexcept
 {
   return m_buffer;
 }
 
 inline size_t
-Encoder::capacity() const
+Encoder::capacity() const noexcept
 {
   return m_buffer->size();
 }
@@ -312,7 +308,7 @@
 }
 
 template<class Iterator>
-inline size_t
+size_t
 Encoder::prependRange(Iterator first, Iterator last)
 {
   using ValueType = typename std::iterator_traits<Iterator>::value_type;
@@ -326,9 +322,8 @@
   return length;
 }
 
-
 template<class Iterator>
-inline size_t
+size_t
 Encoder::appendRange(Iterator first, Iterator last)
 {
   using ValueType = typename std::iterator_traits<Iterator>::value_type;
@@ -342,7 +337,6 @@
   return length;
 }
 
-
 } // namespace encoding
 } // namespace ndn
 
diff --git a/src/encoding/encoding-buffer.hpp b/src/encoding/encoding-buffer.hpp
index 9b483c2..1f21379 100644
--- a/src/encoding/encoding-buffer.hpp
+++ b/src/encoding/encoding-buffer.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -58,7 +58,6 @@
 public:
   explicit
   EncodingImpl(size_t totalReserve = 0, size_t totalFromBack = 0)
-    : Estimator(totalReserve, totalFromBack)
   {
   }
 };
diff --git a/src/encoding/estimator.cpp b/src/encoding/estimator.cpp
index 9ec2336..0355646 100644
--- a/src/encoding/estimator.cpp
+++ b/src/encoding/estimator.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2015 Regents of the University of California.
+/*
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -24,37 +24,8 @@
 namespace ndn {
 namespace encoding {
 
-Estimator::Estimator(size_t totalReserve, size_t reserveFromBack)
-{
-}
-
 size_t
-Estimator::prependByte(uint8_t value)
-{
-  return 1;
-}
-
-size_t
-Estimator::appendByte(uint8_t value)
-{
-  return 1;
-}
-
-
-size_t
-Estimator::prependByteArray(const uint8_t* array, size_t length)
-{
-  return length;
-}
-
-size_t
-Estimator::appendByteArray(const uint8_t* array, size_t length)
-{
-  return prependByteArray(array, length);
-}
-
-size_t
-Estimator::prependVarNumber(uint64_t varNumber)
+Estimator::prependVarNumber(uint64_t varNumber) const noexcept
 {
   if (varNumber < 253) {
     return 1;
@@ -71,14 +42,13 @@
 }
 
 size_t
-Estimator::appendVarNumber(uint64_t varNumber)
+Estimator::appendVarNumber(uint64_t varNumber) const noexcept
 {
   return prependVarNumber(varNumber);
 }
 
-
 size_t
-Estimator::prependNonNegativeInteger(uint64_t varNumber)
+Estimator::prependNonNegativeInteger(uint64_t varNumber) const noexcept
 {
   if (varNumber <= std::numeric_limits<uint8_t>::max()) {
     return 1;
@@ -95,14 +65,13 @@
 }
 
 size_t
-Estimator::appendNonNegativeInteger(uint64_t varNumber)
+Estimator::appendNonNegativeInteger(uint64_t varNumber) const noexcept
 {
   return prependNonNegativeInteger(varNumber);
 }
 
-
 size_t
-Estimator::prependByteArrayBlock(uint32_t type, const uint8_t* array, size_t arraySize)
+Estimator::prependByteArrayBlock(uint32_t type, const uint8_t* array, size_t arraySize) const noexcept
 {
   size_t totalLength = arraySize;
   totalLength += prependVarNumber(arraySize);
@@ -112,14 +81,13 @@
 }
 
 size_t
-Estimator::appendByteArrayBlock(uint32_t type, const uint8_t* array, size_t arraySize)
+Estimator::appendByteArrayBlock(uint32_t type, const uint8_t* array, size_t arraySize) const noexcept
 {
   return prependByteArrayBlock(type, array, arraySize);
 }
 
-
 size_t
-Estimator::prependBlock(const Block& block)
+Estimator::prependBlock(const Block& block) const
 {
   if (block.hasWire()) {
     return block.size();
@@ -130,11 +98,10 @@
 }
 
 size_t
-Estimator::appendBlock(const Block& block)
+Estimator::appendBlock(const Block& block) const
 {
   return prependBlock(block);
 }
 
-
 } // namespace encoding
 } // namespace ndn
diff --git a/src/encoding/estimator.hpp b/src/encoding/estimator.hpp
index 364f953..11f9e39 100644
--- a/src/encoding/estimator.hpp
+++ b/src/encoding/estimator.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2015 Regents of the University of California.
+/*
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -22,7 +22,6 @@
 #ifndef NDN_ENCODING_ESTIMATOR_HPP
 #define NDN_ENCODING_ESTIMATOR_HPP
 
-#include "../common.hpp"
 #include "block.hpp"
 
 namespace ndn {
@@ -33,129 +32,118 @@
  * Interface of this class (mostly) matches interface of Encoder class
  * @sa Encoder
  */
-class Estimator
+class Estimator : noncopyable
 {
 public: // common interface between Encoder and Estimator
   /**
-   * @brief Create instance of the estimator
-   * @param totalReserve    not used (for compatibility with the Encoder)
-   * @param reserveFromBack not used (for compatibility with the Encoder)
-   */
-  explicit
-  Estimator(size_t totalReserve = 0, size_t reserveFromBack = 0);
-
-  Estimator(const Estimator&) = delete;
-
-  Estimator&
-  operator=(const Estimator&) = delete;
-
-  /**
    * @brief Prepend a byte
    */
-  size_t
-  prependByte(uint8_t value);
+  constexpr size_t
+  prependByte(uint8_t) const noexcept
+  {
+    return 1;
+  }
 
   /**
    * @brief Append a byte
    */
-  size_t
-  appendByte(uint8_t value);
+  constexpr size_t
+  appendByte(uint8_t) const noexcept
+  {
+    return 1;
+  }
 
   /**
    * @brief Prepend a byte array @p array of length @p length
    */
-  size_t
-  prependByteArray(const uint8_t* array, size_t length);
+  constexpr size_t
+  prependByteArray(const uint8_t*, size_t length) const noexcept
+  {
+    return length;
+  }
 
   /**
    * @brief Append a byte array @p array of length @p length
    */
-  size_t
-  appendByteArray(const uint8_t* array, size_t length);
+  constexpr size_t
+  appendByteArray(const uint8_t*, size_t length) const noexcept
+  {
+    return length;
+  }
 
   /**
    * @brief Prepend range of bytes from the range [@p first, @p last)
    */
   template<class Iterator>
   size_t
-  prependRange(Iterator first, Iterator last);
+  prependRange(Iterator first, Iterator last) const noexcept
+  {
+    return std::distance(first, last);
+  }
 
   /**
    * @brief Append range of bytes from the range [@p first, @p last)
    */
   template<class Iterator>
   size_t
-  appendRange(Iterator first, Iterator last);
+  appendRange(Iterator first, Iterator last) const noexcept
+  {
+    return std::distance(first, last);
+  }
 
   /**
    * @brief Prepend VarNumber @p varNumber of NDN TLV encoding
    * @sa http://named-data.net/doc/ndn-tlv/
    */
   size_t
-  prependVarNumber(uint64_t varNumber);
+  prependVarNumber(uint64_t varNumber) const noexcept;
 
   /**
    * @brief Prepend VarNumber @p varNumber of NDN TLV encoding
    * @sa http://named-data.net/doc/ndn-tlv/
    */
   size_t
-  appendVarNumber(uint64_t varNumber);
+  appendVarNumber(uint64_t varNumber) const noexcept;
 
   /**
    * @brief Prepend non-negative integer @p integer of NDN TLV encoding
    * @sa http://named-data.net/doc/ndn-tlv/
    */
   size_t
-  prependNonNegativeInteger(uint64_t integer);
+  prependNonNegativeInteger(uint64_t integer) const noexcept;
 
   /**
    * @brief Append non-negative integer @p integer of NDN TLV encoding
    * @sa http://named-data.net/doc/ndn-tlv/
    */
   size_t
-  appendNonNegativeInteger(uint64_t integer);
+  appendNonNegativeInteger(uint64_t integer) const noexcept;
 
   /**
    * @brief Prepend TLV block of type @p type and value from buffer @p array of size @p arraySize
    */
   size_t
-  prependByteArrayBlock(uint32_t type, const uint8_t* array, size_t arraySize);
+  prependByteArrayBlock(uint32_t type, const uint8_t* array, size_t arraySize) const noexcept;
 
   /**
    * @brief Append TLV block of type @p type and value from buffer @p array of size @p arraySize
    */
   size_t
-  appendByteArrayBlock(uint32_t type, const uint8_t* array, size_t arraySize);
+  appendByteArrayBlock(uint32_t type, const uint8_t* array, size_t arraySize) const noexcept;
 
   /**
    * @brief Prepend TLV block @p block
    */
   size_t
-  prependBlock(const Block& block);
+  prependBlock(const Block& block) const;
 
   /**
    * @brief Append TLV block @p block
    */
   size_t
-  appendBlock(const Block& block);
+  appendBlock(const Block& block) const;
 };
 
-
-template<class Iterator>
-inline size_t
-Estimator::prependRange(Iterator first, Iterator last)
-{
-  return std::distance(first, last);
-}
-
-
-template<class Iterator>
-inline size_t
-Estimator::appendRange(Iterator first, Iterator last)
-{
-  return prependRange(first, last);
-}
-
 } // namespace encoding
 } // namespace ndn
 
diff --git a/src/encoding/tlv.hpp b/src/encoding/tlv.hpp
index 5fb2b24..77d62f5 100644
--- a/src/encoding/tlv.hpp
+++ b/src/encoding/tlv.hpp
@@ -22,12 +22,13 @@
 #ifndef NDN_ENCODING_TLV_HPP
 #define NDN_ENCODING_TLV_HPP
 
-#include "buffer.hpp"
+#include "../common.hpp"
 
 #include <cstring>
 #include <iterator>
 #include <ostream>
 #include <type_traits>
+#include <vector>
 
 #include <boost/endian/conversion.hpp>
 
@@ -165,8 +166,8 @@
 }
 
 /**
- * @brief Read VAR-NUMBER in NDN-TLV encoding
- * @tparam Iterator an iterator or pointer whose value is assignable to uint8_t
+ * @brief Read VAR-NUMBER in NDN-TLV encoding.
+ * @tparam Iterator an iterator or pointer that dereferences to uint8_t or compatible type
  *
  * @param [inout] begin  Begin of the buffer, will be incremented to point to the first byte after
  *                       the read VAR-NUMBER
@@ -174,15 +175,14 @@
  * @param [out]   number Read VAR-NUMBER
  *
  * @return true if number was successfully read from input, false otherwise
- * @note This call never throws exceptions
  */
 template<typename Iterator>
 bool
-readVarNumber(Iterator& begin, const Iterator& end, uint64_t& number);
+readVarNumber(Iterator& begin, Iterator end, uint64_t& number) noexcept;
 
 /**
- * @brief Read TLV-TYPE
- * @tparam Iterator an iterator or pointer whose value is assignable to uint8_t
+ * @brief Read TLV-TYPE.
+ * @tparam Iterator an iterator or pointer that dereferences to uint8_t or compatible type
  *
  * @param [inout] begin  Begin of the buffer, will be incremented to point to the first byte after
  *                       the read TLV-TYPE
@@ -190,17 +190,16 @@
  * @param [out]   type  Read TLV-TYPE
  *
  * @return true if TLV-TYPE was successfully read from input, false otherwise
- * @note This call never throws exceptions
- * @note This call is largely equivalent to tlv::readVarNumber, but it will return false if type
- *       is larger than 2^32-1 (TLV-TYPE in this library is implemented as uint32_t)
+ * @note This function is largely equivalent to readVarNumber(), except that it returns false if
+ *       the TLV-TYPE is larger than 2^32-1 (TLV-TYPE in this library is implemented as `uint32_t`)
  */
 template<typename Iterator>
 bool
-readType(Iterator& begin, const Iterator& end, uint32_t& type);
+readType(Iterator& begin, Iterator end, uint32_t& type) noexcept;
 
 /**
- * @brief Read VAR-NUMBER in NDN-TLV encoding
- * @tparam Iterator an iterator or pointer whose value is assignable to uint8_t
+ * @brief Read VAR-NUMBER in NDN-TLV encoding.
+ * @tparam Iterator an iterator or pointer that dereferences to uint8_t or compatible type
  *
  * @param [inout] begin Begin of the buffer, will be incremented to point to the first byte after
  *                      the read VAR-NUMBER
@@ -210,40 +209,40 @@
  */
 template<typename Iterator>
 uint64_t
-readVarNumber(Iterator& begin, const Iterator& end);
+readVarNumber(Iterator& begin, Iterator end);
 
 /**
- * @brief Read TLV Type
- * @tparam Iterator an iterator or pointer whose value is assignable to uint8_t
+ * @brief Read TLV-TYPE.
+ * @tparam Iterator an iterator or pointer that dereferences to uint8_t or compatible type
  *
  * @param [inout] begin Begin of the buffer, will be incremented to point to the first byte after
  *                      the read TLV-TYPE
  * @param [in]    end   End of the buffer
  *
- * @throw tlv::Error VAR-NUMBER cannot be read
- * @note This call is largely equivalent to tlv::readVarNumber, but exception will be thrown if type
- *       is larger than 2^32-1 (TLV-TYPE in this library is implemented as uint32_t)
+ * @throw tlv::Error TLV-TYPE cannot be read
+ * @note This function is largely equivalent to readVarNumber(), except that it throws if
+ *       the TLV-TYPE is larger than 2^32-1 (TLV-TYPE in this library is implemented as `uint32_t`)
  */
 template<typename Iterator>
 uint32_t
-readType(Iterator& begin, const Iterator& end);
+readType(Iterator& begin, Iterator end);
 
 /**
- * @brief Get number of bytes necessary to hold value of VAR-NUMBER
+ * @brief Get the number of bytes necessary to hold the value of @p number encoded as VAR-NUMBER.
  */
 constexpr size_t
-sizeOfVarNumber(uint64_t number);
+sizeOfVarNumber(uint64_t number) noexcept;
 
 /**
- * @brief Write VAR-NUMBER to the specified stream
+ * @brief Write VAR-NUMBER to the specified stream.
  * @return length of written VAR-NUMBER
  */
 size_t
 writeVarNumber(std::ostream& os, uint64_t number);
 
 /**
- * @brief Read nonNegativeInteger in NDN-TLV encoding
- * @tparam Iterator an iterator or pointer whose value is assignable to uint8_t
+ * @brief Read nonNegativeInteger in NDN-TLV encoding.
+ * @tparam Iterator an iterator or pointer that dereferences to uint8_t or compatible type
  *
  * @param [in]    size  size of the nonNegativeInteger
  * @param [inout] begin Begin of the buffer, will be incremented to point to the first byte after
@@ -252,20 +251,20 @@
  *
  * @throw tlv::Error number cannot be read
  * @note How many bytes to read is directly controlled by \p size, which can be either 1, 2, 4, or 8.
- *       If \p size differs from \p std::distance(begin, end), tlv::Error exception will be thrown.
+ *       If \p size differs from `std::distance(begin, end)`, tlv::Error exception will be thrown.
  */
 template<typename Iterator>
 uint64_t
-readNonNegativeInteger(size_t size, Iterator& begin, const Iterator& end);
+readNonNegativeInteger(size_t size, Iterator& begin, Iterator end);
 
 /**
- * @brief Get number of bytes necessary to hold value of nonNegativeInteger
+ * @brief Get the number of bytes necessary to hold the value of @p integer encoded as nonNegativeInteger.
  */
 constexpr size_t
-sizeOfNonNegativeInteger(uint64_t integer);
+sizeOfNonNegativeInteger(uint64_t integer) noexcept;
 
 /**
- * @brief Write nonNegativeInteger to the specified stream
+ * @brief Write nonNegativeInteger to the specified stream.
  * @return length of written nonNegativeInteger
  */
 size_t
@@ -289,8 +288,8 @@
 class ReadNumberSlow
 {
 public:
-  bool
-  operator()(size_t size, Iterator& begin, const Iterator& end, uint64_t& number) const
+  constexpr bool
+  operator()(size_t size, Iterator& begin, Iterator end, uint64_t& number) const noexcept
   {
     number = 0;
     size_t count = 0;
@@ -307,8 +306,8 @@
 class ReadNumberFast
 {
 public:
-  bool
-  operator()(size_t size, Iterator& begin, const Iterator& end, uint64_t& number) const
+  constexpr bool
+  operator()(size_t size, Iterator& begin, Iterator end, uint64_t& number) const noexcept
   {
     if (begin + size > end) {
       return false;
@@ -377,7 +376,7 @@
 
 template<typename Iterator>
 bool
-readVarNumber(Iterator& begin, const Iterator& end, uint64_t& number)
+readVarNumber(Iterator& begin, Iterator end, uint64_t& number) noexcept
 {
   if (begin == end)
     return false;
@@ -396,7 +395,7 @@
 
 template<typename Iterator>
 bool
-readType(Iterator& begin, const Iterator& end, uint32_t& type)
+readType(Iterator& begin, Iterator end, uint32_t& type) noexcept
 {
   uint64_t number = 0;
   bool isOk = readVarNumber(begin, end, number);
@@ -410,15 +409,16 @@
 
 template<typename Iterator>
 uint64_t
-readVarNumber(Iterator& begin, const Iterator& end)
+readVarNumber(Iterator& begin, Iterator end)
 {
-  if (begin == end)
-    BOOST_THROW_EXCEPTION(Error("Empty buffer during TLV processing"));
+  if (begin == end) {
+    BOOST_THROW_EXCEPTION(Error("Empty buffer during TLV parsing"));
+  }
 
   uint64_t value = 0;
   bool isOk = readVarNumber(begin, end, value);
   if (!isOk) {
-    BOOST_THROW_EXCEPTION(Error("Insufficient data during TLV processing"));
+    BOOST_THROW_EXCEPTION(Error("Insufficient data during TLV parsing"));
   }
 
   return value;
@@ -426,7 +426,7 @@
 
 template<typename Iterator>
 uint32_t
-readType(Iterator& begin, const Iterator& end)
+readType(Iterator& begin, Iterator end)
 {
   uint64_t type = readVarNumber(begin, end);
   if (type > std::numeric_limits<uint32_t>::max()) {
@@ -437,7 +437,7 @@
 }
 
 constexpr size_t
-sizeOfVarNumber(uint64_t number)
+sizeOfVarNumber(uint64_t number) noexcept
 {
   return number < 253 ? 1 :
          number <= std::numeric_limits<uint16_t>::max() ? 3 :
@@ -473,7 +473,7 @@
 
 template<typename Iterator>
 uint64_t
-readNonNegativeInteger(size_t size, Iterator& begin, const Iterator& end)
+readNonNegativeInteger(size_t size, Iterator& begin, Iterator end)
 {
   if (size != 1 && size != 2 && size != 4 && size != 8) {
     BOOST_THROW_EXCEPTION(Error("Invalid length for nonNegativeInteger "
@@ -483,14 +483,14 @@
   uint64_t number = 0;
   bool isOk = detail::ReadNumber<Iterator>()(size, begin, end, number);
   if (!isOk) {
-    BOOST_THROW_EXCEPTION(Error("Insufficient data during TLV processing"));
+    BOOST_THROW_EXCEPTION(Error("Insufficient data during TLV parsing"));
   }
 
   return number;
 }
 
 constexpr size_t
-sizeOfNonNegativeInteger(uint64_t integer)
+sizeOfNonNegativeInteger(uint64_t integer) noexcept
 {
   return integer <= std::numeric_limits<uint8_t>::max() ? 1 :
          integer <= std::numeric_limits<uint16_t>::max() ? 2 :
diff --git a/src/lp/packet.cpp b/src/lp/packet.cpp
index a3062b6..e5fc8f3 100644
--- a/src/lp/packet.cpp
+++ b/src/lp/packet.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -33,18 +33,18 @@
 
 template<typename TAG>
 int
-getLocationSortOrder();
+getLocationSortOrder() noexcept;
 
 template<>
-int
-getLocationSortOrder<field_location_tags::Header>()
+constexpr int
+getLocationSortOrder<field_location_tags::Header>() noexcept
 {
   return 1;
 }
 
 template<>
-int
-getLocationSortOrder<field_location_tags::Fragment>()
+constexpr int
+getLocationSortOrder<field_location_tags::Fragment>() noexcept
 {
   return 2;
 }
@@ -52,17 +52,18 @@
 class FieldInfo
 {
 public:
-  FieldInfo();
+  constexpr
+  FieldInfo() noexcept = default;
 
   explicit
-  FieldInfo(uint64_t tlv);
+  FieldInfo(uint64_t tlv) noexcept;
 
 public:
-  uint64_t tlvType;       ///< TLV-TYPE of the field; 0 if field does not exist
-  bool isRecognized;      ///< is this field known
-  bool canIgnore;         ///< can this unknown field be ignored
-  bool isRepeatable;      ///< is the field repeatable
-  int locationSortOrder;  ///< sort order of field_location_tag
+  uint64_t tlvType = 0;       ///< TLV-TYPE of the field; 0 if field does not exist
+  bool isRecognized = false;  ///< is this field known
+  bool canIgnore = false;     ///< can this unknown field be ignored
+  bool isRepeatable = false;  ///< is the field repeatable
+  int locationSortOrder = getLocationSortOrder<field_location_tags::Header>(); ///< sort order of field_location_tag
 };
 
 class ExtractFieldInfo
@@ -71,8 +72,8 @@
   using result_type = void;
 
   template<typename T>
-  void
-  operator()(FieldInfo* info, T) const
+  constexpr void
+  operator()(FieldInfo* info, const T&) const noexcept
   {
     if (T::TlvType::value != info->tlvType) {
       return;
@@ -84,21 +85,8 @@
   }
 };
 
-FieldInfo::FieldInfo()
-  : tlvType(0)
-  , isRecognized(false)
-  , canIgnore(false)
-  , isRepeatable(false)
-  , locationSortOrder(getLocationSortOrder<field_location_tags::Header>())
-{
-}
-
-FieldInfo::FieldInfo(uint64_t tlv)
+FieldInfo::FieldInfo(uint64_t tlv) noexcept
   : tlvType(tlv)
-  , isRecognized(false)
-  , canIgnore(false)
-  , isRepeatable(false)
-  , locationSortOrder(getLocationSortOrder<field_location_tags::Header>())
 {
   boost::mpl::for_each<FieldSet>(boost::bind(ExtractFieldInfo(), this, _1));
   if (!isRecognized) {
@@ -108,8 +96,8 @@
   }
 }
 
-bool
-compareFieldSortOrder(const FieldInfo& first, const FieldInfo& second)
+constexpr bool
+compareFieldSortOrder(const FieldInfo& first, const FieldInfo& second) noexcept
 {
   return (first.locationSortOrder < second.locationSortOrder) ||
          (first.locationSortOrder == second.locationSortOrder && first.tlvType < second.tlvType);
@@ -183,7 +171,7 @@
 }
 
 bool
-Packet::comparePos(uint64_t first, const Block& second)
+Packet::comparePos(uint64_t first, const Block& second) noexcept
 {
   FieldInfo firstInfo(first);
   FieldInfo secondInfo(second.type());
diff --git a/src/lp/packet.hpp b/src/lp/packet.hpp
index eb30485..1aba8b1 100644
--- a/src/lp/packet.hpp
+++ b/src/lp/packet.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -204,7 +204,7 @@
 
 private:
   static bool
-  comparePos(uint64_t first, const Block& second);
+  comparePos(uint64_t first, const Block& second) noexcept;
 
 private:
   mutable Block m_wire;
diff --git a/tests/unit-tests/encoding/estimator.t.cpp b/tests/unit-tests/encoding/estimator.t.cpp
index 700ea95..8ab4399 100644
--- a/tests/unit-tests/encoding/estimator.t.cpp
+++ b/tests/unit-tests/encoding/estimator.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2016 Regents of the University of California.
+/*
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -33,23 +33,21 @@
 BOOST_AUTO_TEST_CASE(Basic)
 {
   Estimator e;
-  Estimator e1(100);
-  Estimator e2(100, 100);
 
   BOOST_CHECK_EQUAL(e.prependByte(1), 1);
   BOOST_CHECK_EQUAL(e.appendByte(1), 1);
 
   uint8_t buf1[] = {'t', 'e', 's', 't', '1'};
-  BOOST_CHECK_EQUAL(e1.prependByteArray(buf1, sizeof(buf1)), 5);
-  BOOST_CHECK_EQUAL(e1.appendByteArray(buf1, sizeof(buf1)), 5);
+  BOOST_CHECK_EQUAL(e.prependByteArray(buf1, sizeof(buf1)), 5);
+  BOOST_CHECK_EQUAL(e.appendByteArray(buf1, sizeof(buf1)), 5);
 
   std::vector<uint8_t> buf2 = {'t', 'e', 's', 't', '2'};
-  BOOST_CHECK_EQUAL(e1.prependRange(buf2.begin(), buf2.end()), 5);
-  BOOST_CHECK_EQUAL(e1.appendRange(buf2.begin(), buf2.end()), 5);
+  BOOST_CHECK_EQUAL(e.prependRange(buf2.begin(), buf2.end()), 5);
+  BOOST_CHECK_EQUAL(e.appendRange(buf2.begin(), buf2.end()), 5);
 
   std::list<uint8_t> buf3 = {'t', 'e', 's', 't', '2'};
-  BOOST_CHECK_EQUAL(e2.prependRange(buf3.begin(), buf3.end()), 5);
-  BOOST_CHECK_EQUAL(e2.appendRange(buf3.begin(), buf3.end()), 5);
+  BOOST_CHECK_EQUAL(e.prependRange(buf3.begin(), buf3.end()), 5);
+  BOOST_CHECK_EQUAL(e.appendRange(buf3.begin(), buf3.end()), 5);
 }
 
 BOOST_AUTO_TEST_CASE(Tlv)
diff --git a/tests/unit-tests/encoding/tlv.t.cpp b/tests/unit-tests/encoding/tlv.t.cpp
index 299b31c..f8e2f9e 100644
--- a/tests/unit-tests/encoding/tlv.t.cpp
+++ b/tests/unit-tests/encoding/tlv.t.cpp
@@ -20,6 +20,7 @@
  */
 
 #include "encoding/tlv.hpp"
+#include "encoding/buffer.hpp"
 
 #include "boost-test.hpp"
 
