diff --git a/include/ndn-cpp/face.hpp b/include/ndn-cpp/face.hpp
index a0b3f0e..c7e0826 100644
--- a/include/ndn-cpp/face.hpp
+++ b/include/ndn-cpp/face.hpp
@@ -9,7 +9,8 @@
 #define NDN_FACE_HPP
 
 #include "node.hpp"
-#include "transport/tcp-transport.hpp"
+#include "transport/transport.hpp"
+#include "transport/unix-transport.hpp"
 
 namespace ndn {
 
@@ -19,6 +20,16 @@
 class Face {
 public:
   /**
+   * 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. If omitted. use 6363.
+   */
+  Face()
+  : node_(ptr_lib::shared_ptr<UnixTransport>(new UnixTransport()))
+  {
+  }
+
+  /**
    * Create a new Face for communication with an NDN hub with the given Transport object and connectionInfo.
    * @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.
@@ -33,10 +44,10 @@
    * @param host The host of the NDN hub.
    * @param port The port of the NDN hub. If omitted. use 6363.
    */
-  Face(const char *host, unsigned short port = 6363)
-  : node_(ptr_lib::shared_ptr<TcpTransport>(new TcpTransport(host, port)))
-  {
-  }
+  // Face(const char *host, unsigned short port = 6363)
+  // : node_(ptr_lib::shared_ptr<TcpTransport>(new TcpTransport(host, port)))
+  // {
+  // }
     
   /**
    * Send the Interest through the transport, read the entire response and call onData(interest, data).
@@ -50,10 +61,9 @@
    */
   uint64_t 
   expressInterest
-    (const Interest& interest, const OnData& onData, const OnTimeout& onTimeout = OnTimeout(),
-     WireFormat& wireFormat = *WireFormat::getDefaultWireFormat())
+    (const Interest& interest, const OnData& onData, const OnTimeout& onTimeout = OnTimeout())
   {
-    return node_.expressInterest(interest, onData, onTimeout, wireFormat);
+    return node_.expressInterest(interest, onData, onTimeout);
   }
 
   /**
@@ -70,8 +80,7 @@
    */
   uint64_t 
   expressInterest
-    (const Name& name, const Interest *interestTemplate, const OnData& onData, const OnTimeout& onTimeout = OnTimeout(),
-     WireFormat& wireFormat = *WireFormat::getDefaultWireFormat());
+    (const Name& name, const Interest *interestTemplate, const OnData& onData, const OnTimeout& onTimeout = OnTimeout());
 
   /**
    * Encode name as an Interest, using a default interest lifetime.
@@ -86,10 +95,9 @@
    */
   uint64_t 
   expressInterest
-    (const Name& name, const OnData& onData, const OnTimeout& onTimeout = OnTimeout(),
-     WireFormat& wireFormat = *WireFormat::getDefaultWireFormat()) 
+    (const Name& name, const OnData& onData, const OnTimeout& onTimeout = OnTimeout()) 
   {
-    return expressInterest(name, 0, onData, onTimeout, wireFormat);
+    return expressInterest(name, 0, onData, onTimeout);
   }
 
   /**
@@ -118,10 +126,9 @@
    */
   uint64_t 
   setInterestFilter
-    (const Name& prefix, const OnInterest& onInterest, const OnRegisterFailed& onRegisterFailed, const ForwardingFlags& flags = ForwardingFlags(), 
-     WireFormat& wireFormat = *WireFormat::getDefaultWireFormat())
+    (const Name& prefix, const OnInterest& onInterest, const OnRegisterFailed& onRegisterFailed, const ForwardingFlags& flags = ForwardingFlags())
   {
-    return node_.registerPrefix(prefix, onInterest, onRegisterFailed, flags, wireFormat);
+    return node_.registerPrefix(prefix, onInterest, onRegisterFailed, flags);
   }
 
   /**
diff --git a/include/ndn-cpp/node.hpp b/include/ndn-cpp/node.hpp
index c68372d..3c43480 100644
--- a/include/ndn-cpp/node.hpp
+++ b/include/ndn-cpp/node.hpp
@@ -11,11 +11,9 @@
 #include "common.hpp"
 #include "interest.hpp"
 #include "data.hpp"
-#include "transport/tcp-transport.hpp"
 #include "forwarding-flags.hpp"
-#include "encoding/element-listener.hpp"
+#include "transport/transport.hpp"
 
-struct ndn_Interest;
 
 namespace ndn {
 
@@ -41,9 +39,8 @@
 typedef func_lib::function<void(const ptr_lib::shared_ptr<const Name>&)> OnRegisterFailed;
 
 class Face;
-class KeyChain;
     
-class Node : public ElementListener {
+class Node {
 public:
   /**
    * Create a new Node for communication with an NDN hub with the given Transport object and connectionInfo.
@@ -63,7 +60,7 @@
    * @return The pending interest ID which can be used with removePendingInterest.
    */
   uint64_t 
-  expressInterest(const Interest& interest, const OnData& onData, const OnTimeout& onTimeout, WireFormat& wireFormat);
+  expressInterest(const Interest& interest, const OnData& onData, const OnTimeout& onTimeout);
   
   /**
    * Remove the pending interest entry with the pendingInterestId from the pending interest table.
@@ -87,8 +84,7 @@
    */
   uint64_t 
   registerPrefix
-    (const Name& prefix, const OnInterest& onInterest, const OnRegisterFailed& onRegisterFailed, const ForwardingFlags& flags, 
-     WireFormat& wireFormat);
+    (const Name& prefix, const OnInterest& onInterest, const OnRegisterFailed& onRegisterFailed, const ForwardingFlags& flags);
 
   /**
    * Remove the registered prefix entry with the registeredPrefixId from the pending interest table.  
@@ -113,12 +109,13 @@
   getTransport() { return transport_; }
   
   void 
-  onReceivedElement(const uint8_t *element, size_t elementLength);
-  
-  void 
   shutdown();
 
 private:
+  void 
+  onReceiveElement(const Block &wire);
+
+private:
   class PendingInterest {
   public:
     /**
@@ -154,20 +151,6 @@
     getOnData() { return onData_; }
     
     /**
-     * Get the struct ndn_Interest for the interest_.
-     * WARNING: Assume that this PitEntry was created with new, so that no copy constructor is invoked between calls.
-     * This class is private to Node and only used by its methods, so this should be OK.
-     * TODO: Doesn't this functionality belong in the Interest class?
-     * @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()
-    {
-      return *interestStruct_;
-    }
-    
-    /**
      * Check if this interest is timed out.
      * @param nowMilliseconds The current time in milliseconds from ndn_getNowMilliseconds.
      * @return true if this interest timed out, otherwise false.
@@ -185,15 +168,13 @@
     callTimeout();
     
   private:
-    ptr_lib::shared_ptr<const Interest> interest_;
-    std::vector<struct ndn_NameComponent> nameComponents_;
-    std::vector<struct ndn_ExcludeEntry> excludeEntries_;
-    ptr_lib::shared_ptr<struct ndn_Interest> interestStruct_;
-  
     static uint64_t lastPendingInterestId_; /**< A class variable used to get the next unique ID. */
+
     uint64_t pendingInterestId_;            /**< A unique identifier for this entry so it can be deleted */
+    ptr_lib::shared_ptr<const Interest> interest_;
     const OnData onData_;
     const OnTimeout onTimeout_;
+    
     MillisecondsSince1970 timeoutTimeMilliseconds_; /**< The time when the interest times out in milliseconds according to ndn_getNowMilliseconds, or -1 for no timeout. */
   };
 
@@ -206,7 +187,9 @@
      * @param onInterest A function object to call when a matching data packet is received.
      */
     RegisteredPrefix(uint64_t registeredPrefixId, const ptr_lib::shared_ptr<const Name>& prefix, const OnInterest& onInterest)
-    : registeredPrefixId_(registeredPrefixId), prefix_(prefix), onInterest_(onInterest)
+      : registeredPrefixId_(registeredPrefixId)
+      , prefix_(prefix)
+      , onInterest_(onInterest)
     {
     }
     
@@ -223,79 +206,33 @@
      * Return the registeredPrefixId given to the constructor.
      */
     uint64_t 
-    getRegisteredPrefixId() { return registeredPrefixId_; }
+    getRegisteredPrefixId()
+    {
+      return registeredPrefixId_;
+    }
     
     const ptr_lib::shared_ptr<const Name>& 
-    getPrefix() { return prefix_; }
+    getPrefix()
+    {
+      return prefix_;
+    }
     
     const OnInterest& 
-    getOnInterest() { return onInterest_; }
+    getOnInterest()
+    {
+      return onInterest_;
+    }
     
   private:
     static uint64_t lastRegisteredPrefixId_; /**< A class variable used to get the next unique ID. */
+
     uint64_t registeredPrefixId_;            /**< A unique identifier for this entry so it can be deleted */
     ptr_lib::shared_ptr<const Name> prefix_;
     const OnInterest onInterest_;
   };
   
