diff --git a/ndn-cpp/node.hpp b/ndn-cpp/node.hpp
index b82ba8a..9efb742 100644
--- a/ndn-cpp/node.hpp
+++ b/ndn-cpp/node.hpp
@@ -17,18 +17,18 @@
 /**
  * An OnData function object is used to pass a callback to expressInterest.
  */
-typedef func_lib::function<void(const ptr_lib::shared_ptr<const Interest> &, const ptr_lib::shared_ptr<Data> &)> OnData;
+typedef func_lib::function<void(const ptr_lib::shared_ptr<const Interest>& , const ptr_lib::shared_ptr<Data>& )> OnData;
 
 /**
  * An OnTimeout function object is used to pass a callback to expressInterest.
  */
-typedef func_lib::function<void(const ptr_lib::shared_ptr<const Interest> &)> OnTimeout;
+typedef func_lib::function<void(const ptr_lib::shared_ptr<const Interest>& )> OnTimeout;
 
 /**
  * An OnInterest function object is used to pass a callback to registerPrefix.
  */
 typedef func_lib::function<void
-  (const ptr_lib::shared_ptr<const Name> &, const ptr_lib::shared_ptr<const Interest> &, Transport &)> OnInterest;
+  (const ptr_lib::shared_ptr<const Name>& , const ptr_lib::shared_ptr<const Interest>& , Transport& )> OnInterest;
 
 class Face;
   
@@ -39,7 +39,7 @@
    * @param transport A shared_ptr to a Transport object used for communication.
    * @param transport A shared_ptr to a Transport::ConnectionInfo to be used to connect to the transport.
    */
-  Node(const ptr_lib::shared_ptr<Transport> &transport, const ptr_lib::shared_ptr<const Transport::ConnectionInfo> &connectionInfo);
+  Node(const ptr_lib::shared_ptr<Transport>& transport, const ptr_lib::shared_ptr<const Transport::ConnectionInfo>& connectionInfo);
   
   /**
    * Send the Interest through the transport, read the entire response and call onData(interest, data).
@@ -49,7 +49,7 @@
    * @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.
@@ -58,7 +58,7 @@
    * 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.
@@ -69,9 +69,9 @@
    */
   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);
   
@@ -86,11 +86,11 @@
      * @param onData A function object to call when a matching data packet is received.
      * @param onTimeout A function object to call if the interest times out.  If onTimeout is an empty OnTimeout(), this does not use it.
      */
-    PitEntry(const ptr_lib::shared_ptr<const Interest> &interest, const OnData &onData, const OnTimeout &onTimeout);
+    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_.
@@ -100,7 +100,7 @@
      * @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_;
     }
@@ -131,14 +131,14 @@
      * @param prefix A shared_ptr for the prefix.
      * @param onInterest A function object to call when a matching data packet is received.
      */
-    PrefixEntry(const ptr_lib::shared_ptr<const Name> &prefix, const OnInterest &onInterest)
+    PrefixEntry(const ptr_lib::shared_ptr<const Name>& prefix, const OnInterest& onInterest)
     : prefix_(prefix), onInterest_(onInterest)
     {
     }
     
-    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_;
@@ -162,22 +162,22 @@
      * @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:
-      Info(Node *node, const Name &prefix, const OnInterest &onInterest, int flags)
+      Info(Node *node, const Name& prefix, const OnInterest& onInterest, int flags)
       : node_(*node), prefix_(prefix), onInterest_(onInterest), flags_(flags)
       {      
       }
       
-      Node &node_;
+      Node& node_;
       Name prefix_;
       const OnInterest onInterest_;
       int flags_;
@@ -193,14 +193,14 @@
    * @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_.
@@ -208,7 +208,7 @@
    * @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_;
