diff --git a/ndn-cpp/encoding/binary-xml-decoder.hpp b/ndn-cpp/encoding/binary-xml-decoder.hpp
index 0a556f4..7b28e7f 100644
--- a/ndn-cpp/encoding/binary-xml-decoder.hpp
+++ b/ndn-cpp/encoding/binary-xml-decoder.hpp
@@ -33,7 +33,8 @@
    * @param expectedTag the expected value for DTAG
    * @return true if got the expected tag, else false
    */
-  bool peekDTag(unsigned int expectedTag) 
+  bool 
+  peekDTag(unsigned int expectedTag) 
   {
     int gotExpectedTag;
     ndn_Error error;
diff --git a/ndn-cpp/encoding/binary-xml-element-reader.cpp b/ndn-cpp/encoding/binary-xml-element-reader.cpp
index e597eb8..6a7c5ad 100644
--- a/ndn-cpp/encoding/binary-xml-element-reader.cpp
+++ b/ndn-cpp/encoding/binary-xml-element-reader.cpp
@@ -8,7 +8,8 @@
 
 namespace ndn {
 
-void ElementListener::staticOnReceivedElement(struct ndn_ElementListener *self, unsigned char *element, unsigned int elementLength)
+void 
+ElementListener::staticOnReceivedElement(struct ndn_ElementListener *self, unsigned char *element, unsigned int elementLength)
 {
   ((ElementListener *)self)->onReceivedElement(element, elementLength);
 }
diff --git a/ndn-cpp/encoding/binary-xml-element-reader.hpp b/ndn-cpp/encoding/binary-xml-element-reader.hpp
index f2a86ff..c86b99a 100644
--- a/ndn-cpp/encoding/binary-xml-element-reader.hpp
+++ b/ndn-cpp/encoding/binary-xml-element-reader.hpp
@@ -28,7 +28,8 @@
    * later, you must copy.
    * @param elementLength length of element
    */
-  virtual void onReceivedElement(const unsigned char *element, unsigned int elementLength) = 0;
+  virtual void 
+  onReceivedElement(const unsigned char *element, unsigned int elementLength) = 0;
   
 private:
   /**
@@ -37,7 +38,8 @@
    * @param element
    * @param elementLength
    */
-  static void staticOnReceivedElement(struct ndn_ElementListener *self, unsigned char *element, unsigned int elementLength);
+  static void 
+  staticOnReceivedElement(struct ndn_ElementListener *self, unsigned char *element, unsigned int elementLength);
 };
 
 }
diff --git a/ndn-cpp/encoding/binary-xml-encoder.hpp b/ndn-cpp/encoding/binary-xml-encoder.hpp
index d64b3e5..7c7f626 100644
--- a/ndn-cpp/encoding/binary-xml-encoder.hpp
+++ b/ndn-cpp/encoding/binary-xml-encoder.hpp
@@ -32,7 +32,8 @@
    * Resize the output vector to the correct encoding length and return.
    * @return The encoding as a shared_ptr.  Assume that the caller now owns the vector.
    */
-  const ptr_lib::shared_ptr<std::vector<unsigned char> >& getOutput() 
+  const ptr_lib::shared_ptr<std::vector<unsigned char> >& 
+  getOutput() 
   {
     output_.get()->resize(offset);
     return output_.get();
diff --git a/ndn-cpp/encoding/binary-xml-structure-decoder.hpp b/ndn-cpp/encoding/binary-xml-structure-decoder.hpp
index dbe5932..a1911ea 100644
--- a/ndn-cpp/encoding/binary-xml-structure-decoder.hpp
+++ b/ndn-cpp/encoding/binary-xml-structure-decoder.hpp
@@ -30,7 +30,8 @@
    * @param inputLength the number of bytes in input.
    * @return true if found the element end, false if need to read more. (This is the same as returning gotElementEnd().)
    */
-  bool findElementEnd(unsigned char *input, unsigned int inputLength) 
+  bool 
+  findElementEnd(unsigned char *input, unsigned int inputLength) 
   {
     ndn_Error error;
     if ((error = ndn_BinaryXmlStructureDecoder_findElementEnd(this, input, inputLength)))
@@ -38,8 +39,11 @@
     return gotElementEnd();
   }
   
-  unsigned int getOffset() const { return offset; }
-  bool gotElementEnd() const { return gotElementEnd != 0; }
+  unsigned int 
+  getOffset() const { return offset; }
+  
+  bool 
+  gotElementEnd() const { return gotElementEnd != 0; }
 };
 
 }