-  /**
-   * An NdndIdFetcher receives the Data packet with the publisher public key digest for the connected NDN hub.
-   * This class is a function object for the callbacks. It only holds a pointer to an Info object, so it is OK to copy the pointer.
-   */
-  class NdndIdFetcher {
-  public:
-    class Info;
-    NdndIdFetcher(ptr_lib::shared_ptr<NdndIdFetcher::Info> info)
-    : info_(info)
-    {      
-    }
-    
-    /**
-     * We received the ndnd ID.
-     * @param interest
-     * @param data
-     */
-    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);
-    
-    class Info {
-    public:
-      /**
-       * 
-       * @param node
-       * @param registeredPrefixId The PrefixEntry::getNextRegisteredPrefixId() which registerPrefix got so it could return it to the caller.
-       * @param prefix
-       * @param onInterest
-       * @param onRegisterFailed
-       * @param flags
-       * @param wireFormat
-       */
-      Info(Node *node, uint64_t registeredPrefixId, const Name& prefix, const OnInterest& onInterest, 
-           const OnRegisterFailed& onRegisterFailed, const ForwardingFlags& flags, WireFormat& wireFormat)
-      : node_(*node), registeredPrefixId_(registeredPrefixId), prefix_(new Name(prefix)), onInterest_(onInterest), onRegisterFailed_(onRegisterFailed), 
-        flags_(flags), wireFormat_(wireFormat)
-      {      
-      }
-      
-      Node& node_;
-      uint64_t registeredPrefixId_;
-      ptr_lib::shared_ptr<const Name> prefix_;
-      const OnInterest onInterest_;
-      const OnRegisterFailed onRegisterFailed_;
-      ForwardingFlags flags_;
-      WireFormat& wireFormat_;
-    };
-    
-  private:
-    ptr_lib::shared_ptr<Info> info_;
-  };
+  typedef std::vector<ptr_lib::shared_ptr<PendingInterest> > PendingInterestTable;
+  typedef std::vector<ptr_lib::shared_ptr<RegisteredPrefix> > RegisteredPrefixTable;
   
   /**
    * Find the entry from the pit_ where the name conforms to the entry's interest selectors, and
@@ -303,7 +240,7 @@
    * @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 
+  PendingInterestTable::iterator 
   getEntryIndexForExpressedInterest(const Name& name);
   
   /**
@@ -311,7 +248,7 @@
    * @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.
    */
