diff --git a/include/ndn-cpp-dev/encoding/binary-xml-wire-format.hpp b/include/ndn-cpp-dev/encoding/binary-xml-wire-format.hpp
deleted file mode 100644
index cb4f0aa..0000000
--- a/include/ndn-cpp-dev/encoding/binary-xml-wire-format.hpp
+++ /dev/null
@@ -1,88 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/**
- * Copyright (C) 2013 Regents of the University of California.
- * @author: Jeff Thompson <jefft0@remap.ucla.edu>
- * See COPYING for copyright and distribution information.
- */
-
-#ifndef NDN_BINARYXMLWIREFORMAT_HPP
-#define NDN_BINARYXMLWIREFORMAT_HPP
-
-#include "wire-format.hpp"
-
-namespace ndn {
-
-/**
- * A BinaryXmlWireFormat extends WireFormat to override its virtual methods to implement encoding and decoding
- * using binary XML.
- */
-class BinaryXmlWireFormat : public WireFormat {
-public:
-  /**
-   * Encode interest in binary XML and return the encoding.
-   * @param interest The Interest object to encode.
-   * @return A Blob containing the encoding.
-   */  
-  virtual Blob 
-  encodeInterest(const Interest& interest);
-    
-  /**
-   * Decode input as an interest in binary XML and set the fields of the interest object.
-   * @param interest The Interest object whose fields are updated.
-   * @param input A pointer to the input buffer to decode.
-   * @param inputLength The number of bytes in input.
-   */
-  virtual void 
-  decodeInterest(Interest& interest, const uint8_t *input, size_t inputLength);
-
-  /**
-   * Encode data with binary XML and return the encoding.
-   * @param data The Data object to encode.
-   * @param signedPortionBeginOffset Return the offset in the encoding of the beginning of the signed portion.
-   * If you are not encoding in order to sign, you can call encodeData(const Data& data) to ignore this returned value.
-   * @param signedPortionEndOffset Return the offset in the encoding of the end of the signed portion.
-   * If you are not encoding in order to sign, you can call encodeData(const Data& data) to ignore this returned value.
-   * @return A Blob containing the encoding.
-   */
-  virtual Blob 
-  encodeData
-    (const Data& data, size_t *signedPortionBeginOffset, size_t *signedPortionEndOffset);
-  
-  /**
-   * Decode input as a data packet in binary XML and set the fields in the data object.
-   * @param data The Data object whose fields are updated.
-   * @param input A pointer to the input buffer to decode.
-   * @param inputLength The number of bytes in input.
-   * @param signedPortionBeginOffset Return the offset in the input buffer of the beginning of the signed portion.
-   * If you are not decoding in order to verify, you can call 
-   * decodeData(Data& data, const uint8_t *input, size_t inputLength) to ignore this returned value.
-   * @param signedPortionEndOffset Return the offset in the input buffer of the end of the signed portion.
-   * If you are not decoding in order to verify, you can call 
-   * decodeData(Data& data, const uint8_t *input, size_t inputLength) to ignore this returned value.
-   */  
-  virtual void 
-  decodeData
-    (Data& data, const uint8_t *input, size_t inputLength, size_t *signedPortionBeginOffset, size_t *signedPortionEndOffset);
-
-  /**
-   * Encode forwardingEntry in binary XML and return the encoding. 
-   * @param forwardingEntry The ForwardingEntry object to encode.
-   * @return A Blob containing the encoding.
-   */
-  virtual Blob 
-  encodeForwardingEntry(const ForwardingEntry& forwardingEntry);
-  
-  /**
-   * Decode input as a forwarding entry in binary XML and set the fields of the forwardingEntry object. 
-   * @param forwardingEntry The ForwardingEntry object whose fields are updated.
-   * @param input A pointer to the input buffer to decode.
-   * @param inputLength The number of bytes in input.
-   */
-  virtual void 
-  decodeForwardingEntry(ForwardingEntry& forwardingEntry, const uint8_t *input, size_t inputLength);
-};
-  
-}
-
-#endif
-
diff --git a/include/ndn-cpp-dev/encoding/element-listener.hpp b/include/ndn-cpp-dev/encoding/element-listener.hpp
deleted file mode 100644
index 7d13312..0000000
--- a/include/ndn-cpp-dev/encoding/element-listener.hpp
+++ /dev/null
@@ -1,48 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/**
- * Copyright (C) 2013 Regents of the University of California.
- * @author: Jeff Thompson <jefft0@remap.ucla.edu>
- * See COPYING for copyright and distribution information.
- */
-
-#ifndef NDN_ELEMENT_LISTENER_HPP
-#define NDN_ELEMENT_LISTENER_HPP
-
-#include "../c/encoding/element-listener.h"
-
-namespace ndn {
-
-/**
- * An ElementListener extends an ndn_ElementListener struct to proved an abstract virtual onReceivedElement function which wraps
- * the onReceivedElement used by the ndn_ElementListener struct.  You must extend this class to override onReceivedElement.
- */
-class ElementListener : public ndn_ElementListener {
-public:
-  ElementListener() 
-  {
-    ndn_ElementListener_initialize(this, staticOnReceivedElement);
-  }
-  
-  /**
-   * This is called when an entire binary XML element is received.  You must extend this class to override this method.
-   * @param element pointer to the binary XML element.  This buffer is only valid during this call.  If you need the data
-   * later, you must copy.
-   * @param elementLength length of element
-   */
-  virtual void 
-  onReceivedElement(const uint8_t *element, size_t elementLength) = 0;
-  
-private:
-  /**
-   * Call the virtual method onReceivedElement. This is used to initialize the base ndn_ElementListener struct.
-   * @param self
-   * @param element
-   * @param elementLength
-   */
-  static void 
-  staticOnReceivedElement(struct ndn_ElementListener *self, uint8_t *element, size_t elementLength);
-};
-
-}
-
-#endif
diff --git a/include/ndn-cpp-dev/encoding/endian.h b/include/ndn-cpp-dev/encoding/endian.hpp
similarity index 100%
rename from include/ndn-cpp-dev/encoding/endian.h
rename to include/ndn-cpp-dev/encoding/endian.hpp
diff --git a/include/ndn-cpp-dev/encoding/tlv.hpp b/include/ndn-cpp-dev/encoding/tlv.hpp
index 3d42402..511d0f6 100644
--- a/include/ndn-cpp-dev/encoding/tlv.hpp
+++ b/include/ndn-cpp-dev/encoding/tlv.hpp
@@ -13,7 +13,7 @@
 #include <stdexcept>
 #include <iterator>
 #include "buffer.hpp"