diff --git a/ndn-cpp/encoding/binary-xml-wire-format.cpp b/ndn-cpp/encoding/binary-xml-wire-format.cpp
index 930f89d..71f74d5 100644
--- a/ndn-cpp/encoding/binary-xml-wire-format.cpp
+++ b/ndn-cpp/encoding/binary-xml-wire-format.cpp
@@ -20,12 +20,14 @@
 namespace ndn {
 
 // This is declared in the WireFormat class.
-WireFormat *WireFormat::newInitialDefaultWireFormat() 
+WireFormat*
+WireFormat::newInitialDefaultWireFormat() 
 {
   return new BinaryXmlWireFormat();
 }
   
-Blob BinaryXmlWireFormat::encodeInterest(const Interest& interest) 
+Blob 
+BinaryXmlWireFormat::encodeInterest(const Interest& interest) 
 {
   struct ndn_NameComponent nameComponents[100];
   struct ndn_ExcludeEntry excludeEntries[100];
@@ -43,7 +45,8 @@
   return encoder.getOutput();
 }
 
-void BinaryXmlWireFormat::decodeInterest(Interest& interest, const unsigned char *input, unsigned int inputLength)
+void 
+BinaryXmlWireFormat::decodeInterest(Interest& interest, const unsigned char *input, unsigned int inputLength)
 {
   struct ndn_NameComponent nameComponents[100];
   struct ndn_ExcludeEntry excludeEntries[100];
@@ -60,7 +63,8 @@
   interest.set(interestStruct);
 }
 
-Blob BinaryXmlWireFormat::encodeData(const Data& data, unsigned int *signedPortionBeginOffset, unsigned int *signedPortionEndOffset) 
+Blob 
+BinaryXmlWireFormat::encodeData(const Data& data, unsigned int *signedPortionBeginOffset, unsigned int *signedPortionEndOffset) 
 {
   struct ndn_NameComponent nameComponents[100];
   struct ndn_NameComponent keyNameComponents[100];
@@ -78,7 +82,8 @@
   return encoder.getOutput();
 }
 
-void BinaryXmlWireFormat::decodeData
+void 
+BinaryXmlWireFormat::decodeData
   (Data& data, const unsigned char *input, unsigned int inputLength, unsigned int *signedPortionBeginOffset, unsigned int *signedPortionEndOffset)
 {
   struct ndn_NameComponent nameComponents[100];
@@ -96,7 +101,8 @@
   data.set(dataStruct);
 }
 
-Blob BinaryXmlWireFormat::encodeForwardingEntry(const ForwardingEntry& forwardingEntry) 
+Blob 
+BinaryXmlWireFormat::encodeForwardingEntry(const ForwardingEntry& forwardingEntry) 
 {
   struct ndn_NameComponent prefixNameComponents[100];
   struct ndn_ForwardingEntry forwardingEntryStruct;
@@ -112,7 +118,8 @@
   return encoder.getOutput();
 }
 
-void BinaryXmlWireFormat::decodeForwardingEntry(ForwardingEntry& forwardingEntry, const unsigned char *input, unsigned int inputLength)
+void 
+BinaryXmlWireFormat::decodeForwardingEntry(ForwardingEntry& forwardingEntry, const unsigned char *input, unsigned int inputLength)
 {
   struct ndn_NameComponent prefixNameComponents[100];
   struct ndn_ForwardingEntry forwardingEntryStruct;
diff --git a/ndn-cpp/encoding/binary-xml-wire-format.hpp b/ndn-cpp/encoding/binary-xml-wire-format.hpp
index ebb7412..350561e 100644
--- a/ndn-cpp/encoding/binary-xml-wire-format.hpp
+++ b/ndn-cpp/encoding/binary-xml-wire-format.hpp
@@ -22,7 +22,8 @@
    * @param interest The Interest object to encode.
    * @return A Blob containing the encoding.
    */  
-  virtual Blob encodeInterest(const Interest& interest);
+  virtual Blob 
+  encodeInterest(const Interest& interest);
     
   /**
    * Decode input as an interest in binary XML and set the fields of the interest object.
@@ -30,7 +31,8 @@
    * @param input A pointer to the input buffer to decode.
    * @param inputLength The number of bytes in input.
    */
-  virtual void decodeInterest(Interest& interest, const unsigned char *input, unsigned int inputLength);
+  virtual void 
+  decodeInterest(Interest& interest, const unsigned char *input, unsigned int inputLength);
 
   /**
    * Encode data with binary XML and return the encoding.
@@ -41,7 +43,8 @@
    * 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
+  virtual Blob 
+  encodeData
     (const Data& data, unsigned int *signedPortionBeginOffset, unsigned int *signedPortionEndOffset);
   
   /**
@@ -56,7 +59,8 @@
    * If you are not decoding in order to verify, you can call 
    * decodeData(Data& data, const unsigned char *input, unsigned int inputLength) to ignore this returned value.
    */  
-  virtual void decodeData
+  virtual void 
+  decodeData
     (Data& data, const unsigned char *input, unsigned int inputLength, unsigned int *signedPortionBeginOffset, unsigned int *signedPortionEndOffset);
 
   /**
@@ -64,7 +68,8 @@
    * @param forwardingEntry The ForwardingEntry object to encode.
    * @return A Blob containing the encoding.
    */
-  virtual Blob encodeForwardingEntry(const ForwardingEntry& forwardingEntry);
+  virtual Blob 
+  encodeForwardingEntry(const ForwardingEntry& forwardingEntry);
   
   /**
    * Decode input as a forwarding entry in binary XML and set the fields of the forwardingEntry object. 
@@ -72,7 +77,8 @@
    * @param input A pointer to the input buffer to decode.
    * @param inputLength The number of bytes in input.
    */
-  virtual void decodeForwardingEntry(ForwardingEntry& forwardingEntry, const unsigned char *input, unsigned int inputLength);
+  virtual void 
+  decodeForwardingEntry(ForwardingEntry& forwardingEntry, const unsigned char *input, unsigned int inputLength);
 };
   
 }
