diff --git a/ndn-cpp/face.hpp b/ndn-cpp/face.hpp
index 0b7aa54..9dce469 100644
--- a/ndn-cpp/face.hpp
+++ b/ndn-cpp/face.hpp
@@ -7,6 +7,7 @@
 #define NDN_FACE_HPP
 
 #include "node.hpp"
+#include "transport/tcp-transport.hpp"
 
 namespace ndn {
 
@@ -28,22 +29,14 @@
   /**
    * Create a new Face for communication with an NDN hub at host:port using the default TcpTransport.
    * @param host The host of the NDN hub.
-   * @param port The port of the NDN hub.
+   * @param port The port of the NDN hub. If omitted. use 9695.
    */
-  Face(const char *host, unsigned short port)
-  : node_(host, port)
+  Face(const char *host, unsigned short port = 9695)
+  : node_(ptr_lib::make_shared<TcpTransport>(), 
+          ptr_lib::make_shared<TcpTransport::ConnectionInfo>(host, port))
   {
   }
-  
-  /**
-   * Create a new Face for communication with an NDN hub at host with the default port 9695 and using the default TcpTransport.
-   * @param host The host of the NDN hub.
-   */
-  Face(const char *host)
-  : node_(host)
-  {
-  }
-  
+    
   /**
    * Send the Interest through the transport, read the entire response and call onData(interest, data).
    * @param interest A reference to the Interest.  This copies the Interest.
@@ -52,22 +45,12 @@
    * @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 = OnTimeout())
   {
     node_.expressInterest(interest, onData, onTimeout);
   }
 
   /**
-   * Send the Interest through the transport, read the entire response and call onData(interest, data).
-   * @param interest A reference to the Interest.  This copies the Interest.
-   * @param onData A function object to call when a matching data packet is received.  This copies the function object, so you may need to
-   * use func_lib::ref() as appropriate.
-   */
-  void expressInterest(const Interest &interest, const OnData &onData) {
-    node_.expressInterest(interest, onData);
-  }
-
-  /**
    * Encode name as an Interest. If interestTemplate is not 0, use its interest selectors.
    * Send the interest through the transport, read the entire response and call onData(interest, data).
    * @param name A reference to a Name for the interest.  This copies the Name.
@@ -77,10 +60,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 Name &name, const Interest *interestTemplate, const OnData &onData, const OnTimeout &onTimeout)
-  {
-    node_.expressInterest(name, interestTemplate, onData, 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.
@@ -91,34 +71,9 @@
    * @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) 
+  void expressInterest(const Name &name, const OnData &onData, const OnTimeout &onTimeout = OnTimeout()) 
   {
-    node_.expressInterest(name, onData, onTimeout);
-  }
-  
-  /**
-   * Encode name as an Interest. If interestTemplate is not 0, use its interest selectors.
-   * Send the interest through the transport, read the entire response and call onData(interest, data).
-   * @param name A reference to a Name for the interest.  This copies the Name.
-   * @param interestTemplate if not 0, copy interest selectors from the template.   This does not keep a pointer to the Interest object.
-   * @param onData A function object to call when a matching data packet is received.  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)
-  {
-    node_.expressInterest(name, interestTemplate, onData);
-  }
-  
-  /**
-   * Encode name as an Interest, using a default interest lifetime.
-   * Send the interest through the transport, read the entire response and call onData(interest, data).
-   * @param name A reference to a Name for the interest.  This copies the Name.
-   * @param onData A function object to call when a matching data packet is received.  This copies the function object, so you may need to
-   * use func_lib::ref() as appropriate.
-   */
-  void expressInterest(const Name &name, const OnData &onData)
-  {
-    node_.expressInterest(name, onData);
+    expressInterest(name, 0, onData, onTimeout);
   }
   
   /**
@@ -128,21 +83,10 @@
    * 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 = 0)
   {
     node_.registerPrefix(prefix, onInterest, flags);
   }
-
-  /**
-   * Register prefix with the connected NDN hub and call onInterest when a matching interest is received.
-   * @param prefix A reference to a Name for the prefix to register.  This copies the Name.
-   * @param onInterest A function object to call when a matching interest is received.  This copies the function object, so you may need to
-   * use func_lib::ref() as appropriate.
-   */
-  void registerPrefix(const Name &prefix, const OnInterest &onInterest)
-  {
-    node_.registerPrefix(prefix, onInterest);
-  }
   
   /**
    * Process any data to receive or call timeout callbacks.