-  RegisteredPrefix*
+  RegisteredPrefixTable::iterator
   getEntryForRegisteredPrefix(const Name& name);
 
   /**
@@ -326,15 +263,23 @@
   void 
   registerPrefixHelper
     (uint64_t registeredPrefixId, const ptr_lib::shared_ptr<const Name>& prefix, const OnInterest& onInterest, 
-     const OnRegisterFailed& onRegisterFailed, const ForwardingFlags& flags, WireFormat& wireFormat);
+     const OnRegisterFailed& onRegisterFailed, const ForwardingFlags& flags);
+
+  void
+  checkPitExpire();
+  
+private:
+  boost::asio::io_service ioService_;
+  boost::asio::deadline_timer timer_;
   
   ptr_lib::shared_ptr<Transport> transport_;
-  std::vector<ptr_lib::shared_ptr<PendingInterest> > pendingInterestTable_;
-  std::vector<ptr_lib::shared_ptr<RegisteredPrefix> > registeredPrefixTable_;
+
+  PendingInterestTable pendingInterestTable_;
+  RegisteredPrefixTable registeredPrefixTable_;
   Interest ndndIdFetcherInterest_;
-  Blob ndndId_;
+  Buffer ndndId_;
 };
 
-}
+} // namespace ndn
 
 #endif
diff --git a/include/ndn-cpp/transport/transport.hpp b/include/ndn-cpp/transport/transport.hpp
index 80d41b2..8bfa355 100644
--- a/include/ndn-cpp/transport/transport.hpp
+++ b/include/ndn-cpp/transport/transport.hpp
@@ -8,58 +8,88 @@
 #ifndef NDN_TRANSPORT_HPP
 #define NDN_TRANSPORT_HPP
 
+#include <ndn-cpp/common.hpp>
+
 #include <vector>
+#include <boost/asio.hpp>
 
 namespace ndn {
 
-class ElementListener;
-
 class Transport {
 public:
+  typedef ptr_lib::function<void (const Block &wire)> ReceiveCallback;
+  
+  inline
+  Transport();
+  
+  inline virtual
+  ~Transport();
+
   /**
    * Connect according to the info in ConnectionInfo, and processEvents() will use elementListener.
    * @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.
+   */
+  inline virtual void 
+  connect(boost::asio::io_service &io_service, const ReceiveCallback &receiveCallback);
+  
+  /**
+   * Close the connection.
    */
   virtual void 
