diff --git a/src/rrset.cpp b/src/daemon/rrset.cpp
similarity index 100%
rename from src/rrset.cpp
rename to src/daemon/rrset.cpp
diff --git a/src/rrset.hpp b/src/daemon/rrset.hpp
similarity index 100%
rename from src/rrset.hpp
rename to src/daemon/rrset.hpp
diff --git a/src/zone.cpp b/src/daemon/zone.cpp
similarity index 97%
rename from src/zone.cpp
rename to src/daemon/zone.cpp
index 3c7fd1a..46a8bb1 100644
--- a/src/zone.cpp
+++ b/src/daemon/zone.cpp
@@ -23,8 +23,6 @@
 namespace ndn {
 namespace ndns {
 
-NDNS_LOG_INIT("Zone")
-
 Zone::Zone()
   : m_id(0)
   , m_ttl(3600)
diff --git a/src/zone.hpp b/src/daemon/zone.hpp
similarity index 100%
rename from src/zone.hpp
rename to src/daemon/zone.hpp
diff --git a/src/db-mgr.cpp b/src/db-mgr.cpp
deleted file mode 100644
index 691299e..0000000
--- a/src/db-mgr.cpp
+++ /dev/null
@@ -1,341 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, 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.
- *
- * NDNS is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NDNS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NDNS, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "db-mgr.hpp"
-#include "logger.hpp"
-
-#include <boost/algorithm/string/predicate.hpp>
-
-#include <iostream>
-#include <fstream>
-
-namespace ndn {
-namespace ndns {
-
-NDNS_LOG_INIT("DbMgr");
-
-static const std::string NDNS_SCHEMA = "\
-CREATE TABLE IF NOT EXISTS zones (      \n\
-  id    INTEGER NOT NULL PRIMARY KEY,   \n\
-  name  blob NOT NULL UNIQUE,           \n\
-  ttl   integer(10) NOT NULL);          \n\
-                                        \n\
-CREATE TABLE IF NOT EXISTS rrsets (     \n\
-  id      INTEGER NOT NULL PRIMARY KEY, \n\
-  zone_id integer(10) NOT NULL,         \n\
-  label   blob NOT NULL,                \n\
-  type    blob NOT NULL,                \n\
-  version blob NOT NULL,                \n\
-  ttl     integer(10) NOT NULL,         \n\
-  data    blob NOT NULL,                                                \n\
-  FOREIGN KEY(zone_id) REFERENCES zones(id) ON UPDATE Cascade ON DELETE Cascade); \n\
-                                                                        \n\
-CREATE UNIQUE INDEX rrsets_zone_id_label_type_version                   \n\
-  ON rrsets (zone_id, label, type, version);                            \n\
-";
-
-DbMgr::DbMgr(const std::string& dbFile/* = DEFAULT_CONFIG_PATH "/" "ndns.conf"*/)
-  : m_dbFile(dbFile)
-  , m_conn(0)
-  , m_status(DB_CLOSED)
-{
-  this->open();
-}
-
-
-DbMgr::~DbMgr()
-{
-  if (m_status != DB_CLOSED) {
-    this->close();
-  }
-}
-
-void
-DbMgr::open()
-{
-  if (m_status == DB_CONNECTED)
-    return;
-
-  int res = sqlite3_open_v2(m_dbFile.c_str(), &m_conn,
-                            SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE,
-#ifdef DISABLE_SQLITE3_FS_LOCKING
-                            "unix-dotfile"
-#else
-                            0
-#endif
-                            );
-
-  if (res != SQLITE_OK) {
-    m_err = "Cannot open the db file: " + m_dbFile;
-    NDNS_LOG_FATAL(m_err);
-    m_status = DB_ERROR;
-  }
-
-  // ignore any errors from DB creation (command will fail for the existing database, which is ok)
-  sqlite3_exec(m_conn, NDNS_SCHEMA.c_str(), 0, 0, 0);
-
-  m_status = DB_CONNECTED;
-}
-
-void
-DbMgr::close()
-{
-  if (m_status == DB_CLOSED)
-    return;
-
-  int ret = sqlite3_close(m_conn);
-  if (ret != SQLITE_OK) {
-    m_err = "Cannot close the db: " + m_dbFile;
-    NDNS_LOG_FATAL(m_err);
-    m_status = DB_ERROR;
-  }
-  m_status = DB_CLOSED;
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// Zone
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-void
-DbMgr::insert(Zone& zone)
-{
-  if (zone.getId() > 0)
-    return;
-
-  sqlite3_stmt* stmt;
-  const char* sql = "INSERT INTO zones (name, ttl) VALUES (?, ?)";
-  int rc = sqlite3_prepare_v2(m_conn, sql, -1, &stmt, 0);
-  if (rc != SQLITE_OK) {
-    throw PrepareError(sql);
-  }
-
-  const Block& zoneName = zone.getName().wireEncode();
-  sqlite3_bind_blob(stmt, 1, zoneName.wire(), zoneName.size(), SQLITE_STATIC);
-  sqlite3_bind_int(stmt,  2, zone.getTtl().count());
-
-  rc = sqlite3_step(stmt);
-  if (rc != SQLITE_DONE) {
-    sqlite3_finalize(stmt);
-    throw ExecuteError(sql);
-  }
-
-  zone.setId(sqlite3_last_insert_rowid(m_conn));
-  sqlite3_finalize(stmt);
-}
-
-bool
-DbMgr::find(Zone& zone)
-{
-  sqlite3_stmt* stmt;
-  const char* sql = "SELECT id, ttl FROM zones WHERE name=?";
-  int rc = sqlite3_prepare_v2(m_conn, sql, -1, &stmt, 0);
-  if (rc != SQLITE_OK) {
-    throw PrepareError(sql);
-  }
-
-  const Block& zoneName = zone.getName().wireEncode();
-  sqlite3_bind_blob(stmt, 1, zoneName.wire(), zoneName.size(), SQLITE_STATIC);
-
-  if (sqlite3_step(stmt) == SQLITE_ROW) {
-    zone.setId(sqlite3_column_int64(stmt, 0));
-    zone.setTtl(time::seconds(sqlite3_column_int(stmt, 1)));
-  } else {
-    zone.setId(0);
-  }
-
-  sqlite3_finalize(stmt);
-
-  return zone.getId() != 0;
-}
-
-void
-DbMgr::remove(Zone& zone)
-{
-  if (zone.getId() == 0)
-    return;
-
-  sqlite3_stmt* stmt;
-  const char* sql = "DELETE FROM zones where id=?";
-  int rc = sqlite3_prepare_v2(m_conn, sql, -1, &stmt, 0);
-  if (rc != SQLITE_OK) {
-    throw PrepareError(sql);
-  }
-
-  sqlite3_bind_int64(stmt, 1, zone.getId());
-
-  rc = sqlite3_step(stmt);
-  if (rc != SQLITE_DONE) {
-    sqlite3_finalize(stmt);
-    throw ExecuteError(sql);
-  }
-
-  sqlite3_finalize(stmt);
-
-  zone = Zone();
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// Rrset
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-void
-DbMgr::insert(Rrset& rrset)
-{
-  if (rrset.getId() != 0)
-    return;
-
-  if (rrset.getZone() == 0) {
-    throw RrsetError("Rrset has not been assigned to a zone");
-  }
-
-  if (rrset.getZone()->getId() == 0) {
-    insert(*rrset.getZone());
-  }
-
-  const char* sql =
-    "INSERT INTO rrsets (zone_id, label, type, version, ttl, data)"
-    "    VALUES (?, ?, ?, ?, ?, ?)";
-
-  sqlite3_stmt* stmt;
-  int rc = sqlite3_prepare_v2(m_conn, sql, -1, &stmt, 0);
-  if (rc != SQLITE_OK) {
-    throw PrepareError(sql);
-  }
-
-  sqlite3_bind_int64(stmt, 1, rrset.getZone()->getId());
-
-  const Block& label = rrset.getLabel().wireEncode();
-  sqlite3_bind_blob(stmt,  2, label.wire(),              label.size(),              SQLITE_STATIC);
-  sqlite3_bind_blob(stmt,  3, rrset.getType().wire(),    rrset.getType().size(),    SQLITE_STATIC);
-  sqlite3_bind_blob(stmt,  4, rrset.getVersion().wire(), rrset.getVersion().size(), SQLITE_STATIC);
-  sqlite3_bind_int64(stmt, 5, rrset.getTtl().count());
-  sqlite3_bind_blob(stmt,  6, rrset.getData().wire(),    rrset.getData().size(),    SQLITE_STATIC);
-
-  rc = sqlite3_step(stmt);
-  if (rc != SQLITE_DONE) {
-    sqlite3_finalize(stmt);
-    throw ExecuteError(sql);
-  }
-
-  rrset.setId(sqlite3_last_insert_rowid(m_conn));
-  sqlite3_finalize(stmt);
-}
-
-bool
-DbMgr::find(Rrset& rrset)
-{
-  if (rrset.getZone() == 0) {
-    throw RrsetError("Rrset has not been assigned to a zone");
-  }
-
-  if (rrset.getZone()->getId() == 0) {
-    bool isFound = find(*rrset.getZone());
-    if (!isFound) {
-      return false;
-    }
-  }
-
-  sqlite3_stmt* stmt;
-  const char* sql =
-    "SELECT id, ttl, version, data FROM rrsets"
-    "    WHERE zone_id=? and label=? and type=?";
-  int rc = sqlite3_prepare_v2(m_conn, sql, -1, &stmt, 0);
-
-  if (rc != SQLITE_OK) {
-    throw PrepareError(sql);
-  }
-
-  sqlite3_bind_int64(stmt, 1, rrset.getZone()->getId());
-
-  const Block& label = rrset.getLabel().wireEncode();
-  sqlite3_bind_blob(stmt, 2, label.wire(), label.size(), SQLITE_STATIC);
-  sqlite3_bind_blob(stmt, 3, rrset.getType().wire(), rrset.getType().size(), SQLITE_STATIC);
-
-  if (sqlite3_step(stmt) == SQLITE_ROW) {
-    rrset.setId(sqlite3_column_int64(stmt, 0));
-    rrset.setTtl(time::seconds(sqlite3_column_int64(stmt, 1)));
-    rrset.setVersion(Block(static_cast<const uint8_t*>(sqlite3_column_blob(stmt, 2)),
-                           sqlite3_column_bytes(stmt, 2)));
-    rrset.setData(Block(static_cast<const uint8_t*>(sqlite3_column_blob(stmt, 3)),
-                        sqlite3_column_bytes(stmt, 3)));
-  } else {
-    rrset.setId(0);
-  }
-  sqlite3_finalize(stmt);
-
-  return rrset.getId() != 0;
-}
-
-void
-DbMgr::remove(Rrset& rrset)
-{
-  if (rrset.getId() == 0)
-    throw RrsetError("Attempting to remove Rrset that has no assigned id");
-
-  sqlite3_stmt* stmt;
-  const char* sql = "DELETE FROM rrsets WHERE id=?";
-  int rc = sqlite3_prepare_v2(m_conn, sql, -1, &stmt, 0);
-
-  if (rc != SQLITE_OK) {
-    throw PrepareError(sql);
-  }
-
-  sqlite3_bind_int64(stmt, 1, rrset.getId());
-
-  rc = sqlite3_step(stmt);
-  if (rc != SQLITE_DONE) {
-    sqlite3_finalize(stmt);
-    throw ExecuteError(sql);
-  }
-
-  sqlite3_finalize(stmt);
-
-  rrset = Rrset(rrset.getZone());
-}
-
-void
-DbMgr::modify(Rrset& rrset)
-{
-  if (rrset.getId() == 0) {
-    throw RrsetError("Attempting to replace Rrset that has no assigned id");
-  }
-
-  if (rrset.getZone() == 0) {
-    throw RrsetError("Rrset has not been assigned to a zone");
-  }
-
-  sqlite3_stmt* stmt;
-  const char* sql = "UPDATE rrsets SET ttl=?, version=?, data=? WHERE id=?";
-  int rc = sqlite3_prepare_v2(m_conn, sql, -1, &stmt, 0);
-
-  if (rc != SQLITE_OK) {
-    throw PrepareError(sql);
-  }
-
-  sqlite3_bind_int64(stmt, 1, rrset.getTtl().count());
-  sqlite3_bind_blob(stmt,  2, rrset.getVersion().wire(), rrset.getVersion().size(), SQLITE_STATIC);
-  sqlite3_bind_blob(stmt,  3, rrset.getData().wire(),    rrset.getData().size(),    SQLITE_STATIC);
-  sqlite3_bind_int64(stmt, 4, rrset.getId());
-
-  sqlite3_step(stmt);
-  sqlite3_finalize(stmt);
-}
-
-} // namespace ndns
-} // namespace ndn
diff --git a/src/db-mgr.hpp b/src/db-mgr.hpp
deleted file mode 100644
index 29738be..0000000
--- a/src/db-mgr.hpp
+++ /dev/null
@@ -1,211 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, 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.
- *
- * NDNS is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NDNS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NDNS, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef NDNS_DB_MGR_HPP
-#define NDNS_DB_MGR_HPP
-
-#include "config.hpp"
-#include "zone.hpp"
-#include "rrset.hpp"
-
-#include <ndn-cxx/common.hpp>
-#include <sqlite3.h>
-
-namespace ndn {
-namespace ndns {
-
-#define DEFINE_ERROR(Name, Base)                \
-class Name : public Base                        \
-{                                               \
- public:                                        \
-  explicit                                      \
-  Name(const std::string& what)                 \
-    : Base(what)                                \
-  {                                             \
-  }                                             \
-};
-
-/**
- * @brief Database Manager, which provides some common DB functionalities
- *
- * @note Function naming here follows MongoDB
- */
-class DbMgr : noncopyable
-{
-public:
-  /**
-   * @brief The Database Status
-   */
-  enum DbStatus {
-    DB_CONNECTED,
-    DB_CLOSED,
-    DB_ERROR
-  };
-
-  DEFINE_ERROR(Error, std::runtime_error);
-  DEFINE_ERROR(PrepareError, Error);
-  DEFINE_ERROR(ExecuteError, Error);
-
-public:
-  /**
-   * @brief constructor
-   */
-  explicit
-  DbMgr(const std::string& dbFile = DEFAULT_CONFIG_PATH "/" "ndns.db");
-
-  /**
-   * @brief destructor
-   */
-  ~DbMgr();
-
-  /**
-   * @brief connect to the database
-   */
-  void
-  open();
-
-  /**
-   * @brief close the database connection
-   */
-  void
-  close();
-
-  /**
-   * @brief get error message
-   *
-   * only valid when some db-related error happens,
-   * such as db file does not exist, wrong SQL, etc
-   */
-  const std::string&
-  getErr() const
-  {
-    return m_err;
-  }
-
-  /**
-   * @brief get Database connection status
-   */
-  DbStatus
-  getStatus() const
-  {
-    return m_status;
-  }
-
-public: // Zone manipulation
-  DEFINE_ERROR(ZoneError, Error);
-
-  /**
-   * @brief insert the m_zone to the database, and set the zone's id.
-   * If the zone is already in the db, handle the exception without leaving it to upper level,
-   * meanwhile, set the zone's id too.
-   * @pre m_zone.getId() == 0
-   * @post m_zone.getId() > 0
-   */
-  void
-  insert(Zone& zone);
-
-  /**
-   * @brief lookup the zone by name, fill the m_id and m_ttl
-   * @post whatever the previous id is
-   * @return true if the record exist
-   */
-  bool
-  find(Zone& zone);
-
-  /**
-   * @brief remove the zone
-   * @pre m_zone.getId() > 0
-   * @post m_zone.getId() == 0
-   */
-  void
-  remove(Zone& zone);
-
-public: // Rrset manipulation
-  DEFINE_ERROR(RrsetError, Error);
-
-  /**
-   * @brief add the rrset
-   * @pre m_rrset.getId() == 0
-   * @post m_rrset.getId() > 0
-   */
-  void
-  insert(Rrset& rrset);
-
-  /**
-   * @brief get the data from db according to `m_zone`, `m_label`, `m_type`.
-   *
-   * If record exists, `m_ttl`, `m_version` and `m_data` is set
-   *
-   * @pre m_rrset.getZone().getId() > 0
-   * @post whatever the previous id is,
-   *       m_rrset.getId() > 0 if record exists, otherwise m_rrset.getId() == 0
-   * @return true if the record exist
-   */
-  bool
-  find(Rrset& rrset);
-
-  /**
-   * @brief remove the rrset
-   * @pre m_rrset.getId() > 0
-   * @post m_rrset.getId() == 0
-   */
-  void
-  remove(Rrset& rrset);
-
-  /**
-   * @brief replace ttl, version, and Data with new values
-   * @pre m_rrset.getId() > 0
-   */
-  void
-  modify(Rrset& rrset);
-
-private:
-  /**
-   * @brief set error message
-   *
-   * only valid when some db-related error happens,
-   * such as db file does not exist, wrong SQL, etc
-   */
-  void
-  setErr(const std::string& err)
-  {
-    this->m_err = err;
-  }
-
-  /**
-   * @brief set Database connection status
-   */
-  void
-  setStatus(DbStatus status)
-  {
-    this->m_status = status;
-  }
-
-private:
-  std::string m_dbFile;
-  sqlite3* m_conn;
-
-  std::string m_err;
-  DbStatus m_status;
-};
-
-} // namespace ndns
-} // namespace ndn
-
-#endif // NDNS_DB_MGR_HPP
diff --git a/src/ndns-enum.cpp b/src/ndns-enum.cpp
index efc1bbf..2631e38 100644
--- a/src/ndns-enum.cpp
+++ b/src/ndns-enum.cpp
@@ -32,8 +32,8 @@
     return "NDNS-Nack";
   case NDNS_AUTH:
     return "NDNS-Auth";
-  case NDNS_NULL:
-    return "NDNS-Null";
+  case NDNS_RAW:
+    return "NDNS-Raw";
   default:
     return "UNKNOWN";
   }
diff --git a/src/ndns-enum.hpp b/src/ndns-enum.hpp
index c2bee36..617be9c 100644
--- a/src/ndns-enum.hpp
+++ b/src/ndns-enum.hpp
@@ -29,7 +29,7 @@
  * @brief NdnsType defined in Response.NdnsMetaInfo.NdnsType
  */
 enum NdnsType {
-  NDNS_NULL = 0, ///< this is not a real type, just mean that MetaInfo does not contain NdnsType
+  NDNS_RAW = 0, ///< this is not a real type, just mean that MetaInfo does not contain NdnsType
   NDNS_RESP = 1, ///< response type means there are requested RR
   NDNS_NACK = 2, ///< no requested RR
   NDNS_AUTH = 3, ///< only has RR for detailed (longer) label
diff --git a/tests/unit/rrset.cpp b/tests/unit/daemon/rrset.cpp
similarity index 97%
rename from tests/unit/rrset.cpp
rename to tests/unit/daemon/rrset.cpp
index 735ff81..db51d27 100644
--- a/tests/unit/rrset.cpp
+++ b/tests/unit/daemon/rrset.cpp
@@ -17,8 +17,8 @@
  * NDNS, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include "rrset.hpp"
-#include "../boost-test.hpp"
+#include "daemon/rrset.hpp"
+#include "../../boost-test.hpp"
 
 #include <ndn-cxx/name.hpp>
 
diff --git a/tests/unit/zone.cpp b/tests/unit/daemon/zone.cpp
similarity index 96%
rename from tests/unit/zone.cpp
rename to tests/unit/daemon/zone.cpp
index 62dcb20..3d60cd2 100644
--- a/tests/unit/zone.cpp
+++ b/tests/unit/daemon/zone.cpp
@@ -17,8 +17,8 @@
  * NDNS, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include "zone.hpp"
-#include "../boost-test.hpp"
+#include "daemon/zone.hpp"
+#include "../../boost-test.hpp"
 
 #include <ndn-cxx/name.hpp>
 
diff --git a/tests/unit/db-mgr.cpp b/tests/unit/db-mgr.cpp
deleted file mode 100644
index 4116ffb..0000000
--- a/tests/unit/db-mgr.cpp
+++ /dev/null
@@ -1,190 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, 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.
- *
- * NDNS is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NDNS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NDNS, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "db-mgr.hpp"
-#include "../boost-test.hpp"
-
-#include <boost/filesystem.hpp>
-
-namespace ndn {
-namespace ndns {
-namespace tests {
-
-BOOST_AUTO_TEST_SUITE(DbMgr)
-
-static const boost::filesystem::path TEST_DATABASE = BUILDDIR "/tests/unit/db-mgr-ndns.db";
-
-class DbMgrFixture
-{
-public:
-  DbMgrFixture()
-    : session(TEST_DATABASE.string().c_str())
-  {
-  }
-
-  ~DbMgrFixture()
-  {
-    session.close();
-    boost::filesystem::remove(TEST_DATABASE);
-  }
-
-public:
-  ndns::DbMgr session;
-};
-
-
-BOOST_FIXTURE_TEST_CASE(Basic, DbMgrFixture)
-{
-  BOOST_CHECK_EQUAL(session.getStatus(), ndns::DbMgr::DB_CONNECTED);
-
-  session.close();
-  BOOST_CHECK_EQUAL(session.getStatus(), ndns::DbMgr::DB_CLOSED);
-
-  // reopen
-  session.open();
-  BOOST_CHECK_EQUAL(session.getStatus(), ndns::DbMgr::DB_CONNECTED);
-}
-
-BOOST_FIXTURE_TEST_CASE(Zones, DbMgrFixture)
-{
-  Zone zone1;
-  zone1.setName("/net");
-  zone1.setTtl(time::seconds(4600));
-  BOOST_CHECK_NO_THROW(session.insert(zone1));
-  BOOST_CHECK_GT(zone1.getId(), 0);
-
-  Zone zone2;
-  zone2.setName("/net");
-  session.find(zone2);
-  BOOST_CHECK_EQUAL(zone2.getId(), zone1.getId());
-  BOOST_CHECK_EQUAL(zone2.getTtl(), zone1.getTtl());
-
-  BOOST_CHECK_NO_THROW(session.insert(zone2)); // zone2 already has id.  Nothing to execute
-
-  zone2.setId(0);
-  BOOST_CHECK_THROW(session.insert(zone2), ndns::DbMgr::ExecuteError);
-
-  BOOST_CHECK_NO_THROW(session.remove(zone1));
-  BOOST_CHECK_EQUAL(zone1.getId(), 0);
-
-  // record shouldn't exist at this point
-  BOOST_CHECK_NO_THROW(session.find(zone2));
-  BOOST_CHECK_EQUAL(zone2.getId(), 0);
-}
-
-BOOST_FIXTURE_TEST_CASE(Rrsets, DbMgrFixture)
-{
-  Zone zone("/net");
-  Rrset rrset1(&zone);
-
-  // Add
-
-  rrset1.setLabel("/net/ksk-123");
-  rrset1.setType(name::Component("ID-CERT"));
-  rrset1.setVersion(name::Component::fromVersion(567));
-  rrset1.setTtl(time::seconds(4600));
-
-  static const std::string DATA1 = "SOME DATA";
-  rrset1.setData(dataBlock(ndn::tlv::Content, DATA1.c_str(), DATA1.size()));
-
-  BOOST_CHECK_EQUAL(rrset1.getId(), 0);
-  BOOST_CHECK_NO_THROW(session.insert(rrset1));
-  BOOST_CHECK_GT(rrset1.getId(), 0);
-  BOOST_CHECK_GT(rrset1.getZone()->getId(), 0);
-
-  // Lookup
-
-  Rrset rrset2(&zone);
-  rrset2.setLabel("/net/ksk-123");
-  rrset2.setType(name::Component("ID-CERT"));
-
-  bool isFound = false;
-  BOOST_CHECK_NO_THROW(isFound = session.find(rrset2));
-  BOOST_CHECK_EQUAL(isFound, true);
-
-  BOOST_CHECK_EQUAL(rrset2.getId(),      rrset1.getId());
-  BOOST_CHECK_EQUAL(rrset2.getLabel(),   rrset1.getLabel());
-  BOOST_CHECK_EQUAL(rrset2.getType(),    rrset1.getType());
-  BOOST_CHECK_EQUAL(rrset2.getVersion(), rrset1.getVersion());
-  BOOST_CHECK_EQUAL(rrset2.getTtl(),     rrset1.getTtl());
-  BOOST_CHECK(rrset2.getData() == rrset1.getData());
-
-  // Replace
-
-  rrset1.setVersion(name::Component::fromVersion(890));
-  static const std::string DATA2 = "ANOTHER DATA";
-  rrset1.setData(dataBlock(ndn::tlv::Content, DATA2.c_str(), DATA2.size()));
-
-  BOOST_CHECK_NO_THROW(session.modify(rrset1));
-
-  rrset2 = Rrset(&zone);
-  rrset2.setLabel("/net/ksk-123");
-  rrset2.setType(name::Component("ID-CERT"));
-
-  isFound = false;
-  BOOST_CHECK_NO_THROW(isFound = session.find(rrset2));
-  BOOST_CHECK_EQUAL(isFound, true);
-
-  BOOST_CHECK_EQUAL(rrset2.getId(),      rrset1.getId());
-  BOOST_CHECK_EQUAL(rrset2.getLabel(),   rrset1.getLabel());
-  BOOST_CHECK_EQUAL(rrset2.getType(),    rrset1.getType());
-  BOOST_CHECK_EQUAL(rrset2.getVersion(), rrset1.getVersion());
-  BOOST_CHECK_EQUAL(rrset2.getTtl(),     rrset1.getTtl());
-  BOOST_CHECK(rrset2.getData() == rrset1.getData());
-
-  // Remove
-
-  BOOST_CHECK_NO_THROW(session.remove(rrset1));
-
-  rrset2 = Rrset(&zone);
-  rrset2.setLabel("/net/ksk-123");
-  rrset2.setType(name::Component("ID-CERT"));
-
-  isFound = false;
-  BOOST_CHECK_NO_THROW(isFound = session.find(rrset2));
-  BOOST_CHECK_EQUAL(isFound, false);
-
-  // Check error handling
-
-  rrset1 = Rrset();
-  BOOST_CHECK_THROW(session.insert(rrset1),  ndns::DbMgr::RrsetError);
-  BOOST_CHECK_THROW(session.find(rrset1),  ndns::DbMgr::RrsetError);
-
-  rrset1.setId(1);
-  BOOST_CHECK_THROW(session.modify(rrset1), ndns::DbMgr::RrsetError);
-
-  rrset1.setId(0);
-  rrset1.setZone(&zone);
-  BOOST_CHECK_THROW(session.modify(rrset1), ndns::DbMgr::RrsetError);
-
-  BOOST_CHECK_THROW(session.remove(rrset1),  ndns::DbMgr::RrsetError);
-
-  rrset1.setId(1);
-  BOOST_CHECK_NO_THROW(session.remove(rrset1));
-
-  rrset1.setZone(0);
-  rrset1.setId(1);
-  BOOST_CHECK_NO_THROW(session.remove(rrset1));
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-} // namespace ndns
-} // namespace ndn
diff --git a/tests/unit/ndns-enum.cpp b/tests/unit/ndns-enum.cpp
index c396b6b..7559448 100644
--- a/tests/unit/ndns-enum.cpp
+++ b/tests/unit/ndns-enum.cpp
@@ -31,7 +31,7 @@
   BOOST_CHECK_EQUAL(toString(NDNS_RESP), "NDNS-Resp");
   BOOST_CHECK_EQUAL(toString(NDNS_AUTH), "NDNS-Auth");
   BOOST_CHECK_EQUAL(toString(NDNS_NACK), "NDNS-Nack");
-  BOOST_CHECK_EQUAL(toString(NDNS_NULL), "NDNS-Null");
+  BOOST_CHECK_EQUAL(toString(NDNS_RAW), "NDNS-Raw");
 
   BOOST_CHECK_EQUAL(toString(static_cast<NdnsType>(254)), "UNKNOWN");
   BOOST_CHECK_EQUAL(toString(static_cast<NdnsType>(255)), "UNKNOWN");
