diff --git a/ndn-cpp/interest.hpp b/ndn-cpp/interest.hpp
index e4aeeb1..b3397af 100644
--- a/ndn-cpp/interest.hpp
+++ b/ndn-cpp/interest.hpp
@@ -38,7 +38,7 @@
    * 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)
@@ -47,7 +47,7 @@
   
   ndn_ExcludeType getType() const { return type_; }
   
-  const Name::Component &getComponent() const { return component_; }
+  const Name::Component& getComponent() const { return component_; }
   
 private:
   ndn_ExcludeType type_;
@@ -69,20 +69,20 @@
     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
@@ -122,9 +122,9 @@
  */
 class Interest {
 public:    
-  Interest(const Name &name, int minSuffixComponents, int maxSuffixComponents, 
-    const PublisherPublicKeyDigest &publisherPublicKeyDigest, const Exclude &exclude, int childSelector, int answerOriginKind, 
-    int scope, double interestLifetimeMilliseconds, const std::vector<unsigned char> &nonce) 
+  Interest(const Name& name, int minSuffixComponents, int maxSuffixComponents, 
+    const PublisherPublicKeyDigest& publisherPublicKeyDigest, const Exclude& exclude, int childSelector, int answerOriginKind, 
+    int scope, double interestLifetimeMilliseconds, const std::vector<unsigned char>& nonce) 
   : name_(name), minSuffixComponents_(minSuffixComponents), maxSuffixComponents_(maxSuffixComponents),
   publisherPublicKeyDigest_(publisherPublicKeyDigest), exclude_(exclude), childSelector_(childSelector), 
   answerOriginKind_(answerOriginKind), scope_(scope), interestLifetimeMilliseconds_(interestLifetimeMilliseconds),
@@ -132,8 +132,8 @@
   {
   }
 
-  Interest(const Name &name, int minSuffixComponents, int maxSuffixComponents, 
-    const PublisherPublicKeyDigest &publisherPublicKeyDigest, const Exclude &exclude, int childSelector, int answerOriginKind, 
+  Interest(const Name& name, int minSuffixComponents, int maxSuffixComponents, 
+    const PublisherPublicKeyDigest& publisherPublicKeyDigest, const Exclude& exclude, int childSelector, int answerOriginKind, 
     int scope, double interestLifetimeMilliseconds) 
   : name_(name), minSuffixComponents_(minSuffixComponents), maxSuffixComponents_(maxSuffixComponents),
   publisherPublicKeyDigest_(publisherPublicKeyDigest), exclude_(exclude), childSelector_(childSelector), 
@@ -141,14 +141,14 @@
   {
   }
 
-  Interest(const Name &name, double interestLifetimeMilliseconds) 
+  Interest(const Name& name, double interestLifetimeMilliseconds) 
   : name_(name)
   {
     construct();
     interestLifetimeMilliseconds_ = interestLifetimeMilliseconds;
   }
 
-  Interest(const Name &name) 
+  Interest(const Name& name) 
   : name_(name)
   {
     construct();
@@ -159,7 +159,7 @@
     construct();
   }
   
-  ptr_lib::shared_ptr<std::vector<unsigned char> > wireEncode(WireFormat &wireFormat) const 
+  ptr_lib::shared_ptr<std::vector<unsigned char> > wireEncode(WireFormat& wireFormat) const 
   {
     return wireFormat.encodeInterest(*this);
   }
@@ -167,7 +167,7 @@
   {
     return wireEncode(*WireFormat::getDefaultWireFormat());
   }
-  void wireDecode(const unsigned char *input, unsigned int inputLength, WireFormat &wireFormat) 
+  void wireDecode(const unsigned char *input, unsigned int inputLength, WireFormat& wireFormat) 
   {
     wireFormat.decodeInterest(*this, input, inputLength);
   }
@@ -175,11 +175,11 @@
   {
     wireDecode(input, inputLength, *WireFormat::getDefaultWireFormat());
   }
-  void wireDecode(const std::vector<unsigned char> &input, WireFormat &wireFormat) 
+  void wireDecode(const std::vector<unsigned char>& input, WireFormat& wireFormat) 
   {
     wireDecode(&input[0], input.size(), wireFormat);
   }
-  void wireDecode(const std::vector<unsigned char> &input) 
+  void wireDecode(const std::vector<unsigned char>& input) 
   {
     wireDecode(&input[0], input.size());
   }
@@ -189,20 +189,20 @@
    * 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_; }
+  const Name& getName() const { return name_; }
   
   int getMinSuffixComponents() const { return minSuffixComponents_; }
   
   int getMaxSuffixComponents() const { return maxSuffixComponents_; }
   
-  PublisherPublicKeyDigest &getPublisherPublicKeyDigest() { return publisherPublicKeyDigest_; }
-  const PublisherPublicKeyDigest &getPublisherPublicKeyDigest() const { return publisherPublicKeyDigest_; }
+  PublisherPublicKeyDigest& getPublisherPublicKeyDigest() { return publisherPublicKeyDigest_; }
+  const PublisherPublicKeyDigest& getPublisherPublicKeyDigest() const { return publisherPublicKeyDigest_; }
 
-  Exclude &getExclude() { return exclude_; }
-  const Exclude &getExclude() const { return exclude_; }
+  Exclude& getExclude() { return exclude_; }
+  const Exclude& getExclude() const { return exclude_; }
   
   int getChildSelector() const { return childSelector_; }
 
@@ -212,13 +212,13 @@
 
   double getInterestLifetimeMilliseconds() const { return interestLifetimeMilliseconds_; }
 
-  const std::vector<unsigned char> &getNonce() const { return nonce_; }
+  const std::vector<unsigned char>& 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; }
   
@@ -232,7 +232,7 @@
 
   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() 
