diff --git a/ndn-cpp/common.cpp b/ndn-cpp/common.cpp
index 498abe1..d1c55f3 100644
--- a/ndn-cpp/common.cpp
+++ b/ndn-cpp/common.cpp
@@ -11,7 +11,8 @@
 
 namespace ndn {
 
-string toHex(const vector<unsigned char>& array) 
+string 
+toHex(const vector<unsigned char>& array) 
 {
   if (!&array)
     return "";
diff --git a/ndn-cpp/common.hpp b/ndn-cpp/common.hpp
index ebf6992..4e451a9 100644
--- a/ndn-cpp/common.hpp
+++ b/ndn-cpp/common.hpp
@@ -56,7 +56,8 @@
  * @param array The array of bytes.
  * @return Hex string.
  */
-std::string toHex(const std::vector<unsigned char>& array);
+std::string 
+toHex(const std::vector<unsigned char>& array);
 
 }
 
diff --git a/ndn-cpp/data.cpp b/ndn-cpp/data.cpp
index ea726c1..684a061 100644
--- a/ndn-cpp/data.cpp
+++ b/ndn-cpp/data.cpp
@@ -16,7 +16,8 @@
 {
 }
   
-void MetaInfo::get(struct ndn_MetaInfo& metaInfoStruct) const 
+void 
+MetaInfo::get(struct ndn_MetaInfo& metaInfoStruct) const 
 {
   metaInfoStruct.timestampMilliseconds = timestampMilliseconds_;
   metaInfoStruct.type = type_;
@@ -24,7 +25,8 @@
   finalBlockID_.get(metaInfoStruct.finalBlockID);
 }
 
-void MetaInfo::set(const struct ndn_MetaInfo& metaInfoStruct)
+void 
+MetaInfo::set(const struct ndn_MetaInfo& metaInfoStruct)
 {
   timestampMilliseconds_ = metaInfoStruct.timestampMilliseconds;
   type_ = metaInfoStruct.type;
@@ -42,7 +44,8 @@
 {
 }
 
-void Data::get(struct ndn_Data& dataStruct) const 
+void 
+Data::get(struct ndn_Data& dataStruct) const 
 {
   signature_->get(dataStruct.signature);
   name_.get(dataStruct.name);
@@ -55,7 +58,8 @@
     dataStruct.content = 0;
 }
 
-void Data::set(const struct ndn_Data& dataStruct)
+void 
+Data::set(const struct ndn_Data& dataStruct)
 {
   signature_->set(dataStruct.signature);
   name_.set(dataStruct.name);
@@ -65,7 +69,8 @@
   onChanged();
 }
 
-SignedBlob Data::wireEncode(WireFormat& wireFormat) 
+SignedBlob 
+Data::wireEncode(WireFormat& wireFormat) 
 {
   unsigned int signedPortionBeginOffset, signedPortionEndOffset;
   Blob encoding = wireFormat.encodeData(*this, &signedPortionBeginOffset, &signedPortionEndOffset);
@@ -74,7 +79,8 @@
   return wireEncoding_;
 }
 
-void Data::wireDecode(const unsigned char* input, unsigned int inputLength, WireFormat& wireFormat) 
+void 
+Data::wireDecode(const unsigned char* input, unsigned int inputLength, WireFormat& wireFormat) 
 {
   unsigned int signedPortionBeginOffset, signedPortionEndOffset;
   wireFormat.decodeData(*this, input, inputLength, &signedPortionBeginOffset, &signedPortionEndOffset);
@@ -82,7 +88,8 @@
   wireEncoding_ = SignedBlob(input, inputLength, signedPortionBeginOffset, signedPortionEndOffset);
 }
 
-void Data::onChanged()
+void 
+Data::onChanged()
 {
   wireEncoding_ = SignedBlob();
 }
diff --git a/ndn-cpp/data.hpp b/ndn-cpp/data.hpp
index 0afaf81..cde7302 100644
--- a/ndn-cpp/data.hpp
+++ b/ndn-cpp/data.hpp
@@ -24,12 +24,14 @@
    * Return a pointer to a new Signature which is a copy of this signature.
    * This is pure virtual, the subclass must implement it.
    */
-  virtual ptr_lib::shared_ptr<Signature> clone() const = 0;
+  virtual ptr_lib::shared_ptr<Signature> 
+  clone() const = 0;
   
   /**
    * The virtual destructor.
    */
-  virtual ~Signature();
+  virtual 
+  ~Signature();
   
     /**
    * Set the signatureStruct to point to the values in this signature object, without copying any memory.
@@ -37,14 +39,16 @@
    * This is pure virtual, the subclass must implement it.
    * @param signatureStruct a C ndn_Signature struct where the name components array is already allocated.
    */
-  virtual void get(struct ndn_Signature& signatureStruct) const = 0;
+  virtual void 
+  get(struct ndn_Signature& signatureStruct) const = 0;
 
   /**
    * Clear this signature, and set the values by copying from the ndn_Signature struct.
    * This is pure virtual, the subclass must implement it.
    * @param signatureStruct a C ndn_Signature struct
    */
-  virtual void set(const struct ndn_Signature& signatureStruct) = 0;
+  virtual void 
+  set(const struct ndn_Signature& signatureStruct) = 0;
 };
 
 /**
@@ -63,30 +67,42 @@
    * WARNING: The resulting pointers in metaInfoStruct are invalid after a further use of this object which could reallocate memory.
    * @param metaInfoStruct a C ndn_MetaInfo struct where the name components array is already allocated.
    */
-  void get(struct ndn_MetaInfo& metaInfoStruct) const;
+  void 
+  get(struct ndn_MetaInfo& metaInfoStruct) const;
 
   /**
    * Clear this meta info, and set the values by copying from the ndn_MetaInfo struct.
    * @param metaInfoStruct a C ndn_MetaInfo struct
    */
-  void set(const struct ndn_MetaInfo& metaInfoStruct);
+  void 
+  set(const struct ndn_MetaInfo& metaInfoStruct);
 
-  double getTimestampMilliseconds() const { return timestampMilliseconds_; }
+  double 
+  getTimestampMilliseconds() const { return timestampMilliseconds_; }
   
-  ndn_ContentType getType() const { return type_; }
+  ndn_ContentType 
+  getType() const { return type_; }
   
-  int getFreshnessSeconds() const { return freshnessSeconds_; }
+  int 
+  getFreshnessSeconds() const { return freshnessSeconds_; }
   
-  const Name::Component& getFinalBlockID() const { return finalBlockID_; }
+  const Name::Component& 
+  getFinalBlockID() const { return finalBlockID_; }
   
-  void setTimestampMilliseconds(double timestampMilliseconds) { timestampMilliseconds_ = timestampMilliseconds; }
+  void 
+  setTimestampMilliseconds(double timestampMilliseconds) { timestampMilliseconds_ = timestampMilliseconds; }
   
-  void setType(ndn_ContentType type) { type_ = type; }
+  void 
+  setType(ndn_ContentType type) { type_ = type; }
   
-  void setFreshnessSeconds(int freshnessSeconds) { freshnessSeconds_ = freshnessSeconds; }
+  void 
+  setFreshnessSeconds(int freshnessSeconds) { freshnessSeconds_ = freshnessSeconds; }
   
-  void setFinalBlockID(const std::vector<unsigned char>& finalBlockID) { finalBlockID_ = Name::Component(finalBlockID); }
-  void setFinalBlockID(const unsigned char* finalBlockID, unsigned int finalBlockIdLength) 
+  void 
+  setFinalBlockID(const std::vector<unsigned char>& finalBlockID) { finalBlockID_ = Name::Component(finalBlockID); }
+  
+  void 
+  setFinalBlockID(const unsigned char* finalBlockID, unsigned int finalBlockIdLength) 
   { 
     finalBlockID_ = Name::Component(finalBlockID, finalBlockIdLength); 
   }
@@ -117,7 +133,8 @@
    * @param wireFormat A WireFormat object used to encode the input. If omitted, use WireFormat getDefaultWireFormat().
    * @return The encoded byte array.
    */
-  SignedBlob wireEncode(WireFormat& wireFormat = *WireFormat::getDefaultWireFormat());
+  SignedBlob 
+  wireEncode(WireFormat& wireFormat = *WireFormat::getDefaultWireFormat());
   
   /**
    * Decode the input using a particular wire format and update this Data. Also, set the wireEncoding field to the input.
@@ -125,14 +142,16 @@
    * @param inputLength The length of input.
    * @param wireFormat A WireFormat object used to decode the input. If omitted, use WireFormat getDefaultWireFormat().
    */
-  void wireDecode(const unsigned char* input, unsigned int inputLength, WireFormat& wireFormat = *WireFormat::getDefaultWireFormat());
+  void 
+  wireDecode(const unsigned char* input, unsigned int inputLength, WireFormat& wireFormat = *WireFormat::getDefaultWireFormat());
   
   /**
    * Decode the input using a particular wire format and update this Data. Also, set the wireEncoding field to the input.
    * @param input The input byte array to be decoded.
    * @param wireFormat A WireFormat object used to decode the input. If omitted, use WireFormat getDefaultWireFormat().
    */
-  void wireDecode(const std::vector<unsigned char>& input, WireFormat& wireFormat = *WireFormat::getDefaultWireFormat()) 
+  void 
+  wireDecode(const std::vector<unsigned char>& input, WireFormat& wireFormat = *WireFormat::getDefaultWireFormat()) 
   {
     wireDecode(&input[0], input.size(), wireFormat);
   }
@@ -142,45 +161,58 @@
    * WARNING: The resulting pointers in dataStruct are invalid after a further use of this object which could reallocate memory.
    * @param dataStruct a C ndn_Data struct where the name components array is already allocated.
    */
-  void get(struct ndn_Data& dataStruct) const;
+  void 
+  get(struct ndn_Data& dataStruct) const;
 
   /**
    * Clear this data object, and set the values by copying from the ndn_Data struct.
    * @param dataStruct a C ndn_Data struct
    */
-  void set(const struct ndn_Data& dataStruct);
+  void 
+  set(const struct ndn_Data& dataStruct);
 
-  const Signature* getSignature() const { return signature_.get(); }
-  Signature* getSignature() 
+  const Signature* 
+  getSignature() const { return signature_.get(); }
+  
+  Signature* 
+  getSignature() 
   { 
     // TODO: Should add an OnChanged listener instead of always calling onChanged.
     onChanged();
     return signature_.get(); 
   }
   
-  const Name& getName() const { return name_; }
-  Name& getName() 
+  const Name& 
+  getName() const { return name_; }
+  
+  Name& 
+  getName() 
   { 
     // TODO: Should add an OnChanged listener instead of always calling onChanged.
     onChanged();
     return name_; 
   }
   
-  const MetaInfo& getMetaInfo() const { return metaInfo_; }
-  MetaInfo& getMetaInfo() 
+  const MetaInfo& 
+  getMetaInfo() const { return metaInfo_; }
+  
+  MetaInfo& 
+  getMetaInfo() 
   { 
     // TODO: Should add an OnChanged listener instead of always calling onChanged.
     onChanged();
     return metaInfo_; 
   }
   
-  const Blob& getContent() const { return content_; }
+  const Blob& 
+  getContent() const { return content_; }
 
   /**
    * Set the signature to a copy of the given signature.
    * @param signature The signature object which is cloned.
    */
-  void setSignature(const Signature& signature) 
+  void 
+  setSignature(const Signature& signature) 
   { 
     signature_ = signature.clone(); 
     onChanged();
@@ -190,7 +222,8 @@
    * Set name to a copy of the given Name.
    * @param name The Name which is copied.
    */
-  void setName(const Name& name) 
+  void 
+  setName(const Name& name) 
   { 
     name_ = name; 
     onChanged();
@@ -200,7 +233,8 @@
    * Set metaInfo to a copy of the given MetaInfo.
    * @param metaInfo The MetaInfo which is copied.
    */
-  void setMetainfo(const MetaInfo& metaInfo) 
+  void 
+  setMetainfo(const MetaInfo& metaInfo) 
   { 
     metaInfo_ = metaInfo; 
     onChanged();
@@ -210,12 +244,14 @@
    * Set the content to a copy of the data in the vector.
    * @param content A vector whose contents are copied.
    */
-  void setContent(const std::vector<unsigned char>& content) 
+  void 
+  setContent(const std::vector<unsigned char>& content) 
   { 
     content_ = content; 
     onChanged();
   }
-  void setContent(const unsigned char* content, unsigned int contentLength) 
+  void 
+  setContent(const unsigned char* content, unsigned int contentLength) 
   { 
     content_ = Blob(content, contentLength); 
     onChanged();
@@ -226,12 +262,15 @@
    * if you keep a pointer to the array then you must treat the array as immutable and promise not to change it.
    * @param content A pointer to a vector with the byte array.  This takes another reference and does not copy the bytes.
    */
-  void setContent(const ptr_lib::shared_ptr<std::vector<unsigned char> > &content) 
+  void 
+  setContent(const ptr_lib::shared_ptr<std::vector<unsigned char> > &content) 
   { 
     content_ = content;
     onChanged();
   }
-  void setContent(const ptr_lib::shared_ptr<const std::vector<unsigned char> > &content) 
+  
+  void 
+  setContent(const ptr_lib::shared_ptr<const std::vector<unsigned char> > &content) 
   { 
     content_ = content;
     onChanged();
@@ -241,7 +280,8 @@
   /**
    * Clear the wire encoding.
    */
-  void onChanged();
+  void 
+  onChanged();
   
   ptr_lib::shared_ptr<Signature> signature_;
   Name name_;
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_;
 };
diff --git a/ndn-cpp/face.cpp b/ndn-cpp/face.cpp
index 5780875..342a585 100644
--- a/ndn-cpp/face.cpp
+++ b/ndn-cpp/face.cpp
@@ -10,7 +10,8 @@
 
 namespace ndn {
   
-void Face::expressInterest(const Name& name, const Interest *interestTemplate, const OnData& onData, const OnTimeout& onTimeout)
+void 
+Face::expressInterest(const Name& name, const Interest *interestTemplate, const OnData& onData, const OnTimeout& onTimeout)
 {
   if (interestTemplate)
     node_.expressInterest(Interest
@@ -22,7 +23,8 @@
     node_.expressInterest(Interest(name, 4000.0), onData, onTimeout);  
 }
 
-void Face::shutdown()
+void 
+Face::shutdown()
 {
   node_.shutdown();
 }
diff --git a/ndn-cpp/face.hpp b/ndn-cpp/face.hpp
index affb0b7..2b202ef 100644
--- a/ndn-cpp/face.hpp
+++ b/ndn-cpp/face.hpp
@@ -46,7 +46,8 @@
    * @param onTimeout A function object to call if the interest times out.  If onTimeout is an empty OnTimeout(), this does not use it.
    * This copies the function object, so you may need to use func_lib::ref() as appropriate.
    */
-  void expressInterest(const Interest& interest, const OnData& onData, const OnTimeout& onTimeout = OnTimeout())
+  void 
+  expressInterest(const Interest& interest, const OnData& onData, const OnTimeout& onTimeout = OnTimeout())
   {
     node_.expressInterest(interest, onData, onTimeout);
   }
@@ -61,7 +62,8 @@
    * @param onTimeout A function object to call if the interest times out.  If onTimeout is an empty OnTimeout(), this does not use it.
    * This copies the function object, so you may need to use func_lib::ref() as appropriate.
    */
-  void expressInterest(const Name& name, const Interest *interestTemplate, const OnData& onData, const OnTimeout& onTimeout = OnTimeout());
+  void 
+  expressInterest(const Name& name, const Interest *interestTemplate, const OnData& onData, const OnTimeout& onTimeout = OnTimeout());
 
   /**
    * Encode name as an Interest, using a default interest lifetime.
@@ -72,7 +74,8 @@
    * @param onTimeout A function object to call if the interest times out.  If onTimeout is an empty OnTimeout(), this does not use it.
    * This copies the function object, so you may need to use func_lib::ref() as appropriate.
    */
-  void expressInterest(const Name& name, const OnData& onData, const OnTimeout& onTimeout = OnTimeout()) 
+  void 
+  expressInterest(const Name& name, const OnData& onData, const OnTimeout& onTimeout = OnTimeout()) 
   {
     expressInterest(name, 0, onData, onTimeout);
   }
@@ -84,7 +87,8 @@
    * use func_lib::ref() as appropriate.
    * @param flags The flags for finer control of which interests are forward to the application.
    */
-  void registerPrefix(const Name& prefix, const OnInterest& onInterest, int flags = 0)
+  void 
+  registerPrefix(const Name& prefix, const OnInterest& onInterest, int flags = 0)
   {
     node_.registerPrefix(prefix, onInterest, flags);
   }
@@ -96,7 +100,8 @@
    * @throw This may throw an exception for reading data or in the callback for processing the data.  If you
    * call this from an main event loop, you may want to catch and log/disregard all exceptions.
    */
-  void processEvents()
+  void 
+  processEvents()
   {
     // Just call Node's processEvents.
     node_.processEvents();
@@ -105,7 +110,8 @@
   /**
    * Shut down and disconnect this Face.
    */
-  void shutdown();
+  void 
+  shutdown();
   
 private:
   Node node_;
diff --git a/ndn-cpp/forwarding-entry.cpp b/ndn-cpp/forwarding-entry.cpp
index fad1e19..7311e3c 100644
--- a/ndn-cpp/forwarding-entry.cpp
+++ b/ndn-cpp/forwarding-entry.cpp
@@ -12,7 +12,8 @@
 
 namespace ndn {
   
-void ForwardingEntry::set(const struct ndn_ForwardingEntry& forwardingEntryStruct) 
+void 
+ForwardingEntry::set(const struct ndn_ForwardingEntry& forwardingEntryStruct) 
 {
   if (forwardingEntryStruct.action && forwardingEntryStruct.actionLength > 0)
     action_ = string(forwardingEntryStruct.action, forwardingEntryStruct.action + forwardingEntryStruct.actionLength);
@@ -26,7 +27,8 @@
   freshnessSeconds_ = forwardingEntryStruct.freshnessSeconds;
 }
 
-void ForwardingEntry::get(struct ndn_ForwardingEntry& forwardingEntryStruct) const 
+void 
+ForwardingEntry::get(struct ndn_ForwardingEntry& forwardingEntryStruct) const 
 {
   prefix_.get(forwardingEntryStruct.prefix);
   publisherPublicKeyDigest_.get(forwardingEntryStruct.publisherPublicKeyDigest);
diff --git a/ndn-cpp/forwarding-entry.hpp b/ndn-cpp/forwarding-entry.hpp
index fc2fe6d..3c88a89 100644
--- a/ndn-cpp/forwarding-entry.hpp
+++ b/ndn-cpp/forwarding-entry.hpp
@@ -32,15 +32,20 @@
   {
   }
   
-  Blob wireEncode(WireFormat& wireFormat = *WireFormat::getDefaultWireFormat()) const 
+  Blob 
+  wireEncode(WireFormat& wireFormat = *WireFormat::getDefaultWireFormat()) const 
   {
     return wireFormat.encodeForwardingEntry(*this);
   }
-  void wireDecode(const unsigned char *input, unsigned int inputLength, WireFormat& wireFormat = *WireFormat::getDefaultWireFormat()) 
+  
+  void 
+  wireDecode(const unsigned char *input, unsigned int inputLength, WireFormat& wireFormat = *WireFormat::getDefaultWireFormat()) 
   {
     wireFormat.decodeForwardingEntry(*this, input, inputLength);
   }
-  void wireDecode(const std::vector<unsigned char>& input, WireFormat& wireFormat = *WireFormat::getDefaultWireFormat()) 
+  
+  void 
+  wireDecode(const std::vector<unsigned char>& input, WireFormat& wireFormat = *WireFormat::getDefaultWireFormat()) 
   {
     wireDecode(&input[0], input.size(), wireFormat);
   }
@@ -50,36 +55,53 @@
    * WARNING: The resulting pointers in forwardingEntryStruct are invalid after a further use of this object which could reallocate memory.
    * @param forwardingEntryStruct a C ndn_ForwardingEntry struct where the prefix name components array is already allocated.
    */
-  void get(struct ndn_ForwardingEntry& forwardingEntryStruct) const;
+  void 
+  get(struct ndn_ForwardingEntry& forwardingEntryStruct) const;
 
-  const std::string& getAction() const { return action_; }
+  const std::string& 
+  getAction() const { return action_; }
   
-  Name& getPrefix() { return prefix_; }
-  const Name& getPrefix() const { return prefix_; }
+  Name& 
+  getPrefix() { return prefix_; }
   
-  PublisherPublicKeyDigest& getPublisherPublicKeyDigest() { return publisherPublicKeyDigest_; }
-  const PublisherPublicKeyDigest& getPublisherPublicKeyDigest() const { return publisherPublicKeyDigest_; }
+  const Name& 
+  getPrefix() const { return prefix_; }
   
-  int getFaceId() const { return faceId_; }
+  PublisherPublicKeyDigest& 
+  getPublisherPublicKeyDigest() { return publisherPublicKeyDigest_; }
+  
+  const PublisherPublicKeyDigest& 
+  getPublisherPublicKeyDigest() const { return publisherPublicKeyDigest_; }
+  
+  int 
+  getFaceId() const { return faceId_; }
 
-  int getForwardingFlags() const { return forwardingFlags_; }
+  int 
+  getForwardingFlags() const { return forwardingFlags_; }
 
-  int getFreshnessSeconds() const { return freshnessSeconds_; }
+  int 
+  getFreshnessSeconds() const { return freshnessSeconds_; }
   
   /**
    * Clear this forwarding entry, and set the values by copying from forwardingEntryStruct.
    * @param forwardingEntryStruct a C ndn_ForwardingEntry struct.
    */
-  void set(const struct ndn_ForwardingEntry& forwardingEntryStruct);
+  void 
+  set(const struct ndn_ForwardingEntry& forwardingEntryStruct);
 
-  void setAction(const std::string& value) { action_ = value; }
+  void 
+  setAction(const std::string& value) { action_ = value; }
   
-  void setFaceId(int value) { faceId_ = value; }
+  void 
+  setFaceId(int value) { faceId_ = value; }
       
-  void setForwardingFlags(int value) { forwardingFlags_ = value; }
+  void 
+  setForwardingFlags(int value) { forwardingFlags_ = value; }
       
-  void setFreshnessSeconds(int value) { freshnessSeconds_ = value; }
+  void 
+  setFreshnessSeconds(int value) { freshnessSeconds_ = value; }
       
+private:
   std::string action_;   /**< empty for none. */
   Name prefix_;
   PublisherPublicKeyDigest publisherPublicKeyDigest_;
diff --git a/ndn-cpp/interest.cpp b/ndn-cpp/interest.cpp
index 0fe5ce7..3c09234 100644
--- a/ndn-cpp/interest.cpp
+++ b/ndn-cpp/interest.cpp
@@ -12,7 +12,8 @@
 
 namespace ndn {
   
-void Exclude::get(struct ndn_Exclude& excludeStruct) const
+void 
+Exclude::get(struct ndn_Exclude& excludeStruct) const
 {
   if (excludeStruct.maxEntries < entries_.size())
     throw runtime_error("excludeStruct.maxEntries must be >= this exclude getEntryCount()");
@@ -22,7 +23,8 @@
     entries_[i].get(excludeStruct.entries[i]);  
 }
 
-void Exclude::set(const struct ndn_Exclude& excludeStruct)
+void 
+Exclude::set(const struct ndn_Exclude& excludeStruct)
 {
   entries_.clear();
   for (unsigned int i = 0; i < excludeStruct.nEntries; ++i) {
@@ -37,7 +39,8 @@
   }
 }
 
-string Exclude::toUri() const
+string 
+Exclude::toUri() const
 {
 	if (entries_.size() == 0)
 		return "";
@@ -56,7 +59,8 @@
   return result.str();  
 }
 
-void Interest::set(const struct ndn_Interest& interestStruct) 
+void 
+Interest::set(const struct ndn_Interest& interestStruct) 
 {
   name_.set(interestStruct.name);
   minSuffixComponents_ = interestStruct.minSuffixComponents;
@@ -72,7 +76,8 @@
   nonce_ = Blob(interestStruct.nonce, interestStruct.nonceLength);
 }
 
-void Interest::get(struct ndn_Interest& interestStruct) const 
+void 
+Interest::get(struct ndn_Interest& interestStruct) const 
 {
   name_.get(interestStruct.name);
   interestStruct.minSuffixComponents = minSuffixComponents_;
diff --git a/ndn-cpp/interest.hpp b/ndn-cpp/interest.hpp
index 3b285d8..749363f 100644
--- a/ndn-cpp/interest.hpp
+++ b/ndn-cpp/interest.hpp
@@ -39,7 +39,8 @@
    * WARNING: The resulting pointer in excludeEntryStruct is invalid after a further use of this object which could reallocate memory.
    * @param excludeEntryStruct the C ndn_NameComponent struct to receive the pointer
    */
-  void get(struct ndn_ExcludeEntry& excludeEntryStruct) const 
+  void 
+  get(struct ndn_ExcludeEntry& excludeEntryStruct) const 
   {
     excludeEntryStruct.type = type_;
     if (type_ == ndn_Exclude_COMPONENT)
@@ -66,29 +67,34 @@
   Exclude() {
   }
   
-  unsigned int getEntryCount() const {
+  unsigned int 
+  getEntryCount() const {
     return entries_.size();
   }
   
-  const ExcludeEntry& getEntry(unsigned int i) const { return entries_[i]; }
+  const ExcludeEntry& 
+  getEntry(unsigned int i) const { return entries_[i]; }
   
   /**
    * Set the excludeStruct to point to the entries in this Exclude, without copying any memory.
    * WARNING: The resulting pointers in excludeStruct are invalid after a further use of this object which could reallocate memory.
    * @param excludeStruct a C ndn_Exclude struct where the entries array is already allocated
    */
-  void get(struct ndn_Exclude& excludeStruct) const;
+  void 
+  get(struct ndn_Exclude& excludeStruct) const;
   
   /**
    * Clear this Exclude, and set the entries by copying from the ndn_Exclude struct.
    * @param excludeStruct a C ndn_Exclude struct
    */
-  void set(const struct ndn_Exclude& excludeStruct);
+  void 
+  set(const struct ndn_Exclude& excludeStruct);
 
   /**
    * Add a new entry of type ndn_Exclude_ANY
    */
-  void addAny()
+  void 
+  addAny()
   {    
     entries_.push_back(ExcludeEntry());
   }
@@ -96,7 +102,8 @@
   /**
    * Add a new entry of type ndn_Exclude_COMPONENT, copying from component of length compnentLength
    */
-  void addComponent(unsigned char *component, unsigned int componentLen) 
+  void 
+  addComponent(unsigned char *component, unsigned int componentLen) 
   {
     entries_.push_back(ExcludeEntry(component, componentLen));
   }
@@ -104,7 +111,8 @@
   /**
    * Clear all the entries.
    */
-  void clear() {
+  void 
+  clear() {
     entries_.clear();
   }
   
@@ -160,15 +168,20 @@
     construct();
   }
   
-  Blob wireEncode(WireFormat& wireFormat = *WireFormat::getDefaultWireFormat()) const 
+  Blob 
+  wireEncode(WireFormat& wireFormat = *WireFormat::getDefaultWireFormat()) const 
   {
     return wireFormat.encodeInterest(*this);
   }
-  void wireDecode(const unsigned char *input, unsigned int inputLength, WireFormat& wireFormat = *WireFormat::getDefaultWireFormat()) 
+  
+  void 
+  wireDecode(const unsigned char *input, unsigned int inputLength, WireFormat& wireFormat = *WireFormat::getDefaultWireFormat()) 
   {
     wireFormat.decodeInterest(*this, input, inputLength);
   }
-  void wireDecode(const std::vector<unsigned char>& input, WireFormat& wireFormat = *WireFormat::getDefaultWireFormat()) 
+  
+  void 
+  wireDecode(const std::vector<unsigned char>& input, WireFormat& wireFormat = *WireFormat::getDefaultWireFormat()) 
   {
     wireDecode(&input[0], input.size(), wireFormat);
   }
@@ -178,53 +191,79 @@
    * WARNING: The resulting pointers in interestStruct are invalid after a further use of this object which could reallocate memory.
    * @param interestStruct a C ndn_Interest struct where the name components array is already allocated.
    */
-  void get(struct ndn_Interest& interestStruct) const;
+  void 
+  get(struct ndn_Interest& interestStruct) const;
 
-  Name& getName() { return name_; }
-  const Name& getName() const { return name_; }
+  Name& 
+  getName() { return name_; }
   
-  int getMinSuffixComponents() const { return minSuffixComponents_; }
+  const Name& 
+  getName() const { return name_; }
   
-  int getMaxSuffixComponents() const { return maxSuffixComponents_; }
+  int 
+  getMinSuffixComponents() const { return minSuffixComponents_; }
   
-  PublisherPublicKeyDigest& getPublisherPublicKeyDigest() { return publisherPublicKeyDigest_; }
-  const PublisherPublicKeyDigest& getPublisherPublicKeyDigest() const { return publisherPublicKeyDigest_; }
-
-  Exclude& getExclude() { return exclude_; }
-  const Exclude& getExclude() const { return exclude_; }
+  int 
+  getMaxSuffixComponents() const { return maxSuffixComponents_; }
   
-  int getChildSelector() const { return childSelector_; }
+  PublisherPublicKeyDigest& 
+  getPublisherPublicKeyDigest() { return publisherPublicKeyDigest_; }
+  
+  const PublisherPublicKeyDigest& 
+  getPublisherPublicKeyDigest() const { return publisherPublicKeyDigest_; }
 
-  int getAnswerOriginKind() const { return answerOriginKind_; }
+  Exclude& 
+  getExclude() { return exclude_; }
+  
+  const Exclude& 
+  getExclude() const { return exclude_; }
+  
+  int 
+  getChildSelector() const { return childSelector_; }
 
-  int getScope() const { return scope_; }
+  int 
+  getAnswerOriginKind() const { return answerOriginKind_; }
 
-  double getInterestLifetimeMilliseconds() const { return interestLifetimeMilliseconds_; }
+  int 
+  getScope() const { return scope_; }
 
-  const Blob& getNonce() const { return nonce_; }
+  double 
+  getInterestLifetimeMilliseconds() const { return interestLifetimeMilliseconds_; }
+
+  const Blob& 
+  getNonce() const { return nonce_; }
   
   /**
    * Clear this interest, and set the values by copying from the interest struct.
    * @param interestStruct a C ndn_Interest struct
    */
-  void set(const struct ndn_Interest& interestStruct);
+  void 
+  set(const struct ndn_Interest& interestStruct);
   
-  void setMinSuffixComponents(int value) { minSuffixComponents_ = value; }
+  void 
+  setMinSuffixComponents(int value) { minSuffixComponents_ = value; }
   
-  void setMaxSuffixComponents(int value) { maxSuffixComponents_ = value; }
+  void 
+  setMaxSuffixComponents(int value) { maxSuffixComponents_ = value; }
   
-  void setChildSelector(int value) { childSelector_ = value; }
+  void 
+  setChildSelector(int value) { childSelector_ = value; }
 
-  void setAnswerOriginKind(int value) { answerOriginKind_ = value; }
+  void 
+  setAnswerOriginKind(int value) { answerOriginKind_ = value; }
 
-  void setScope(int value) { scope_ = value; }
+  void 
+  setScope(int value) { scope_ = value; }
 
-  void setInterestLifetimeMilliseconds(double value) { interestLifetimeMilliseconds_ = value; }
+  void 
+  setInterestLifetimeMilliseconds(double value) { interestLifetimeMilliseconds_ = value; }
 
-  void setNonce(const std::vector<unsigned char>& value) { nonce_ = value; }
+  void 
+  setNonce(const std::vector<unsigned char>& value) { nonce_ = value; }
   
 private:
-  void construct() 
+  void 
+  construct() 
   {
     minSuffixComponents_ = -1;
     maxSuffixComponents_ = -1;  
diff --git a/ndn-cpp/key.cpp b/ndn-cpp/key.cpp
index 1fa7075..b453471 100644
--- a/ndn-cpp/key.cpp
+++ b/ndn-cpp/key.cpp
@@ -11,7 +11,8 @@
 
 namespace ndn {
 
-void KeyLocator::get(struct ndn_KeyLocator& keyLocatorStruct) const 
+void 
+KeyLocator::get(struct ndn_KeyLocator& keyLocatorStruct) const 
 {
   keyLocatorStruct.type = type_;
   
@@ -25,7 +26,8 @@
   keyLocatorStruct.keyNameType = keyNameType_;
 }
 
-void KeyLocator::set(const struct ndn_KeyLocator& keyLocatorStruct)
+void 
+KeyLocator::set(const struct ndn_KeyLocator& keyLocatorStruct)
 {
   type_ = keyLocatorStruct.type;
   keyData_ = Blob(keyLocatorStruct.keyData, keyLocatorStruct.keyDataLength);
diff --git a/ndn-cpp/key.hpp b/ndn-cpp/key.hpp
index c68d895..8215905 100644
--- a/ndn-cpp/key.hpp
+++ b/ndn-cpp/key.hpp
@@ -23,7 +23,8 @@
   /**
    * Clear the keyData and set the type to none.
    */
-  void clear()
+  void 
+  clear()
   {
     type_ = (ndn_KeyLocatorType)-1;
     keyNameType_ = (ndn_KeyNameType)-1;
@@ -35,27 +36,39 @@
    * WARNING: The resulting pointers in keyLocatorStruct are invalid after a further use of this object which could reallocate memory.
    * @param keyLocatorStruct a C ndn_KeyLocator struct where the name components array is already allocated.
    */
-  void get(struct ndn_KeyLocator& keyLocatorStruct) const;
+  void 
+  get(struct ndn_KeyLocator& keyLocatorStruct) const;
   
   /**
    * Clear this key locator, and set the values by copying from the ndn_KeyLocator struct.
    * @param keyLocatorStruct a C ndn_KeyLocator struct
    */
-  void set(const struct ndn_KeyLocator& keyLocatorStruct);
+  void 
+  set(const struct ndn_KeyLocator& keyLocatorStruct);
 
-  ndn_KeyLocatorType getType() const { return type_; }
+  ndn_KeyLocatorType 
+  getType() const { return type_; }
   
-  const Blob& getKeyData() const { return keyData_; }
+  const Blob& 
+  getKeyData() const { return keyData_; }
 
-  const Name& getKeyName() const { return keyName_; }
-  Name& getKeyName() { return keyName_; }
-
-  ndn_KeyNameType getKeyNameType() const { return keyNameType_; }
-
-  void setType(ndn_KeyLocatorType type) { type_ = type; }
+  const Name& 
+  getKeyName() const { return keyName_; }
   
-  void setKeyData(const std::vector<unsigned char>& keyData) { keyData_ = keyData; }
-  void setKeyData(const unsigned char *keyData, unsigned int keyDataLength) 
+  Name& 
+  getKeyName() { return keyName_; }
+
+  ndn_KeyNameType 
+  getKeyNameType() const { return keyNameType_; }
+
+  void 
+  setType(ndn_KeyLocatorType type) { type_ = type; }
+  
+  void 
+  setKeyData(const std::vector<unsigned char>& keyData) { keyData_ = keyData; }
+  
+  void 
+  setKeyData(const unsigned char *keyData, unsigned int keyDataLength) 
   { 
     keyData_ = Blob(keyData, keyDataLength); 
   }
@@ -65,9 +78,11 @@
    * if you keep a pointer to the array then you must treat the array as immutable and promise not to change it.
    * @param keyData A pointer to a vector with the byte array.  This takes another reference and does not copy the bytes.
    */
-  void setKeyData(const ptr_lib::shared_ptr<std::vector<unsigned char> > &keyData) { keyData_ = keyData; }
+  void 
+  setKeyData(const ptr_lib::shared_ptr<std::vector<unsigned char> > &keyData) { keyData_ = keyData; }
 
-  void setKeyNameType(ndn_KeyNameType keyNameType) { keyNameType_ = keyNameType; }
+  void 
+  setKeyNameType(ndn_KeyNameType keyNameType) { keyNameType_ = keyNameType; }
 
 private:
   ndn_KeyLocatorType type_; /**< -1 for none */
diff --git a/ndn-cpp/name.cpp b/ndn-cpp/name.cpp
index 2b5c6a9..1496219 100644
--- a/ndn-cpp/name.cpp
+++ b/ndn-cpp/name.cpp
@@ -18,7 +18,8 @@
  * Modify str in place to erase whitespace on the left.
  * @param str
  */
-static inline void trimLeft(string& str)
+static inline void 
+trimLeft(string& str)
 {
   size_t found = str.find_first_not_of(WHITESPACE_CHARS);
   if (found != string::npos) {
@@ -34,7 +35,8 @@
  * Modify str in place to erase whitespace on the right.
  * @param str
  */
-static inline void trimRight(string& str)
+static inline void 
+trimRight(string& str)
 {
   size_t found = str.find_last_not_of(WHITESPACE_CHARS);
   if (found != string::npos) {
@@ -50,7 +52,8 @@
  * Modify str in place to erase whitespace on the left and right.
  * @param str
  */
-static void trim(string& str)
+static void 
+trim(string& str)
 {
   trimLeft(str);
   trimRight(str);
@@ -61,7 +64,8 @@
  * @param c
  * @return 
  */
-static int fromHexChar(unsigned char c)
+static int 
+fromHexChar(unsigned char c)
 {
   if (c >= '0' && c <= '9')
     return (int)c - (int)'0';
@@ -77,7 +81,8 @@
  * Return a copy of str, converting each escaped "%XX" to the char value.
  * @param str
  */
-static string unescape(const string& str)
+static string 
+unescape(const string& str)
 {
   ostringstream result;
   
@@ -103,7 +108,8 @@
   return result.str();
 }
 
-Blob Name::Component::makeFromEscapedString(const char *escapedString, unsigned int beginOffset, unsigned int endOffset)
+Blob 
+Name::Component::makeFromEscapedString(const char *escapedString, unsigned int beginOffset, unsigned int endOffset)
 {
   string trimmedString(escapedString + beginOffset, escapedString + endOffset);
   trim(trimmedString);
@@ -122,7 +128,8 @@
     return Blob((const unsigned char *)&component[0], component.size()); 
 }
 
-Blob Name::Component::makeSegment(unsigned long segment)
+Blob 
+Name::Component::makeSegment(unsigned long segment)
 {
   ptr_lib::shared_ptr<vector<unsigned char> > value;
   
@@ -140,7 +147,8 @@
   return Blob(value);
 }
 
-void Name::set(const char *uri_cstr) 
+void 
+Name::set(const char *uri_cstr) 
 {
   components_.clear();
   
@@ -196,7 +204,8 @@
   }
 }
 
-void Name::get(struct ndn_Name& nameStruct) const
+void 
+Name::get(struct ndn_Name& nameStruct) const
 {
   if (nameStruct.maxComponents < components_.size())
     throw runtime_error("nameStruct.maxComponents must be >= this name getNComponents()");
@@ -206,14 +215,16 @@
     components_[i].get(nameStruct.components[i]);
 }
   
-void Name::set(const struct ndn_Name& nameStruct) 
+void 
+Name::set(const struct ndn_Name& nameStruct) 
 {
   clear();
   for (unsigned int i = 0; i < nameStruct.nComponents; ++i)
     addComponent(nameStruct.components[i].value, nameStruct.components[i].valueLength);  
 }
 
-std::string Name::toUri() const
+std::string 
+Name::toUri() const
 {
   if (components_.size() == 0)
     return "/";
@@ -227,7 +238,8 @@
   return result.str();
 }
 
-bool Name::match(const Name& name) const
+bool 
+Name::match(const Name& name) const
 {
   // Imitate ndn_Name_match.
   
@@ -248,7 +260,8 @@
 	return true;
 }
 
-void Name::toEscapedString(const vector<unsigned char>& value, ostringstream& result)
+void 
+Name::toEscapedString(const vector<unsigned char>& value, ostringstream& result)
 {
   bool gotNonDot = false;
   for (unsigned i = 0; i < value.size(); ++i) {
diff --git a/ndn-cpp/name.hpp b/ndn-cpp/name.hpp
index cd80fac..8129979 100644
--- a/ndn-cpp/name.hpp
+++ b/ndn-cpp/name.hpp
@@ -63,7 +63,8 @@
      * WARNING: The resulting pointer in componentStruct is invalid after a further use of this object which could reallocate memory.
      * @param componentStruct The C ndn_NameComponent struct to receive the pointer.
      */
-    void get(struct ndn_NameComponent& componentStruct) const 
+    void 
+    get(struct ndn_NameComponent& componentStruct) const 
     {
       componentStruct.valueLength = value_.size(); 
       if (value_.size() > 0)
@@ -72,7 +73,8 @@
         componentStruct.value = 0;
     }
   
-    const Blob& getValue() const { return value_; }
+    const Blob& 
+    getValue() const { return value_; }
     
     /**
      * Make a component value by decoding the escapedString between beginOffset and endOffset according to the NDN URI Scheme.
@@ -83,14 +85,16 @@
      * @param endOffset The offset in escapedString of the end of the portion to decode.
      * @return The component value as a Blob, or a Blob with a null pointer if escapedString is not a valid escaped component.
      */
-    static Blob makeFromEscapedString(const char *escapedString, unsigned int beginOffset, unsigned int endOffset);
+    static Blob 
+    makeFromEscapedString(const char *escapedString, unsigned int beginOffset, unsigned int endOffset);
     
     /**
      * Make a component as the encoded segment number.
      * @param segment The segment number.
      * @return The component value as a Blob.
      */
-    static Blob makeSegment(unsigned long segment);
+    static Blob 
+    makeSegment(unsigned long segment);
   
   private:
     Blob value_;
@@ -125,24 +129,28 @@
    * WARNING: The resulting pointers in nameStruct are invalid after a further use of this object which could reallocate memory.
    * @param nameStruct A C ndn_Name struct where the components array is already allocated.
    */
-  void get(struct ndn_Name& nameStruct) const;
+  void 
+  get(struct ndn_Name& nameStruct) const;
   
   /**
    * Clear this name, and set the components by copying from the name struct.
    * @param nameStruct A C ndn_Name struct
    */
-  void set(const struct ndn_Name& nameStruct);
+  void 
+  set(const struct ndn_Name& nameStruct);
   
   /**
    * Parse the uri according to the NDN URI Scheme and set the name with the components.
    * @param uri The URI string.
    */
-  void set(const char *uri);  
+  void 
+  set(const char *uri);  
 
   /**
    * Add a new component, copying from value of length valueLength.
    */
-  void addComponent(const unsigned char *value, unsigned int valueLength) 
+  void 
+  addComponent(const unsigned char *value, unsigned int valueLength) 
   {
     components_.push_back(Component(value, valueLength));
   }
@@ -150,12 +158,14 @@
   /**
    * Add a new component, copying from value.
    */
-  void addComponent(const std::vector<unsigned char>& value) 
+  void 
+  addComponent(const std::vector<unsigned char>& value) 
   {
     components_.push_back(value);
   }
   
-  void addComponent(const Blob &value)
+  void 
+  addComponent(const Blob &value)
   {
     components_.push_back(value);
   }
@@ -163,7 +173,8 @@
   /**
    * Clear all the components.
    */
-  void clear() {
+  void 
+  clear() {
     components_.clear();
   }
   
@@ -171,22 +182,26 @@
    * Get the number of components.
    * @return The number of components.
    */
-  unsigned int getComponentCount() const {
+  unsigned int 
+  getComponentCount() const {
     return components_.size();
   }
   
-  const Component& getComponent(unsigned int i) const { return components_[i]; }
+  const Component& 
+  getComponent(unsigned int i) const { return components_[i]; }
   
   /**
    * Encode this name as a URI.
    * @return The encoded URI.
    */
-  std::string toUri() const;
+  std::string 
+  toUri() const;
   
   /**
    * @deprecated Use toUri().
    */
-  std::string to_uri() const 
+  std::string 
+  to_uri() const 
   {
     return toUri();
   }
@@ -195,7 +210,8 @@
    * Append a component with the encoded segment number.
    * @param segment The segment number.
    */
-  void appendSegment(unsigned long segment)
+  void 
+  appendSegment(unsigned long segment)
   {
     components_.push_back(Component(Component::makeSegment(segment)));
   }
@@ -205,7 +221,8 @@
    * @param name The Name to check.
    * @return true if this matches the given name, otherwise false.  This always returns true if this name is empty.
    */
-  bool match(const Name& name) const;
+  bool 
+  match(const Name& name) const;
   
   /**
    * Write the value to result, escaping characters according to the NDN URI Scheme.
@@ -213,7 +230,8 @@
    * @param value the buffer with the value to escape
    * @param result the string stream to write to.
    */
-  static void toEscapedString(const std::vector<unsigned char>& value, std::ostringstream& result);
+  static void 
+  toEscapedString(const std::vector<unsigned char>& value, std::ostringstream& result);
 
 private:
   std::vector<Component> components_;
diff --git a/ndn-cpp/node.cpp b/ndn-cpp/node.cpp
index 779d285..2cf881f 100644
--- a/ndn-cpp/node.cpp
+++ b/ndn-cpp/node.cpp
@@ -18,7 +18,8 @@
 namespace ndn {
 
 // Use gettimeofday to return the current time in milliseconds.
-static inline double getNowMilliseconds()
+static inline double 
+getNowMilliseconds()
 {
   timeval t;
   gettimeofday(&t, NULL);
@@ -31,7 +32,8 @@
 {
 }
 
-void Node::expressInterest(const Interest& interest, const OnData& onData, const OnTimeout& onTimeout)
+void 
+Node::expressInterest(const Interest& interest, const OnData& onData, const OnTimeout& onTimeout)
 {
   // TODO: Properly check if we are already connected to the expected host.
   if (!transport_->getIsConnected())
@@ -43,7 +45,8 @@
   transport_->send(*encoding);
 }
 
-void Node::registerPrefix(const Name& prefix, const OnInterest& onInterest, int flags)
+void 
+Node::registerPrefix(const Name& prefix, const OnInterest& onInterest, int flags)
 {
   if (ndndId_.size() == 0) {
     // First fetch the ndndId of the connected hub.
@@ -55,7 +58,8 @@
     registerPrefixHelper(prefix, onInterest, flags);
 }
 
-void Node::NdndIdFetcher::operator()(const ptr_lib::shared_ptr<const Interest>& interest, const ptr_lib::shared_ptr<Data>& ndndIdData)
+void 
+Node::NdndIdFetcher::operator()(const ptr_lib::shared_ptr<const Interest>& interest, const ptr_lib::shared_ptr<Data>& ndndIdData)
 {
   Sha256WithRsaSignature *signature = dynamic_cast<Sha256WithRsaSignature*>(ndndIdData->getSignature());
   if (signature && signature->getPublisherPublicKeyDigest().getPublisherPublicKeyDigest().size() > 0) {
@@ -67,12 +71,14 @@
   // TODO: else need to log not getting the ndndId.
 }
 
-void Node::NdndIdFetcher::operator()(const ptr_lib::shared_ptr<const Interest>& timedOutInterest)
+void 
+Node::NdndIdFetcher::operator()(const ptr_lib::shared_ptr<const Interest>& timedOutInterest)
 {
   // TODO: Log the timeout.
 }
 
-void Node::registerPrefixHelper(const Name& prefix, const OnInterest& onInterest, int flags)
+void 
+Node::registerPrefixHelper(const Name& prefix, const OnInterest& onInterest, int flags)
 {
   // Create a ForwardingEntry.
   ForwardingEntry forwardingEntry("selfreg", prefix, PublisherPublicKeyDigest(), -1, 3, 2147483647);
@@ -105,7 +111,8 @@
   transport_->send(*encodedInterest);
 }
 
-void Node::processEvents()
+void 
+Node::processEvents()
 {
   transport_->processEvents();
   
@@ -121,7 +128,8 @@
   }
 }
 
-void Node::onReceivedElement(const unsigned char *element, unsigned int elementLength)
+void 
+Node::onReceivedElement(const unsigned char *element, unsigned int elementLength)
 {
   BinaryXmlDecoder decoder(element, elementLength);
   
@@ -148,12 +156,14 @@
   }
 }
 
-void Node::shutdown()
+void 
+Node::shutdown()
 {
   transport_->close();
 }
 
-int Node::getEntryIndexForExpressedInterest(const Name& name)
+int 
+Node::getEntryIndexForExpressedInterest(const Name& name)
 {
   // TODO: Doesn't this belong in the Name class?
   vector<struct ndn_NameComponent> nameComponents;
@@ -176,7 +186,8 @@
 	return iResult;
 }
   
-Node::PrefixEntry *Node::getEntryForRegisteredPrefix(const Name& name)
+Node::PrefixEntry*
+Node::getEntryForRegisteredPrefix(const Name& name)
 {
   int iResult = -1;
     
@@ -214,7 +225,8 @@
   interest_->get(interestStruct_);  
 }
 
-bool Node::PitEntry::checkTimeout(Node *parent, double nowMilliseconds)
+bool 
+Node::PitEntry::checkTimeout(Node *parent, double nowMilliseconds)
 {
   if (timeoutTimeMilliseconds_ >= 0.0 && nowMilliseconds >= timeoutTimeMilliseconds_) {
     if (onTimeout_) {
diff --git a/ndn-cpp/node.hpp b/ndn-cpp/node.hpp
index 6301be7..3eb9597 100644
--- a/ndn-cpp/node.hpp
+++ b/ndn-cpp/node.hpp
@@ -50,7 +50,8 @@
    * @param onTimeout A function object to call if the interest times out.  If onTimeout is an empty OnTimeout(), this does not use it.
    * This copies the function object, so you may need to use func_lib::ref() as appropriate.
    */
-  void expressInterest(const Interest& interest, const OnData& onData, const OnTimeout& onTimeout);
+  void 
+  expressInterest(const Interest& interest, const OnData& onData, const OnTimeout& onTimeout);
   
   /**
    * Register prefix with the connected NDN hub and call onInterest when a matching interest is received.
@@ -59,7 +60,8 @@
    * use func_lib::ref() as appropriate.
    * @param flags The flags for finer control of which interests are forward to the application.
    */
-  void registerPrefix(const Name& prefix, const OnInterest& onInterest, int flags);
+  void 
+  registerPrefix(const Name& prefix, const OnInterest& onInterest, int flags);
 
   /**
    * Process any data to receive.  For each element received, call onReceivedElement.
@@ -68,15 +70,20 @@
    * @throw This may throw an exception for reading data or in the callback for processing the data.  If you
    * call this from an main event loop, you may want to catch and log/disregard all exceptions.
    */
-  void processEvents();
+  void 
+  processEvents();
   
-  const ptr_lib::shared_ptr<Transport>& getTransport() { return transport_; }
+  const ptr_lib::shared_ptr<Transport>& 
+  getTransport() { return transport_; }
   
-  const ptr_lib::shared_ptr<const Transport::ConnectionInfo>& getConnectionInfo() { return connectionInfo_; }
+  const ptr_lib::shared_ptr<const Transport::ConnectionInfo>& 
+  getConnectionInfo() { return connectionInfo_; }
 
-  void onReceivedElement(const unsigned char *element, unsigned int elementLength);
+  void 
+  onReceivedElement(const unsigned char *element, unsigned int elementLength);
   
-  void shutdown();
+  void 
+  shutdown();
 
 private:
   class PitEntry {
@@ -89,9 +96,11 @@
      */
     PitEntry(const ptr_lib::shared_ptr<const Interest>& interest, const OnData& onData, const OnTimeout& onTimeout);
     
-    const ptr_lib::shared_ptr<const Interest>& getInterest() { return interest_; }
+    const ptr_lib::shared_ptr<const Interest>& 
+    getInterest() { return interest_; }
     
-    const OnData& getOnData() { return onData_; }
+    const OnData& 
+    getOnData() { return onData_; }
     
     /**
      * Get the struct ndn_Interest for the interest_.
@@ -101,7 +110,8 @@
      * @return A reference to the ndn_Interest struct.
      * WARNING: The resulting pointers in are invalid uses getInterest() to manipulate the object which could reallocate memory.
      */
-    const struct ndn_Interest& getInterestStruct()
+    const struct ndn_Interest& 
+    getInterestStruct()
     {
       return interestStruct_;
     }
@@ -112,7 +122,8 @@
      * @param nowMilliseconds The current time in milliseconds from gettimeofday.
      * @return true if this interest timed out and the timeout callback was called, otherwise false.
      */
-    bool checkTimeout(Node *parent, double nowMilliseconds);
+    bool 
+    checkTimeout(Node *parent, double nowMilliseconds);
     
   private:
     ptr_lib::shared_ptr<const Interest> interest_;
@@ -137,9 +148,11 @@
     {
     }
     
-    const ptr_lib::shared_ptr<const Name>& getPrefix() { return prefix_; }
+    const ptr_lib::shared_ptr<const Name>& 
+    getPrefix() { return prefix_; }
     
-    const OnInterest& getOnInterest() { return onInterest_; }
+    const OnInterest& 
+    getOnInterest() { return onInterest_; }
     
   private:
     ptr_lib::shared_ptr<const Name> prefix_;
@@ -163,13 +176,15 @@
      * @param interest
      * @param data
      */
-    void operator()(const ptr_lib::shared_ptr<const Interest>& interest, const ptr_lib::shared_ptr<Data>& ndndIdData);
+    void 
+    operator()(const ptr_lib::shared_ptr<const Interest>& interest, const ptr_lib::shared_ptr<Data>& ndndIdData);
 
     /**
      * We timed out fetching the ndnd ID.
      * @param interest
      */
-    void operator()(const ptr_lib::shared_ptr<const Interest>& timedOutInterest);
+    void 
+    operator()(const ptr_lib::shared_ptr<const Interest>& timedOutInterest);
     
     class Info {
     public:
@@ -194,14 +209,16 @@
    * @param name The name to find the interest for (from the incoming data packet).
    * @return The index in pit_ of the pit entry, or -1 if not found.
    */
-  int getEntryIndexForExpressedInterest(const Name& name);
+  int 
+          getEntryIndexForExpressedInterest(const Name& name);
   
   /**
    * Find the first entry from the registeredPrefixTable_ where the entry prefix is the longest that matches name.
    * @param name The name to find the PrefixEntry for (from the incoming interest packet).
    * @return A pointer to the entry, or 0 if not found.
    */
-  PrefixEntry *getEntryForRegisteredPrefix(const Name& name);
+  PrefixEntry*
+  getEntryForRegisteredPrefix(const Name& name);
   
   /**
    * Do the work of registerPrefix once we know we are connected with an ndndId_.
@@ -209,7 +226,8 @@
    * @param onInterest
    * @param flags
    */
-  void registerPrefixHelper(const Name& prefix, const OnInterest& onInterest, int flags);
+  void 
+  registerPrefixHelper(const Name& prefix, const OnInterest& onInterest, int flags);
   
   ptr_lib::shared_ptr<Transport> transport_;
   ptr_lib::shared_ptr<const Transport::ConnectionInfo> connectionInfo_;
diff --git a/ndn-cpp/publisher-public-key-digest.hpp b/ndn-cpp/publisher-public-key-digest.hpp
index df2da0b..7ce6dc7 100644
--- a/ndn-cpp/publisher-public-key-digest.hpp
+++ b/ndn-cpp/publisher-public-key-digest.hpp
@@ -27,7 +27,8 @@
    * WARNING: The resulting pointers in publisherPublicKeyDigestStruct are invalid after a further use of this object which could reallocate memory.
    * @param publisherPublicKeyDigestStruct a C ndn_PublisherPublicKeyDigest struct to receive the pointer
    */
-  void get(struct ndn_PublisherPublicKeyDigest& publisherPublicKeyDigestStruct) const 
+  void 
+  get(struct ndn_PublisherPublicKeyDigest& publisherPublicKeyDigestStruct) const 
   {
     publisherPublicKeyDigestStruct.publisherPublicKeyDigestLength = publisherPublicKeyDigest_.size();
     if (publisherPublicKeyDigest_.size() > 0)
@@ -40,16 +41,24 @@
    * Clear this PublisherPublicKeyDigest, and copy from the ndn_PublisherPublicKeyDigest struct.
    * @param excludeStruct a C ndn_Exclude struct
    */
-  void set(const struct ndn_PublisherPublicKeyDigest& publisherPublicKeyDigestStruct) 
+  void 
+  set(const struct ndn_PublisherPublicKeyDigest& publisherPublicKeyDigestStruct) 
   {
     publisherPublicKeyDigest_ = 
       Blob(publisherPublicKeyDigestStruct.publisherPublicKeyDigest, publisherPublicKeyDigestStruct.publisherPublicKeyDigestLength);
   }
 
-  const Blob& getPublisherPublicKeyDigest() const { return publisherPublicKeyDigest_; }
+  const Blob& 
+  getPublisherPublicKeyDigest() const { return publisherPublicKeyDigest_; }
 
-  void setPublisherPublicKeyDigest(const std::vector<unsigned char>& publisherPublicKeyDigest) { publisherPublicKeyDigest_ = publisherPublicKeyDigest; }
-  void setPublisherPublicKeyDigest(const unsigned char *publisherPublicKeyDigest, unsigned int publisherPublicKeyDigestLength) 
+  void 
+  setPublisherPublicKeyDigest(const std::vector<unsigned char>& publisherPublicKeyDigest) 
+  { 
+    publisherPublicKeyDigest_ = publisherPublicKeyDigest; 
+  }
+  
+  void 
+  setPublisherPublicKeyDigest(const unsigned char *publisherPublicKeyDigest, unsigned int publisherPublicKeyDigestLength) 
   { 
     publisherPublicKeyDigest_ = Blob(publisherPublicKeyDigest, publisherPublicKeyDigestLength); 
   }
@@ -57,7 +66,8 @@
   /**
    * Clear the publisherPublicKeyDigest.
    */
-  void clear()
+  void 
+  clear()
   {
     publisherPublicKeyDigest_.reset();
   }
diff --git a/ndn-cpp/security/identity/identity-manager.cpp b/ndn-cpp/security/identity/identity-manager.cpp
index 1d0639f..3955518 100644
--- a/ndn-cpp/security/identity/identity-manager.cpp
+++ b/ndn-cpp/security/identity/identity-manager.cpp
@@ -9,7 +9,8 @@
 
 namespace ndn {
 
-void IdentityManager::signByCertificate(const Data &data, const Name &certificateName, WireFormat& wireFormat)
+void 
+IdentityManager::signByCertificate(const Data &data, const Name &certificateName, WireFormat& wireFormat)
 {
   
 }
diff --git a/ndn-cpp/security/identity/identity-manager.hpp b/ndn-cpp/security/identity/identity-manager.hpp
index bb4bc00..86a35b6 100644
--- a/ndn-cpp/security/identity/identity-manager.hpp
+++ b/ndn-cpp/security/identity/identity-manager.hpp
@@ -22,7 +22,8 @@
    * @param certificateName The Name identifying the certificate which identifies the signing key.
    * @param wireFormat The WireFormat for calling encodeData, or WireFormat::getDefaultWireFormat() if omitted.
    */
-  void signByCertificate(const Data& data, const Name& certificateName, WireFormat& wireFormat = *WireFormat::getDefaultWireFormat());
+  void 
+  signByCertificate(const Data& data, const Name& certificateName, WireFormat& wireFormat = *WireFormat::getDefaultWireFormat());
 };
 
 }
diff --git a/ndn-cpp/security/key-chain.cpp b/ndn-cpp/security/key-chain.cpp
index 1a8d12b..da8108c 100644
--- a/ndn-cpp/security/key-chain.cpp
+++ b/ndn-cpp/security/key-chain.cpp
@@ -66,7 +66,8 @@
  * @param data The Data object with the fields to digest.
  * @param digest A pointer to a buffer of size SHA256_DIGEST_LENGTH to receive the data.
  */
-static void dataSignedPortionSha256(const Data& data, WireFormat& wireFormat, unsigned char *digest)
+static void 
+dataSignedPortionSha256(const Data& data, WireFormat& wireFormat, unsigned char *digest)
 {
   unsigned int signedPortionBeginOffset, signedPortionEndOffset;
   Blob encoding = wireFormat.encodeData(data, &signedPortionBeginOffset, &signedPortionEndOffset);
@@ -74,7 +75,8 @@
   ndn_digestSha256(encoding.buf() + signedPortionBeginOffset, signedPortionEndOffset - signedPortionBeginOffset, digest);
 }
 
-void KeyChain::sign
+void 
+KeyChain::sign
   (Data& data, const unsigned char *publicKeyDer, unsigned int publicKeyDerLength, 
    const unsigned char *privateKeyDer, unsigned int privateKeyDerLength, WireFormat& wireFormat)
 {
@@ -108,12 +110,14 @@
   signature->setSignature(signatureBits, signatureBitsLength);
 }
 
-void KeyChain::defaultSign(Data& data, WireFormat& wireFormat)
+void 
+KeyChain::defaultSign(Data& data, WireFormat& wireFormat)
 {
   sign(data, DEFAULT_PUBLIC_KEY_DER, sizeof(DEFAULT_PUBLIC_KEY_DER), DEFAULT_PRIVATE_KEY_DER, sizeof(DEFAULT_PRIVATE_KEY_DER), wireFormat);
 }
 
-bool KeyChain::selfVerifyData(const unsigned char *input, unsigned int inputLength, WireFormat& wireFormat)
+bool 
+KeyChain::selfVerifyData(const unsigned char *input, unsigned int inputLength, WireFormat& wireFormat)
 {
   // Decode the data packet and digest the data fields.
   Data data;
diff --git a/ndn-cpp/security/key-chain.hpp b/ndn-cpp/security/key-chain.hpp
index 297e490..7cfa64e 100644
--- a/ndn-cpp/security/key-chain.hpp
+++ b/ndn-cpp/security/key-chain.hpp
@@ -25,7 +25,8 @@
    * @param privateKeyDerLength The number of bytes in privateKeyDer.
    * @param wireFormat The WireFormat for calling encodeData.
    */
-  static void sign
+  static void 
+  sign
     (Data& data, const unsigned char *publicKeyDer, unsigned int publicKeyDerLength, 
      const unsigned char *privateKeyDer, unsigned int privateKeyDerLength, WireFormat& wireFormat);
 
@@ -34,7 +35,8 @@
    * @param data
    * @param wireFormat The WireFormat for calling encodeData, or WireFormat::getDefaultWireFormat() if omitted.
    */
-  static void defaultSign(Data& data, WireFormat& wireFormat = *WireFormat::getDefaultWireFormat());
+  static void 
+  defaultSign(Data& data, WireFormat& wireFormat = *WireFormat::getDefaultWireFormat());
 
   /**
    * Use the WireFormat to decode the input as a Data packet and use the public key in the key locator to 
@@ -46,9 +48,11 @@
    * @return true if the public key in the Data object verifies the object, false if not or if the Data object
    * doesn't have a public key.
    */
-  static bool selfVerifyData(const unsigned char *input, unsigned int inputLength, WireFormat& wireFormat);
+  static bool 
+  selfVerifyData(const unsigned char *input, unsigned int inputLength, WireFormat& wireFormat);
   
-  static bool selfVerifyData(const unsigned char *input, unsigned int inputLength)
+  static bool 
+  selfVerifyData(const unsigned char *input, unsigned int inputLength)
   {
     return selfVerifyData(input, inputLength, *WireFormat::getDefaultWireFormat());
   }
diff --git a/ndn-cpp/sha256-with-rsa-signature.cpp b/ndn-cpp/sha256-with-rsa-signature.cpp
index 3b71d70..aad9c9f 100644
--- a/ndn-cpp/sha256-with-rsa-signature.cpp
+++ b/ndn-cpp/sha256-with-rsa-signature.cpp
@@ -10,12 +10,14 @@
 
 namespace ndn {
 
-ptr_lib::shared_ptr<Signature> Sha256WithRsaSignature::clone() const
+ptr_lib::shared_ptr<Signature> 
+Sha256WithRsaSignature::clone() const
 {
   return ptr_lib::shared_ptr<Signature>(new Sha256WithRsaSignature(*this));
 }
 
-void Sha256WithRsaSignature::get(struct ndn_Signature& signatureStruct) const 
+void 
+Sha256WithRsaSignature::get(struct ndn_Signature& signatureStruct) const 
 {
   signatureStruct.digestAlgorithmLength = digestAlgorithm_.size();
   if (digestAlgorithm_.size() > 0)
@@ -39,7 +41,8 @@
   keyLocator_.get(signatureStruct.keyLocator);
 }
 
-void Sha256WithRsaSignature::set(const struct ndn_Signature& signatureStruct)
+void 
+Sha256WithRsaSignature::set(const struct ndn_Signature& signatureStruct)
 {
   digestAlgorithm_ = Blob(signatureStruct.digestAlgorithm, signatureStruct.digestAlgorithmLength);
   witness_ = Blob(signatureStruct.witness, signatureStruct.witnessLength);
diff --git a/ndn-cpp/sha256-with-rsa-signature.hpp b/ndn-cpp/sha256-with-rsa-signature.hpp
index d111058..24fa69f 100644
--- a/ndn-cpp/sha256-with-rsa-signature.hpp
+++ b/ndn-cpp/sha256-with-rsa-signature.hpp
@@ -21,59 +21,83 @@
   /**
    * Return a pointer to a new Sha256WithRsaSignature which is a copy of this signature.
    */
-  virtual ptr_lib::shared_ptr<Signature> clone() const;
+  virtual ptr_lib::shared_ptr<Signature> 
+  clone() const;
 
   /**
    * Set the signatureStruct to point to the values in this signature object, without copying any memory.
    * WARNING: The resulting pointers in signatureStruct are invalid after a further use of this object which could reallocate memory.
    * @param signatureStruct a C ndn_Signature struct where the name components array is already allocated.
    */
-  virtual void get(struct ndn_Signature& signatureStruct) const;
+  virtual void 
+  get(struct ndn_Signature& signatureStruct) const;
 
   /**
    * Clear this signature, and set the values by copying from the ndn_Signature struct.
    * @param signatureStruct a C ndn_Signature struct
    */
-  virtual void set(const struct ndn_Signature& signatureStruct);
+  virtual void 
+  set(const struct ndn_Signature& signatureStruct);
 
-  const Blob& getDigestAlgorithm() const { return digestAlgorithm_; }
+  const Blob& 
+  getDigestAlgorithm() const { return digestAlgorithm_; }
 
-  const Blob& getWitness() const { return witness_; }
+  const Blob& 
+  getWitness() const { return witness_; }
 
-  const Blob& getSignature() const { return signature_; }
+  const Blob& 
+  getSignature() const { return signature_; }
   
-  const PublisherPublicKeyDigest& getPublisherPublicKeyDigest() const { return publisherPublicKeyDigest_; }
-  PublisherPublicKeyDigest& getPublisherPublicKeyDigest() { return publisherPublicKeyDigest_; }
+  const PublisherPublicKeyDigest& 
+  getPublisherPublicKeyDigest() const { return publisherPublicKeyDigest_; }
   
-  const KeyLocator& getKeyLocator() const { return keyLocator_; }
-  KeyLocator& getKeyLocator() { return keyLocator_; }
+  PublisherPublicKeyDigest& 
+  getPublisherPublicKeyDigest() { return publisherPublicKeyDigest_; }
+  
+  const KeyLocator& 
+  getKeyLocator() const { return keyLocator_; }
+  
+  KeyLocator& 
+  getKeyLocator() { return keyLocator_; }
 
-  void setDigestAlgorithm(const std::vector<unsigned char>& digestAlgorithm) { digestAlgorithm_ = digestAlgorithm; }
-  void setDigestAlgorithm(const unsigned char *digestAlgorithm, unsigned int digestAlgorithmLength) 
+  void 
+  setDigestAlgorithm(const std::vector<unsigned char>& digestAlgorithm) { digestAlgorithm_ = digestAlgorithm; }
+  
+  void 
+  setDigestAlgorithm(const unsigned char *digestAlgorithm, unsigned int digestAlgorithmLength) 
   { 
     digestAlgorithm_ = Blob(digestAlgorithm, digestAlgorithmLength); 
   }
 
-  void setWitness(const std::vector<unsigned char>& witness) { witness_ = witness; }
-  void setWitness(const unsigned char *witness, unsigned int witnessLength) 
+  void 
+  setWitness(const std::vector<unsigned char>& witness) { witness_ = witness; }
+  
+  void 
+  setWitness(const unsigned char *witness, unsigned int witnessLength) 
   { 
     witness_ = Blob(witness, witnessLength); 
   }
 
-  void setSignature(const std::vector<unsigned char>& signature) { signature_ = signature; }
-  void setSignature(const unsigned char *signature, unsigned int signatureLength) 
+  void 
+  setSignature(const std::vector<unsigned char>& signature) { signature_ = signature; }
+  
+  void 
+  setSignature(const unsigned char *signature, unsigned int signatureLength) 
   { 
     signature_ = Blob(signature, signatureLength); 
   }
 
-  void setPublisherPublicKeyDigest(const PublisherPublicKeyDigest& publisherPublicKeyDigest) { publisherPublicKeyDigest_ = publisherPublicKeyDigest; }
+  void 
+  setPublisherPublicKeyDigest(const PublisherPublicKeyDigest& publisherPublicKeyDigest) { publisherPublicKeyDigest_ = publisherPublicKeyDigest; }
   
-  void setKeyLocator(const KeyLocator& keyLocator) { keyLocator_ = keyLocator; }
+  void 
+  setKeyLocator(const KeyLocator& keyLocator) { keyLocator_ = keyLocator; }
   
   /**
    * Clear all the fields.
    */
-  void clear()
+  void 
+  clear()
   {
     digestAlgorithm_.reset();
     witness_.reset();
diff --git a/ndn-cpp/transport/tcp-transport.cpp b/ndn-cpp/transport/tcp-transport.cpp
index 2fbfeeb..e454e4a 100644
--- a/ndn-cpp/transport/tcp-transport.cpp
+++ b/ndn-cpp/transport/tcp-transport.cpp
@@ -17,7 +17,8 @@
 {  
 }
 
-void TcpTransport::connect(const Transport::ConnectionInfo& connectionInfo, ElementListener& elementListener)
+void 
+TcpTransport::connect(const Transport::ConnectionInfo& connectionInfo, ElementListener& elementListener)
 {
   const TcpTransport::ConnectionInfo& tcpConnectionInfo = dynamic_cast<const TcpTransport::ConnectionInfo&>(connectionInfo);
   
@@ -35,14 +36,16 @@
   elementListener_ = &elementListener;
 }
 
-void TcpTransport::send(const unsigned char *data, unsigned int dataLength)
+void 
+TcpTransport::send(const unsigned char *data, unsigned int dataLength)
 {
   ndn_Error error;
   if ((error = ndn_TcpTransport_send(&transport_, (unsigned char *)data, dataLength)))
     throw std::runtime_error(ndn_getErrorString(error));  
 }
 
-void TcpTransport::processEvents()
+void 
+TcpTransport::processEvents()
 {
   int receiveIsReady;
   ndn_Error error;
@@ -59,12 +62,14 @@
   ndn_BinaryXmlElementReader_onReceivedData(&elementReader_, buffer, nBytes);
 }
 
-bool TcpTransport::getIsConnected()
+bool 
+TcpTransport::getIsConnected()
 {
   return isConnected_;
 }
 
-void TcpTransport::close()
+void 
+TcpTransport::close()
 {
   ndn_Error error;
   if ((error = ndn_TcpTransport_close(&transport_)))
diff --git a/ndn-cpp/transport/tcp-transport.hpp b/ndn-cpp/transport/tcp-transport.hpp
index 9e12ef6..1f8a573 100644
--- a/ndn-cpp/transport/tcp-transport.hpp
+++ b/ndn-cpp/transport/tcp-transport.hpp
@@ -35,15 +35,18 @@
      * Get the host given to the constructor.
      * @return A string reference for the host.
      */
-    const std::string& getHost() const { return host_; }
+    const std::string& 
+    getHost() const { return host_; }
     
     /**
      * Get the port given to the constructor.
      * @return The port number.
      */
-    unsigned short getPort() const { return port_; }
+    unsigned short 
+    getPort() const { return port_; }
     
-    virtual ~ConnectionInfo();
+    virtual 
+    ~ConnectionInfo();
     
   private:
     std::string host_;
diff --git a/ndn-cpp/transport/transport.cpp b/ndn-cpp/transport/transport.cpp
index bb28045..ae532db 100644
--- a/ndn-cpp/transport/transport.cpp
+++ b/ndn-cpp/transport/transport.cpp
@@ -15,27 +15,32 @@
 {  
 }
 
-void Transport::connect(const Transport::ConnectionInfo& connectionInfo, ElementListener& elementListener) 
+void 
+Transport::connect(const Transport::ConnectionInfo& connectionInfo, ElementListener& elementListener) 
 {
   throw logic_error("unimplemented");
 }
   
-void Transport::send(const unsigned char *data, unsigned int dataLength)
+void 
+Transport::send(const unsigned char *data, unsigned int dataLength)
 {
   throw logic_error("unimplemented");
 }
 
-void Transport::processEvents()
+void 
+Transport::processEvents()
 {
   throw logic_error("unimplemented");
 }
 
-bool Transport::getIsConnected()
+bool 
+Transport::getIsConnected()
 {
   throw logic_error("unimplemented");
 }
 
-void Transport::close()
+void 
+Transport::close()
 {
 }
 
diff --git a/ndn-cpp/transport/transport.hpp b/ndn-cpp/transport/transport.hpp
index c791a87..2f71096 100644
--- a/ndn-cpp/transport/transport.hpp
+++ b/ndn-cpp/transport/transport.hpp
@@ -28,16 +28,19 @@
    * @param connectionInfo A reference to an object of a subclass of ConnectionInfo.
    * @param elementListener Not a shared_ptr because we assume that it will remain valid during the life of this object.
    */
-  virtual void connect(const Transport::ConnectionInfo& connectionInfo, ElementListener& elementListener);
+  virtual void 
+  connect(const Transport::ConnectionInfo& connectionInfo, ElementListener& elementListener);
   
   /**
    * Set data to the host
    * @param data A pointer to the buffer of data to send.
    * @param dataLength The number of bytes in data.
    */
-  virtual void send(const unsigned char *data, unsigned int dataLength);
+  virtual void 
+  send(const unsigned char *data, unsigned int dataLength);
   
-  void send(const std::vector<unsigned char>& data)
+  void 
+  send(const std::vector<unsigned char>& data)
   {
     send(&data[0], data.size());
   }
@@ -49,14 +52,17 @@
    * @throw This may throw an exception for reading data or in the callback for processing the data.  If you
    * call this from an main event loop, you may want to catch and log/disregard all exceptions.
    */
-  virtual void processEvents() = 0;
+  virtual void 
+  processEvents() = 0;
 
-  virtual bool getIsConnected();
+  virtual bool 
+  getIsConnected();
   
   /**
    * Close the connection.  This base class implementation does nothing, but your derived class can override.
    */
-  virtual void close();
+  virtual void 
+  close();
   
   virtual ~Transport();
 };
diff --git a/ndn-cpp/transport/udp-transport.cpp b/ndn-cpp/transport/udp-transport.cpp
index 0cde016..d5e48cb 100644
--- a/ndn-cpp/transport/udp-transport.cpp
+++ b/ndn-cpp/transport/udp-transport.cpp
@@ -17,7 +17,8 @@
 {  
 }
 
-void UdpTransport::connect(const Transport::ConnectionInfo& connectionInfo, ElementListener& elementListener)
+void 
+UdpTransport::connect(const Transport::ConnectionInfo& connectionInfo, ElementListener& elementListener)
 {
   const UdpTransport::ConnectionInfo& udpConnectionInfo = dynamic_cast<const UdpTransport::ConnectionInfo&>(connectionInfo);
   
@@ -35,14 +36,16 @@
   elementListener_ = &elementListener;
 }
 
-void UdpTransport::send(const unsigned char *data, unsigned int dataLength)
+void 
+UdpTransport::send(const unsigned char *data, unsigned int dataLength)
 {
   ndn_Error error;
   if ((error = ndn_UdpTransport_send(&transport_, (unsigned char *)data, dataLength)))
     throw std::runtime_error(ndn_getErrorString(error));  
 }
 
-void UdpTransport::processEvents()
+void 
+UdpTransport::processEvents()
 {
   int receiveIsReady;
   ndn_Error error;
@@ -59,12 +62,14 @@
   ndn_BinaryXmlElementReader_onReceivedData(&elementReader_, buffer, nBytes);
 }
 
-bool UdpTransport::getIsConnected()
+bool 
+UdpTransport::getIsConnected()
 {
   return isConnected_;
 }
 
-void UdpTransport::close()
+void 
+UdpTransport::close()
 {
   ndn_Error error;
   if ((error = ndn_UdpTransport_close(&transport_)))
diff --git a/ndn-cpp/transport/udp-transport.hpp b/ndn-cpp/transport/udp-transport.hpp
index deb7dc5..3ea1703 100644
--- a/ndn-cpp/transport/udp-transport.hpp
+++ b/ndn-cpp/transport/udp-transport.hpp
@@ -35,15 +35,18 @@
      * Get the host given to the constructor.
      * @return A string reference for the host.
      */
-    const std::string& getHost() const { return host_; }
+    const std::string& 
+    getHost() const { return host_; }
     
     /**
      * Get the port given to the constructor.
      * @return The port number.
      */
-    unsigned short getPort() const { return port_; }
+    unsigned short 
+    getPort() const { return port_; }
     
-    virtual ~ConnectionInfo();
+    virtual 
+    ~ConnectionInfo();
 
   private:
     std::string host_;
@@ -62,14 +65,16 @@
    * @param connectionInfo A reference to a TcpTransport::ConnectionInfo.
    * @param elementListener Not a shared_ptr because we assume that it will remain valid during the life of this object.
    */
-  virtual void connect(const Transport::ConnectionInfo& connectionInfo, ElementListener& elementListener);
+  virtual void 
+  connect(const Transport::ConnectionInfo& connectionInfo, ElementListener& elementListener);
   
   /**
    * Set data to the host
    * @param data A pointer to the buffer of data to send.
    * @param dataLength The number of bytes in data.
    */
-  virtual void send(const unsigned char *data, unsigned int dataLength);
+  virtual void 
+  send(const unsigned char *data, unsigned int dataLength);
 
   /**
    * Process any data to receive.  For each element received, call elementListener.onReceivedElement.
@@ -78,14 +83,17 @@
    * @throw This may throw an exception for reading data or in the callback for processing the data.  If you
    * call this from an main event loop, you may want to catch and log/disregard all exceptions.
    */
-  virtual void processEvents();
+  virtual void 
+  processEvents();
   
-  virtual bool getIsConnected();
+  virtual bool 
+  getIsConnected();
 
   /**
    * Close the connection to the host.
    */
-  virtual void close();
+  virtual void 
+  close();
 
   ~UdpTransport();
   
diff --git a/ndn-cpp/util/blob.hpp b/ndn-cpp/util/blob.hpp
index 24de528..0572301 100644
--- a/ndn-cpp/util/blob.hpp
+++ b/ndn-cpp/util/blob.hpp
@@ -68,7 +68,8 @@
   /**
    * Return the length of the immutable byte array.
    */
-  unsigned int size() const
+  unsigned int 
+  size() const
   {
     if (*this)
       return (*this)->size();
@@ -79,7 +80,8 @@
   /**
    * Return a const pointer to the first byte of the immutable byte array, or 0 if the pointer is null.
    */
-  const unsigned char* buf() const
+  const unsigned char* 
+  buf() const
   {
     if (*this)
       return &(*this)->front();
diff --git a/ndn-cpp/util/changed-event.cpp b/ndn-cpp/util/changed-event.cpp
index 24a87bd..1d12c75 100644
--- a/ndn-cpp/util/changed-event.cpp
+++ b/ndn-cpp/util/changed-event.cpp
@@ -10,7 +10,8 @@
 
 namespace ndn {
 
-void ChangedEvent::fire()
+void 
+ChangedEvent::fire()
 {
   for (unsigned int i = 0; i < listeners_.size(); ++i)
     listeners_[i]();
diff --git a/ndn-cpp/util/changed-event.hpp b/ndn-cpp/util/changed-event.hpp
index 3bac8b6..ce4b20f 100644
--- a/ndn-cpp/util/changed-event.hpp
+++ b/ndn-cpp/util/changed-event.hpp
@@ -23,7 +23,8 @@
    * Add onChanged to the listener list. This does not check if a duplicate is already in the list.
    * @param onChanged The OnChanged function object.
    */
-  void add(OnChanged onChanged)
+  void 
+  add(OnChanged onChanged)
   {
     listeners_.push_back(onChanged);
   }
@@ -31,7 +32,8 @@
   /**
    * Call all the listeners.
    */
-  void fire();
+  void 
+  fire();
 
 #if 0  
 private:
diff --git a/ndn-cpp/util/dynamic-uchar-vector.cpp b/ndn-cpp/util/dynamic-uchar-vector.cpp
index 454ce8c..4b17e63 100644
--- a/ndn-cpp/util/dynamic-uchar-vector.cpp
+++ b/ndn-cpp/util/dynamic-uchar-vector.cpp
@@ -16,7 +16,8 @@
   ndn_DynamicUCharArray_initialize(this, &vector_->front(), initialLength, DynamicUCharVector::realloc);
 }
 
-unsigned char *DynamicUCharVector::realloc(struct ndn_DynamicUCharArray *self, unsigned char *array, unsigned int length)
+unsigned char*
+DynamicUCharVector::realloc(struct ndn_DynamicUCharArray *self, unsigned char *array, unsigned int length)
 {
   // Because this method is private, assume there is not a problem with upcasting.
   DynamicUCharVector *thisObject = (DynamicUCharVector *)self;
diff --git a/ndn-cpp/util/dynamic-uchar-vector.hpp b/ndn-cpp/util/dynamic-uchar-vector.hpp
index 7313cc9..68950a9 100644
--- a/ndn-cpp/util/dynamic-uchar-vector.hpp
+++ b/ndn-cpp/util/dynamic-uchar-vector.hpp
@@ -29,7 +29,8 @@
    * Get the shared_ptr to the allocated vector.
    * @return The shared_ptr to the allocated vector. 
    */
-  const ptr_lib::shared_ptr<std::vector<unsigned char> >& get() { return vector_; }
+  const ptr_lib::shared_ptr<std::vector<unsigned char> >& 
+  get() { return vector_; }
   
 private:
   /**
@@ -39,7 +40,8 @@
    * @param length The new length for the vector.
    * @return The front of the allocated vector.
    */
-  static unsigned char *realloc(struct ndn_DynamicUCharArray *self, unsigned char *array, unsigned int length);
+  static unsigned char*
+  realloc(struct ndn_DynamicUCharArray *self, unsigned char *array, unsigned int length);
   
   ptr_lib::shared_ptr<std::vector<unsigned char> > vector_;
 };
diff --git a/ndn-cpp/util/signed-blob.hpp b/ndn-cpp/util/signed-blob.hpp
index 25966b6..0b6cdda 100644
--- a/ndn-cpp/util/signed-blob.hpp
+++ b/ndn-cpp/util/signed-blob.hpp
@@ -76,7 +76,8 @@
   /**
    * Return the length of the signed portion of the immutable byte array, or 0 of the pointer to the array is null.
    */
-  unsigned int signedSize() const
+  unsigned int 
+  signedSize() const
   {
     if (*this)
       return signedPortionEndOffset_ - signedPortionBeginOffset_;
@@ -88,7 +89,8 @@
    * Return a const pointer to the first byte of the signed portion of the immutable byte array, or 0 if the 
    * pointer to the array is null.
    */
-  const unsigned char* signedBuf() const
+  const unsigned char*
+  signedBuf() const
   {
     if (*this)
       return &(*this)->front() + signedPortionBeginOffset_;
@@ -99,12 +101,14 @@
   /**
    * Return the offset in the array of the beginning of the signed portion.
    */  
-  unsigned int getSignedPortionBeginOffset() { return signedPortionBeginOffset_; }
+  unsigned int 
+  getSignedPortionBeginOffset() { return signedPortionBeginOffset_; }
 
   /**
    * Return the offset in the array of the end of the signed portion.
    */  
-  unsigned int getSignedPortionEndOffset() { return signedPortionEndOffset_; }
+  unsigned int 
+  getSignedPortionEndOffset() { return signedPortionEndOffset_; }
   
 private:
   unsigned int signedPortionBeginOffset_;