-#include "endian.h"
+#include "endian.hpp"
 
 namespace ndn {
 
diff --git a/include/ndn-cpp-dev/encoding/wire-format.hpp b/include/ndn-cpp-dev/encoding/wire-format.hpp
deleted file mode 100644
index 1a40cd1..0000000
--- a/include/ndn-cpp-dev/encoding/wire-format.hpp
+++ /dev/null
@@ -1,146 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/**
- * Copyright (C) 2013 Regents of the University of California.
- * @author: Jeff Thompson <jefft0@remap.ucla.edu>
- * See COPYING for copyright and distribution information.
- */
-
-#ifndef NDN_WIREFORMAT_HPP
-#define NDN_WIREFORMAT_HPP
-
-#include "../common.hpp"
-#include "../util/blob.hpp"
-
-namespace ndn {
-  
-class Interest;
-class Data;
-class ForwardingEntry;
-  
-class WireFormat {
-public:
-  /**
-   * Encode interest and return the encoding.  Your derived class should override.
-   * @param interest The Interest object to encode.
-   * @return A Blob containing the encoding.
-   * @throw logic_error for unimplemented if the derived class does not override.
-   */
-  virtual Blob 
-  encodeInterest(const Interest& interest);
-  
-  /**
-   * Decode input as an interest and set the fields of the interest object.  Your derived class should override.
-   * @param interest The Interest object whose fields are updated.
-   * @param input A pointer to the input buffer to decode.
-   * @param inputLength The number of bytes in input.
-   * @throw logic_error for unimplemented if the derived class does not override.
-   */
-  virtual void 
-  decodeInterest(Interest& interest, const uint8_t *input, size_t inputLength);
-
-  /**
-   * Encode data and return the encoding.  Your derived class should override.
-   * @param data The Data object to encode.
-   * @param signedPortionBeginOffset Return the offset in the encoding of the beginning of the signed portion.
-   * If you are not encoding in order to sign, you can call encodeData(const Data& data) to ignore this returned value.
-   * @param signedPortionEndOffset Return the offset in the encoding of the end of the signed portion.
-   * If you are not encoding in order to sign, you can call encodeData(const Data& data) to ignore this returned value.
-   * @return A Blob containing the encoding.
-   * @throw logic_error for unimplemented if the derived class does not override.
-   */
-  virtual Blob 
-  encodeData
-    (const Data& data, size_t *signedPortionBeginOffset, size_t *signedPortionEndOffset);
-
-  /**
-   * Encode data and return the encoding.
-   * @param data The Data object to encode.
-   * @return A Blob containing the encoding.
-   * @throw logic_error for unimplemented if the derived class does not override.
-   */
-  Blob 
-  encodeData(const Data& data)
-  {
-    size_t dummyBeginOffset, dummyEndOffset;
-    return encodeData(data, &dummyBeginOffset, &dummyEndOffset);
-  }
-
-  /**
-   * Decode input as a data packet and set the fields in the data object.  Your derived class should override.
-   * @param data The Data object whose fields are updated.
-   * @param input A pointer to the input buffer to decode.
-   * @param inputLength The number of bytes in input.
-   * @param signedPortionBeginOffset Return the offset in the input buffer of the beginning of the signed portion.
-   * If you are not decoding in order to verify, you can call 
-   * decodeData(Data& data, const uint8_t *input, size_t inputLength) to ignore this returned value.
-   * @param signedPortionEndOffset Return the offset in the input buffer of the end of the signed portion.
-   * If you are not decoding in order to verify, you can call 
-   * decodeData(Data& data, const uint8_t *input, size_t inputLength) to ignore this returned value.
-   * @throw logic_error for unimplemented if the derived class does not override.
-   */  
-  virtual void 
-  decodeData
-    (Data& data, const uint8_t *input, size_t inputLength, size_t *signedPortionBeginOffset, size_t *signedPortionEndOffset);
-
-  void 
-  decodeData(Data& data, const uint8_t *input, size_t inputLength)
-  {
-    size_t dummyBeginOffset, dummyEndOffset;
-    decodeData(data, input, inputLength, &dummyBeginOffset, &dummyEndOffset);
-  }
-  
-  /**
-   * Encode forwardingEntry and return the encoding.  Your derived class should override.
-   * @param forwardingEntry The ForwardingEntry object to encode.
-   * @return A Blob containing the encoding.
-   * @throw logic_error for unimplemented if the derived class does not override.
-   */
-  virtual Blob 
-  encodeForwardingEntry(const ForwardingEntry& forwardingEntry);
-  
-  /**
-   * Decode input as a forwarding entry and set the fields of the forwardingEntry object.  Your derived class should override.
-   * @param forwardingEntry The ForwardingEntry object whose fields are updated.
-   * @param input A pointer to the input buffer to decode.
-   * @param inputLength The number of bytes in input.
-   * @throw logic_error for unimplemented if the derived class does not override.
-   */
-  virtual void 
-  decodeForwardingEntry(ForwardingEntry& forwardingEntry, const uint8_t *input, size_t inputLength);
-
-  /**
-   * Set the static default WireFormat used by default encoding and decoding methods.
-   * @param wireFormat A Pointer to an object of a subclass of WireFormat.  This does not make a copy and
-   * the caller must ensure that the object remains allocated.
-   */
-  static void 
-  setDefaultWireFormat(WireFormat *wireFormat) 
-  {
-    defaultWireFormat_ = wireFormat;
-  }
-  
-  /**
-   * Return the default WireFormat used by default encoding and decoding methods which was set with
-   * setDefaultWireFormat.
-   * @return A pointer to the WireFormat object.
-   */
-  static WireFormat*
-  getDefaultWireFormat();
-  
-private:
-  /**
-   * This is implemented by only one of the subclasses of WireFormat to return a new object used
-   * as the initial value for the default WireFormat.  If the application doesn't include that class, then the application
-   * needs to include another subclass which defines WireFormat::newInitialDefaultWireFormat.
-   * @return a new object, which is held by a shared_ptr and freed when the application exits.
-   */
-  static WireFormat*
-  newInitialDefaultWireFormat();
-  
-  static WireFormat *defaultWireFormat_;
-};
-
-}
-
-#endif
-
