diff --git a/src/mgmt/management-tool.cpp b/src/mgmt/management-tool.cpp
index 6dd2cb9..dc3f971 100644
--- a/src/mgmt/management-tool.cpp
+++ b/src/mgmt/management-tool.cpp
@@ -34,6 +34,7 @@
 #include <ndn-cxx/util/indented-stream.hpp>
 #include <ndn-cxx/encoding/oid.hpp>
 #include <ndn-cxx/security/cryptopp.hpp>
+#include <ndn-cxx/link.hpp>
 
 namespace ndn {
 namespace ndns {
@@ -196,99 +197,8 @@
 }
 
 void
-ManagementTool::addRrSet(const Name& zoneName,
-                         const Name& label,
-                         const name::Component& type,
-                         NdnsType ndnsType,
-                         const uint64_t version,
-                         const std::vector<std::string>& contents,
-                         const Name& inputDskCertName,
-                         const time::seconds& ttl)
+ManagementTool::addRrset(Rrset& rrset)
 {
-  // check pre-condition
-  Zone zone(zoneName);
-  if (!m_dbMgr.find(zone)) {
-    throw Error(zoneName.toUri() + " is not presented in the NDNS db");
-  }
-
-  if (ndnsType == NDNS_UNKNOWN) {
-    throw Error("The ndns type is unknown");
-  }
-
-  if (type == label::CERT_RR_TYPE) {
-    throw Error("It cannot handle ID-CERT rrset type");
-  }
-
-  // check strange rr type and ndns type combination
-  if (type == label::NS_RR_TYPE && ndnsType == NDNS_RAW) {
-    throw Error("NS cannot be of the type NDNS_RAW");
-  }
-
-  if (type == label::TXT_RR_TYPE && ndnsType != NDNS_RESP) {
-    throw Error("TXT cannot be of the type NDNS_RAW or NDNS_AUTH");
-  }
-
-  if (ndnsType == NDNS_RAW && contents.size() != 1) {
-    throw Error("NDNS_RAW must contain a single content element");
-  }
-
-  Name dskName;
-  Name dskCertName = inputDskCertName;
-  if (dskCertName == DEFAULT_CERT) {
-    dskName = m_keyChain.getDefaultKeyNameForIdentity(zoneName);
-    dskCertName = m_keyChain.getDefaultCertificateNameForKey(dskName);
-  }
-  else {
-    if (!matchCertificate(dskCertName, zoneName)) {
-      throw Error("Cannot verify certificate");
-    }
-  }
-
-  time::seconds actualTtl = ttl;
-  if (ttl == DEFAULT_RR_TTL)
-    actualTtl = zone.getTtl();
-
-  // set rrset
-  Rrset rrset(&zone);
-  rrset.setLabel(label);
-  rrset.setType(type);
-  rrset.setTtl(actualTtl);
-
-  // set response
-  Response re;
-  re.setZone(zoneName);
-  re.setQueryType(label::NDNS_ITERATIVE_QUERY);
-  re.setRrLabel(label);
-  re.setRrType(type);
-  re.setNdnsType(ndnsType);
-  re.setFreshnessPeriod(actualTtl);
-
-  //set content according to ndns type
-  if (ndnsType == NDNS_RAW) {
-    Block tmp = makeBinaryBlock(ndn::tlv::Content, contents[0].c_str(), contents[0].length());
-    re.setAppContent(tmp);
-  }
-  else if (ndnsType != NDNS_AUTH) {
-    if (contents.empty()) {
-      re.addRr("");
-    }
-    else {
-      for (const auto& item : contents) {
-        re.addRr(item);
-      }
-    }
-  }
-
-  if (version != VERSION_USE_UNIX_TIMESTAMP) {
-    name::Component tmp = name::Component::fromVersion(version);
-    re.setVersion(tmp);
-  }
-  shared_ptr<Data> data = re.toData();
-  m_keyChain.sign(*data, dskCertName);
-
-  rrset.setVersion(re.getVersion());
-  rrset.setData(data->wireEncode());
-
   checkRrsetVersion(rrset);
   NDNS_LOG_INFO("Added " << rrset);
   m_dbMgr.insert(rrset);
@@ -439,7 +349,7 @@
                       1 : re.getRrs().size();
     const std::vector<Block> &rrs = re.getRrs();
 
-    if (re.getNdnsType() != NDNS_RAW && re.getNdnsType() != NDNS_AUTH) {
+    if (re.getNdnsType() != NDNS_RAW) {
       os << "; rrset=" << rrset.getLabel().toUri()
          << " type=" << rrset.getType().toUri()
          << " version=" << rrset.getVersion().toUri()
@@ -458,14 +368,26 @@
       os.width(typeWidth + 2);
       os << rrset.getType().toUri();
 
-      if (re.getNdnsType() != NDNS_RAW && re.getNdnsType() != NDNS_AUTH) {
+      if (re.getNdnsType() != NDNS_RAW) {
         using namespace CryptoPP;
         if (rrset.getType() == label::TXT_RR_TYPE) {
           os.write(reinterpret_cast<const char*>(rrs[i].value()), rrs[i].value_size());
           os << std::endl;
         }
         else if (rrset.getType() == label::NS_RR_TYPE) {
-          //TODO output the NS data once we have it
+          BOOST_ASSERT(iteration == 1);
+          if (re.getNdnsType() == NDNS_AUTH) {
+            const std::string authStr = "NDNS-Auth";
+            os << authStr;
+          } else {
+            Link link(rrset.getData());
+            const Link::DelegationSet& ds = link.getDelegations();
+            for (const auto& i: ds) {
+              std::string str = boost::lexical_cast<std::string>(i.first)
+                + "," + i.second.toUri() + ";";
+              os << str;
+            }
+          }
           os << std::endl;
         }
         else {
@@ -475,7 +397,7 @@
       }
     }
 
-    if (re.getNdnsType() == NDNS_RAW || re.getNdnsType() == NDNS_AUTH) {
+    if (re.getNdnsType() == NDNS_RAW) {
       os.width();
       os << "; content-type=" << re.getNdnsType()
          << " version=" << rrset.getVersion().toUri()
diff --git a/src/mgmt/management-tool.hpp b/src/mgmt/management-tool.hpp
index 576913b..d41bd2b 100644
--- a/src/mgmt/management-tool.hpp
+++ b/src/mgmt/management-tool.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014, Regents of the University of California.
+ * Copyright (c) 2014-2016, Regents of the University of California.
  *
  * This file is part of NDNS (Named Data Networking Domain Name Service).
  * See AUTHORS.md for complete list of NDNS authors and contributors.
@@ -126,31 +126,6 @@
 
   /** @brief add rrset to the NDNS local database
    *
-   *  This one is only capable of adding NS type including NDNS_RESP and NDNS_AUTH and user defined
-   *  type with string content.
-   *  Other complicated situations can be handled by the other addRrSet() overload function.
-   *
-   *  @param zoneName the name of the zone to hold the rrset
-   *  @param label the rrset label
-   *  @param type the rrset type
-   *  @param ndnsType the ndnsType of the response, for user-defined type, just set it NDNS_RAW
-   *  @param version the version of the response and rrset, default is Unix Timestamp
-   *  @param contents the content of the response
-   *  @param dskCertName the DSK to signed the response, default is the zone's DSK
-   *  @param ttl the ttl of the rrset
-   */
-  void
-  addRrSet(const Name& zoneName,
-           const Name& label,
-           const name::Component& type,
-           NdnsType ndnsType,
-           const uint64_t version = VERSION_USE_UNIX_TIMESTAMP,
-           const std::vector<std::string>& contents = DEFAULT_CONTENTS,
-           const Name& dskCertName = DEFAULT_CERT,
-           const time::seconds& ttl = DEFAULT_RR_TTL);
-
-  /** @brief add rrset to the NDNS local database
-   *
    *  This overload is capable of adding any data to the rrset as long as the supplied data is
    *  valid.
    *  A special case is to add the ID-CERT of KSK to the parent zone. At this case, the SS cert
@@ -170,6 +145,13 @@
            const Name& dskCertName = DEFAULT_CERT,
            const ndn::io::IoEncoding encoding = ndn::io::BASE64);
 
+  /** @brief add rrset to the NDNS local database
+   *
+   *  @param rrset rrset
+   */
+  void
+  addRrset(Rrset& rrset);
+
   /** @brief remove rrset from the NDNS local database
    *
    *  @param zoneName the name of the zone holding the rrset