-  connect(ElementListener& elementListener) = 0;
-  
+  close() = 0;
+
   /**
    * 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 uint8_t *data, size_t dataLength) = 0;
-  
-  inline void 
-  send(const std::vector<uint8_t>& data)
-  {
-    send(&data[0], data.size());
-  }
-  
-  /**
-   * Process any data to receive.  For each element received, call elementListener.onReceivedElement.
-   * This is non-blocking and will return immediately if there is no data to receive.
-   * You should normally not call this directly since it is called by Face.processEvents.
-   * @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;
+  send(const Block &wire) = 0;
 
-  virtual bool 
-  getIsConnected() = 0;
+  inline bool 
+  isConnected();
+
+protected:
+  inline void
+  receive(const Block &wire);
   
-  /**
-   * Close the connection.  This base class implementation does nothing, but your derived class can override.
-   */
-  virtual void 
-  close();
-  
-  virtual ~Transport();
+protected:
+  boost::asio::io_service *ioService_;
+  bool isConnected_;
+  ReceiveCallback receiveCallback_;
 };
 
+inline
+Transport::Transport()
+  : ioService_(0)
+  , isConnected_(false)
+{
+}
+
+inline
+Transport::~Transport()
+{
+}
+
+inline void 
+Transport::connect(boost::asio::io_service &ioService, const ReceiveCallback &receiveCallback)
+{
+  ioService_ = &ioService;
+  receiveCallback_ = receiveCallback;
+}
+
+inline bool 
+Transport::isConnected()
+{
+  return isConnected_;
+}
+
+inline void
+Transport::receive(const Block &wire)
+{
+  receiveCallback_(wire);
+}
+
 }
 
 #endif
diff --git a/include/ndn-cpp/transport/unix-transport.hpp b/include/ndn-cpp/transport/unix-transport.hpp
index bb77bb4..1cc4758 100644
--- a/include/ndn-cpp/transport/unix-transport.hpp
+++ b/include/ndn-cpp/transport/unix-transport.hpp
@@ -13,49 +13,24 @@
 
 namespace ndn {
   
-class UnixTransport : public Transport {
+class UnixTransport : public Transport
+{
 public:
   UnixTransport(const std::string &unixSocket = "/tmp/.ndnd.sock");
   ~UnixTransport();
 
-  /**
-   * Connect according to the info in ConnectionInfo, and processEvents() will use elementListener.
-   * @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.
-   */
+  // from Transport
   virtual void 
-  connect(ElementListener& elementListener);
+  connect(boost::asio::io_service &ioService, const ReceiveCallback &receiveCallback);
   
-  /**
-   * 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 uint8_t *data, size_t dataLength);
-
-  /**
-   * Process any data to receive.  For each element received, call elementListener.onReceivedElement.
-   * This is non-blocking and will return immediately if there is no data to receive.
-   * You should normally not call this directly since it is called by Face.processEvents.
-   * @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 bool 
-  getIsConnected();
-
-  /**
-   * Close the connection to the host.
-   */
   virtual void 
   close();
+
+  virtual void 
+  send(const Block &wire);
   
 private:
   std::string unixSocket_;
-  bool isConnected_;
 
   class Impl;
   std::auto_ptr<Impl> impl_;
