diff --git a/src/ccnx-pco.cpp b/src/ccnx-pco.cpp
index 1d83b26..dce3bcb 100644
--- a/src/ccnx-pco.cpp
+++ b/src/ccnx-pco.cpp
@@ -3,27 +3,15 @@
 namespace Ccnx {
 
 ParsedContentObject::ParsedContentObject(const unsigned char *data, size_t len)
+            : m_comps(NULL)
 {
-  ccn_indexbuf *comps = ccn_indexbuf_create();
-  ccn_parsed_ContentObject pco;
-  int res = ccn_parse_ContentObject(data, len, &pco, comps);
+  m_comps = ccn_indexbuf_create();
+  int res = ccn_parse_ContentObject(data, len, &m_pco, m_comps);
   if (res < 0)
   {
     boost::throw_exception(MisformedContentObjectException());
   }
-
-  const unsigned char *content;
-  size_t length;
-  res = ccn_content_get_value(data, pco.offset[CCN_PCO_E], &pco, &content, &length);
-  if (res < 0)
-  {
-    boost::throw_exception(MisformedContentObjectException());
-  }
-  readRaw(m_content, content, length);
-
-  m_name = Name(data, comps);
-  cout << "in Constructor: name " << m_name << endl;
-  cout << "content : " << string((const char *)&m_content[0], m_content.size()) << endl;
+  readRaw(m_bytes, data, len);
 }
 
 ParsedContentObject::ParsedContentObject(const Bytes &bytes)
@@ -33,26 +21,35 @@
 
 ParsedContentObject::ParsedContentObject(const ParsedContentObject &other)
 {
-  m_content = other.m_content;
-  m_name = other.m_name;
+  ParsedContentObject(other.m_bytes);
 }
 
 ParsedContentObject::~ParsedContentObject()
 {
+  ccn_indexbuf_destroy(&m_comps);
+  m_comps = NULL;
 }
 
 Bytes
 ParsedContentObject::content() const
 {
-  cout << "content() : " << string((const char *)&m_content[0], m_content.size()) << endl;
-  return m_content;
+  const unsigned char *content;
+  size_t len;
+  Bytes bytes;
+  int res = ccn_content_get_value(head(m_bytes), m_pco.offset[CCN_PCO_E], &m_pco, &content, &len);
+  if (res < 0)
+  {
+    boost::throw_exception(MisformedContentObjectException());
+  }
+
+  readRaw(bytes, content, len);
+  return bytes;
 }
 
 Name
 ParsedContentObject::name() const
 {
-  cout <<"name() : " << m_name << endl;
-  return m_name;
+  return Name(head(m_bytes), m_comps);
 }
 
 }