diff --git a/ndn-cpp/encoding/wire-format.cpp b/ndn-cpp/encoding/wire-format.cpp
index fc39a7b..41c1f39 100644
--- a/ndn-cpp/encoding/wire-format.cpp
+++ b/ndn-cpp/encoding/wire-format.cpp
@@ -13,9 +13,10 @@
 
 static bool gotInitialDefaultWireFormat = false;
 
-WireFormat *WireFormat::defaultWireFormat_ = 0;
+WireFormat* WireFormat::defaultWireFormat_ = 0;
 
-WireFormat *WireFormat::getDefaultWireFormat()
+WireFormat*
+WireFormat::getDefaultWireFormat()
 {
   if (!defaultWireFormat_ && !gotInitialDefaultWireFormat) {
     // There is no defaultWireFormat_ and we have not yet initialized initialDefaultWireFormat_, so initialize and use it.
@@ -27,30 +28,39 @@
   return defaultWireFormat_;
 }
 
-Blob WireFormat::encodeInterest(const Interest& interest) 
-{
-  throw logic_error("unimplemented");
-}
-void WireFormat::decodeInterest(Interest& interest, const unsigned char *input, unsigned int inputLength) 
+Blob 
+WireFormat::encodeInterest(const Interest& interest) 
 {
   throw logic_error("unimplemented");
 }
 
-Blob WireFormat::encodeData(const Data& data, unsigned int *signedPortionBeginOffset, unsigned int *signedPortionEndOffset) 
+void 
+WireFormat::decodeInterest(Interest& interest, const unsigned char *input, unsigned int inputLength) 
 {
   throw logic_error("unimplemented");
 }
-void WireFormat::decodeData
+
+Blob 
+WireFormat::encodeData(const Data& data, unsigned int *signedPortionBeginOffset, unsigned int *signedPortionEndOffset) 
+{
+  throw logic_error("unimplemented");
+}
+
+void 
+WireFormat::decodeData
   (Data& data, const unsigned char *input, unsigned int inputLength, unsigned int *signedPortionBeginOffset, unsigned int *signedPortionEndOffset) 
 {
   throw logic_error("unimplemented");
 }
 
-Blob WireFormat::encodeForwardingEntry(const ForwardingEntry& forwardingEntry) 
+Blob 
+WireFormat::encodeForwardingEntry(const ForwardingEntry& forwardingEntry) 
 {
   throw logic_error("unimplemented");
 }
-void WireFormat::decodeForwardingEntry(ForwardingEntry& forwardingEntry, const unsigned char *input, unsigned int inputLength) 
+
+void 
+WireFormat::decodeForwardingEntry(ForwardingEntry& forwardingEntry, const unsigned char *input, unsigned int inputLength) 
 {
   throw logic_error("unimplemented");
 }
diff --git a/ndn-cpp/encoding/wire-format.hpp b/ndn-cpp/encoding/wire-format.hpp
index a892659..02e7a8c 100644
--- a/ndn-cpp/encoding/wire-format.hpp
+++ b/ndn-cpp/encoding/wire-format.hpp
@@ -24,7 +24,8 @@
    * @return A Blob containing the encoding.
    * @throw logic_error for unimplemented if the derived class does not override.
    */
-  virtual Blob encodeInterest(const Interest& interest);
+  virtual Blob 
+  encodeInterest(const Interest& interest);
   
   /**
    * Decode input as an interest and set the fields of the interest object.  Your derived class should override.
@@ -33,7 +34,8 @@
    * @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 unsigned char *input, unsigned int inputLength);
+  virtual void 
+  decodeInterest(Interest& interest, const unsigned char *input, unsigned int inputLength);
 
   /**
    * Encode data and return the encoding.  Your derived class should override.
@@ -45,7 +47,8 @@
    * @return A Blob containing the encoding.
    * @throw logic_error for unimplemented if the derived class does not override.
    */
-  virtual Blob encodeData
+  virtual Blob 
+  encodeData
     (const Data& data, unsigned int *signedPortionBeginOffset, unsigned int *signedPortionEndOffset);
 
   /**
@@ -54,7 +57,8 @@
    * @return A Blob containing the encoding.
    * @throw logic_error for unimplemented if the derived class does not override.
    */
-  Blob encodeData(const Data& data)
+  Blob 
+  encodeData(const Data& data)
   {
     unsigned int dummyBeginOffset, dummyEndOffset;
     return encodeData(data, &dummyBeginOffset, &dummyEndOffset);
@@ -73,10 +77,12 @@
    * decodeData(Data& data, const unsigned char *input, unsigned int inputLength) to ignore this returned value.
    * @throw logic_error for unimplemented if the derived class does not override.
    */  
-  virtual void decodeData
+  virtual void 
+  decodeData
     (Data& data, const unsigned char *input, unsigned int inputLength, unsigned int *signedPortionBeginOffset, unsigned int *signedPortionEndOffset);
 
-  void decodeData(Data& data, const unsigned char *input, unsigned int inputLength)
+  void 
+  decodeData(Data& data, const unsigned char *input, unsigned int inputLength)
   {
     unsigned int dummyBeginOffset, dummyEndOffset;
     decodeData(data, input, inputLength, &dummyBeginOffset, &dummyEndOffset);
@@ -88,7 +94,8 @@
    * @return A Blob containing the encoding.
    * @throw logic_error for unimplemented if the derived class does not override.
    */
-  virtual Blob encodeForwardingEntry(const ForwardingEntry& forwardingEntry);
+  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.
@@ -97,14 +104,16 @@
    * @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 unsigned char *input, unsigned int inputLength);
+  virtual void 
+  decodeForwardingEntry(ForwardingEntry& forwardingEntry, const unsigned char *input, unsigned int 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) 
+  static void 
+  setDefaultWireFormat(WireFormat *wireFormat) 
   {
     defaultWireFormat_ = wireFormat;
   }
@@ -114,7 +123,8 @@
    * setDefaultWireFormat.
    * @return A pointer to the WireFormat object.
    */
-  static WireFormat *getDefaultWireFormat();
+  static WireFormat*
+  getDefaultWireFormat();
   
 private:
   /**
@@ -123,7 +133,8 @@
    * 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*
+  newInitialDefaultWireFormat();
   
   static WireFormat *defaultWireFormat_;
 };
