diff --git a/docs/conf.py b/docs/conf.py
index 0dc99d2..f3fec93 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -12,8 +12,9 @@
 # All configuration values have a default; values that are commented out
 # serve to show the default.
 
-import sys
+import datetime
 import os
+import sys
 
 # If extensions (or modules to document with autodoc) are in another directory,
 # add these directories to sys.path here. If the directory is relative to the
@@ -62,7 +63,7 @@
 
 # General information about the project.
 project = u'NFD - Named Data Networking Forwarding Daemon'
-copyright = u'2014-2016, Named Data Networking Project'
+copyright = u'2014-%d, Named Data Networking Project' % datetime.date.today().year
 
 # The version info for the project you're documenting, acts as replacement for
 # |version| and |release|, also used in various other places throughout the
@@ -241,21 +242,21 @@
 # (source start file, name, description, authors, manual section).
 man_pages = [
     ('manpages/nfd', 'nfd', u'Named Data Networking Forwarding Daemon', None, 1),
+    ('manpages/nfdc', 'nfdc', u'interact with NFD management', None, 1),
+    ('manpages/nfdc-status', 'nfdc-status', u'show NFD status', None, 1),
+    ('manpages/nfdc-face', 'nfdc-face', u'show and manipulate NFD faces', None, 1),
+    ('manpages/nfdc-route', 'nfdc-route', u'show and manipulate NFD routes', None, 1),
+    ('manpages/nfdc-strategy', 'nfdc-strategy', u'show and manipulate NFD strategy choices', None, 1),
+    ('manpages/nfd-status', 'nfd-status', u'comprehensive report of NFD status', None, 1),
+    ('manpages/nfd-status-http-server', 'nfd-status-http-server',
+        u'NFD status HTTP server', None, 1),
     ('manpages/ndn-autoconfig-server', 'ndn-autoconfig-server',
         u'NDN auto-configuration server', None, 1),
     ('manpages/ndn-autoconfig', 'ndn-autoconfig',
         u'NDN auto-configuration client', None, 1),
     ('manpages/ndn-autoconfig.conf', 'ndn-autoconfig.conf',
         u'NDN auto-configuration client configuration file', None, 5),
-    ('manpages/nfdc', 'nfdc', u'show / manipulate NFD state and configuration', None, 1),
-    ('manpages/nfdc-status', 'nfdc-status', u'show NFD status', None, 1),
-    ('manpages/nfdc-face', 'nfdc-face', u'show and manipulate NFD faces', None, 1),
-    ('manpages/nfdc-route', 'nfdc-route', u'show and manipulate NFD routes', None, 1),
-    ('manpages/nfdc-strategy', 'nfdc-strategy', u'show and manipulate NFD strategy choices', None, 1),
     ('manpages/nfd-autoreg', 'nfd-autoreg', u'NFD Auto-registration Server', None, 1),
-    ('manpages/nfd-status-http-server', 'nfd-status-http-server',
-        u'NFD status HTTP server', None, 1),
-    ('manpages/nfd-status', 'nfd-status', u'Command-line utility to show NFD status', None, 1),
 ]
 
 
diff --git a/docs/manpages/nfd-status.rst b/docs/manpages/nfd-status.rst
index 732cd86..f140483 100644
--- a/docs/manpages/nfd-status.rst
+++ b/docs/manpages/nfd-status.rst
@@ -1,56 +1,14 @@
 nfd-status
 ==========
 
-Usage
------
+SYNOPSIS
+--------
+| nfd-status
 
-::
-
-    nfd-status
-
-Description
+DESCRIPTION
 -----------
+**nfd-status** is an alias of **nfdc status report**, which prints a comprehensive report of NFD status.
 
-``nfd-status`` is an alias of ``nfdc status report``, which generates a comprehensive report of NFD status.
-
-Deprecated Options
-------------------
-
-nfd-status used to support the following command line options.
-They have been deprecated and will be removed in a future release of NFD.
-
-``-v``
-  Print general status. Use ``nfdc status show`` instead.
-
-``-c``
-  Print channel list. Use ``nfdc channel list`` instead.
-
-``-f``
-  Print face list. Use ``nfdc face list`` instead.
-
-``-b``
-  Print FIB entries. Use ``nfdc fib list`` instead.
-
-``-r``
-  Print RIB entries. Use ``nfdc route list`` instead.
-
-``-s``
-  Print strategy choices. Use ``nfdc strategy list`` instead.
-
-``-x``
-  Generate a comprehensive report of NFD status in XML format. Use ``nfdc status report xml`` instead.
-
-``-h``
-  Print usage information.
-
-``-V``
-  Show version information of nfd-status and exit.
-
-Exit Codes
-----------
-
-0: Success
-
-1: An unspecified error occurred
-
-2: Malformed command line
+SEE ALSO
+--------
+nfdc-status(1)
diff --git a/docs/manpages/nfdc-status.rst b/docs/manpages/nfdc-status.rst
index c5bdede..cfbdec4 100644
--- a/docs/manpages/nfdc-status.rst
+++ b/docs/manpages/nfdc-status.rst
@@ -11,7 +11,7 @@
 The **nfdc status show** command shows general status of NFD, including its version,
 uptime, data structure counters, and global packet counters.
 
-The **nfdc status report** command generates a comprehensive report of NFD status, including:
+The **nfdc status report** command prints a comprehensive report of NFD status, including:
 
 - general status (individually available from **nfdc status show**)
 - list of channels (individually available from **nfdc channel list**)
diff --git a/docs/manpages/nfdc.rst b/docs/manpages/nfdc.rst
index c6fb3b8..406bf35 100644
--- a/docs/manpages/nfdc.rst
+++ b/docs/manpages/nfdc.rst
@@ -1,206 +1,48 @@
 nfdc
 ====
 
-Usage
------
-
-::
-
-    nfdc [-h] COMMAND [<command options>]
-
-
-Description
------------
-
-``nfdc`` is a tool to manipulate routing information base (RIB), forwarding information
-base (FIB), and StrategyChoices table (i.e., which strategy should be used by which
-namespaces).
-
-Options
--------
-
-``-h``
-  Print usage information.
-
-``COMMAND``
-
-  ``register``
-    Register a new or update existing routing entry in Routing Information Base (RIB).
-
-    ``register [-I] [-C] [-c <cost>] [-e expiration time] [-o origin] <prefix> <faceId | faceUri>``
-
-      ``-I``
-        Unset CHILD_INHERIT flag from the routing entry.
-
-      ``-C``
-        Set CAPTURE flag in the routing entry.
-
-      ``-c <cost>``
-        Cost for the RIB entry (default is 0).
-
-      ``-e <expiration time>``
-        Expiration time of the RIB entry in milliseconds. If not specified, the entry remains in FIB
-        for the lifetime of the associated face.
-
-      ``-o <origin>``
-        Origin of the registration request (default is 255).
-        0 for Local producer applications, 128 for NLSR, 255 for static routes.
-
-      ``prefix``
-        A prefix of an existing or to be created RIB entry, for which routing entry is
-        requested to be added or updated.
-
-      ``faceId``
-        An existing NFD Face ID number, which can be obtained, for example, using
-        ``nfd-status`` command.
-
-      ``faceUri``
-        URI of the existing or to be created Face.
-
-  ``unregister``
-    Unregister an existing routing entry from Routing Information Base (RIB).
-
-    ``unregister [-o origin] <prefix> <faceId>``
-
-      ``-o <origin>``
-        Origin of the unregistration request (default is 255).
-
-      ``prefix``
-        A prefix of an existing RIB entry, from which routing entry is requested to be
-        removed.
-
-      ``faceId``
-        An existing NFD Face ID number, which can be obtained, for example, using
-        ``nfd-status`` command.
-
-  ``create``
-    Create a UDP unicast or TCP Face
-
-    ``create [-P] <faceUri>``
-
-      ``-P``
-        create permanent (instead of persistent) face:
-
-        .. note::
-          Persistent (default) faces remain open until they are explicitly destroyed or
-          there is a transport failure.  Permanent faces remain open until they are
-          explicitly destroyed; any transport failures will be recovered internally.
-
-      ``faceUri``
-        UDP unicast or TCP Face URI::
-
-            UDP unicast:    udp[4|6]://<remote-IP-or-host>[:<remote-port>]
-            TCP:            tcp[4|6]://<remote-IP-or-host>[:<remote-port>]
-
-  ``destroy``
-    Create an existing UDP unicast or TCP Face.
-
-    ``destroy <faceId | faceUri>``
-
-      ``faceId``
-        An existing NFD Face ID number, which can be obtained, for example, using
-        ``nfd-status`` command.
-
-      ``faceUri``
-        UDP unicast or TCP Face URI::
-
-            UDP unicast:    udp[4|6]://<remote-IP-or-host>[:<remote-port>]
-            TCP:            tcp[4|6]://<remote-IP-or-host>[:<remote-port>]
-
-  ``set-strategy``
-    Select strategy to be used for the specified namespace
-
-    ``set-strategy <namespace> <strategy-name>``
-
-      ``namespace``
-        Namespace that will use the specified strategy.
-
-        Note that more specific namespace(s) can use different strategy or strategies.
-        For example, if namespace ``/A/B/C`` was using strategy
-        ``ndn:/localhost/nfd/strategy/best-route`` before running ``set-strategy`` on
-        ``/A`` namespace, it will continue using the same strategy no matter which
-        namespace was specified for ``/A``.
-
-      ``strategy-name``
-        Name of one of the available strategies.
-
-        Currently, NFD supports the following strategies::
-
-            ndn:/localhost/nfd/strategy/best-route
-            ndn:/localhost/nfd/strategy/multicast
-            ndn:/localhost/nfd/strategy/client-control
-            ndn:/localhost/nfd/strategy/ncc
-            ndn:/localhost/nfd/strategy/access
-
-  ``unset-strategy``
-    Unset the strategy for a given ``namespace``.
-
-    Effectively, this command select parent's namespace strategy to be used for the
-    specified ``namespace``.
-
-    ``unset-strategy <namespace>``
-
-      ``namespace``
-        Namespace from which namespace customization should be removed.
-
-  ``add-nexthop``
-    Directly add nexthop entry info NFD's Forwarding Information Base (FIB).  This command
-    is intended only for debugging purposes.  Normally, prefix-nexhop association should
-    be registered in Routing Information Base using ``register`` command.
-
-    ``add-nexthop [-c <cost>] <prefix> <faceId | faceUri>``
-
-      ``-c <cost>``
-        Cost for the nexthop entry to be inserted (default is 0).
-
-      ``prefix``
-        A prefix of an existing or to be created FIB entry, to which nexthop
-        entry is requested to be added.
-
-      ``faceId``
-        An existing NFD Face ID number, which can be obtained, for example, using
-        ``nfd-status`` command
-
-      ``faceUri``
-        URI of the existing or to be created Face.
-
-  ``remove-nexthop``
-    Directly remove nexthop entry from NFD'S FIB.  This command
-    is intended only for debugging purposes.  Normally, prefix-nexhop association should
-    be unregistered from Routing Information Base using ``unregister`` command.
-
-    ``remove-nexthop <prefix> <faceId>``
-
-      ``prefix``
-        A prefix of an existing FIB entry, from which nexthop entry is requested to be removed.
-
-      ``faceId``
-        An existing NFD Face ID number, which can be obtained, for example, using
-        ``nfd-status`` command.
-
-        Note that when ``faceId`` is the last Face associated with ``prefix`` FIB entry,
-        the whole FIB entry will be removed.
-
-Exit Codes
-----------
-
-0: Success
-
-1: An unspecified error occurred
-
-2: Malformed command line
-
-Examples
+SYNOPSIS
 --------
+| nfdc COMMAND ARGUMENTS
+| nfdc [-h]
+| nfdc -V
+| nfdc help COMMAND
 
-Add a namespace to a face uri:
+DESCRIPTION
+-----------
+**nfdc** is a tool to manage a running instance of NFD.
 
+Features of nfdc are organized into subcommands.
+To print a list of all subcommands, run **nfdc** without arguments.
+To show how to use a subcommand, run **nfdc help** followed by the subcommand name.
+
+OPTIONS
+-------
+<COMMAND>
+    A subcommand name.
+    It usually contains a noun and a verb.
+
+<ARGUMENTS>
+    Arguments to the subcommand.
+
+-h
+    Print a list of available subcommands.
+
+-V
+    Print version number.
+
+EXAMPLES
+--------
+Print a list of all subcommands:
 ::
 
-    nfdc register ndn:/app1/video udp://192.168.1.2
+    $ nfdc
 
-Set strategy to a name:
-
+Show how to use ``nfdc face create`` command:
 ::
 
-    nfdc set-strategy ndn:/app1/video ndn:/localhost/nfd/strategy/broadcast
+    $ nfdc help face create
+
+SEE ALSO
+--------
+nfdc-status(1), nfdc-face(1), nfdc-route(1), nfdc-strategy(1)
diff --git a/tools/nfd-status.sh b/tools/nfd-status.sh
index 6b9336e..f306b9d 100755
--- a/tools/nfd-status.sh
+++ b/tools/nfd-status.sh
@@ -1,9 +1,2 @@
 #!@BASH@
-if [[ $# -gt 0 ]]; then
-  echo 'nfd-status command line options are deprecated.' >&2
-  echo 'Use the `nfdc` subcommands instead. See `nfdc help` for details.' >&2
-  exec "$(dirname "$0")/nfdc" legacy-nfd-status "$@"
-else
-  # nfd-status is an alias of `nfdc status report`
-  exec "$(dirname "$0")/nfdc" status report
-fi
+exec "$(dirname "$0")/nfdc" status report
diff --git a/tools/nfdc/available-commands.cpp b/tools/nfdc/available-commands.cpp
index 0d4847f..272c13d 100644
--- a/tools/nfdc/available-commands.cpp
+++ b/tools/nfdc/available-commands.cpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2017,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
@@ -26,8 +26,6 @@
 #include "available-commands.hpp"
 #include "face-module.hpp"
 #include "help.hpp"
-#include "legacy-nfdc.hpp"
-#include "legacy-status.hpp"
 #include "rib-module.hpp"
 #include "status.hpp"
 #include "strategy-choice-module.hpp"
@@ -44,35 +42,6 @@
   FaceModule::registerCommands(parser);
   RibModule::registerCommands(parser);
   StrategyChoiceModule::registerCommands(parser);
-
-  registerLegacyStatusCommand(parser);
-
-  struct LegacyNfdcCommandDefinition
-  {
-    std::string subcommand;
-    std::string title;
-    std::string replacementCommand; ///< replacement for deprecated legacy subcommand
-  };
-  const std::vector<LegacyNfdcCommandDefinition> legacyNfdcSubcommands{
-    {"register", "register a prefix", "route add"},
-    {"unregister", "unregister a prefix", "route remove"},
-    {"create", "create a face", "face create"},
-    {"destroy", "destroy a face", "face destroy"},
-    {"set-strategy", "set strategy choice on namespace", "strategy set"},
-    {"unset-strategy", "unset strategy choice on namespace", "strategy unset"},
-    {"add-nexthop", "add FIB nexthop", "route add"},
-    {"remove-nexthop", "remove FIB nexthop", "route remove"}
-  };
-  for (const LegacyNfdcCommandDefinition& lncd : legacyNfdcSubcommands) {
-    CommandDefinition def(lncd.subcommand, "");
-    def.setTitle(lncd.title);
-    def.addArg("args", ArgValueType::ANY, Required::NO, Positional::YES);
-    auto modes = AVAILABLE_IN_ONE_SHOT | AVAILABLE_IN_HELP;
-    if (!lncd.replacementCommand.empty()) {
-      modes = modes & ~AVAILABLE_IN_HELP;
-    }
-    parser.addCommand(def, bind(&legacyNfdcMain, _1, lncd.replacementCommand), modes);
-  }
 }
 
 } // namespace nfdc
diff --git a/tools/nfdc/command-parser.cpp b/tools/nfdc/command-parser.cpp
index b4c4558..74c5202 100644
--- a/tools/nfdc/command-parser.cpp
+++ b/tools/nfdc/command-parser.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2016,  Regents of the University of California,
+/*
+ * Copyright (c) 2014-2017,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -120,7 +120,7 @@
       i = m_commands.find({noun, "list"});
     }
     else {
-      // help, exit, quit, legacy nfdc commands
+      // help, exit, quit commands
       i = m_commands.find({noun, ""});
     }
     nameLen = std::min<size_t>(1, tokens.size());
diff --git a/tools/nfdc/face-id-fetcher.cpp b/tools/nfdc/face-id-fetcher.cpp
deleted file mode 100644
index f0bf841..0000000
--- a/tools/nfdc/face-id-fetcher.cpp
+++ /dev/null
@@ -1,203 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2014-2017,  Regents of the University of California,
- *                           Arizona Board of Regents,
- *                           Colorado State University,
- *                           University Pierre & Marie Curie, Sorbonne University,
- *                           Washington University in St. Louis,
- *                           Beijing Institute of Technology,
- *                           The University of Memphis.
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD 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.
- *
- * NFD 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
- * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "face-id-fetcher.hpp"
-
-#include <boost/lexical_cast.hpp>
-#include <boost/regex.hpp>
-
-#include <ndn-cxx/mgmt/nfd/face-query-filter.hpp>
-#include <ndn-cxx/mgmt/nfd/face-status.hpp>
-#include <ndn-cxx/security/validator-null.hpp>
-#include <ndn-cxx/util/segment-fetcher.hpp>
-
-namespace nfd {
-namespace tools {
-namespace nfdc {
-
-FaceIdFetcher::FaceIdFetcher(ndn::Face& face,
-                             ndn::nfd::Controller& controller,
-                             bool allowCreate,
-                             const SuccessCallback& onSucceed,
-                             const FailureCallback& onFail)
-  : m_face(face)
-  , m_controller(controller)
-  , m_allowCreate(allowCreate)
-  , m_onSucceed(onSucceed)
-  , m_onFail(onFail)
-{
-}
-
-void
-FaceIdFetcher::start(ndn::Face& face,
-                     ndn::nfd::Controller& controller,
-                     const std::string& input,
-                     bool allowCreate,
-                     const SuccessCallback& onSucceed,
-                     const FailureCallback& onFail)
-{
-  // 1. Try parse input as FaceId, if input is FaceId, succeed with parsed FaceId
-  // 2. Try parse input as FaceUri, if input is not FaceUri, fail
-  // 3. Canonize faceUri
-  // 4. If canonization fails, fail
-  // 5. Query for face
-  // 6. If query succeeds and finds a face, succeed with found FaceId
-  // 7. Create face
-  // 8. If face creation succeeds, succeed with created FaceId
-  // 9. Fail
-
-  boost::regex e("^[a-z0-9]+\\:.*");
-  if (!boost::regex_match(input, e)) {
-    try {
-      uint32_t faceId = boost::lexical_cast<uint32_t>(input);
-      onSucceed(faceId);
-      return;
-    }
-    catch (const boost::bad_lexical_cast&) {
-      onFail("No valid faceId or faceUri is provided");
-      return;
-    }
-  }
-  else {
-    FaceUri faceUri;
-    if (!faceUri.parse(input)) {
-      onFail("FaceUri parse failed");
-      return;
-    }
-
-    auto fetcher = new FaceIdFetcher(std::ref(face), std::ref(controller),
-                                     allowCreate, onSucceed, onFail);
-    fetcher->startGetFaceId(faceUri);
-  }
-}
-
-void
-FaceIdFetcher::startGetFaceId(const FaceUri& faceUri)
-{
-  faceUri.canonize(bind(&FaceIdFetcher::onCanonizeSuccess, this, _1),
-                   bind(&FaceIdFetcher::onCanonizeFailure, this, _1),
-                   m_face.getIoService(), time::seconds(4));
-}
-
-void
-FaceIdFetcher::onCanonizeSuccess(const FaceUri& canonicalUri)
-{
-  ndn::Name queryName("/localhost/nfd/faces/query");
-  ndn::nfd::FaceQueryFilter queryFilter;
-  queryFilter.setRemoteUri(canonicalUri.toString());
-  queryName.append(queryFilter.wireEncode());
-
-  ndn::Interest interestPacket(queryName);
-  interestPacket.setMustBeFresh(true);
-  interestPacket.setInterestLifetime(time::milliseconds(4000));
-  auto interest = std::make_shared<ndn::Interest>(interestPacket);
-
-  ndn::util::SegmentFetcher::fetch(
-    m_face, *interest, ndn::security::v2::getAcceptAllValidator(),
-    bind(&FaceIdFetcher::onQuerySuccess, this, _1, canonicalUri),
-    bind(&FaceIdFetcher::onQueryFailure, this, _1, canonicalUri));
-}
-
-void
-FaceIdFetcher::onCanonizeFailure(const std::string& reason)
-{
-  fail("Canonize faceUri failed : " + reason);
-}
-
-void
-FaceIdFetcher::onQuerySuccess(const ndn::ConstBufferPtr& data,
-                              const FaceUri& canonicalUri)
-{
-  size_t offset = 0;
-  bool isOk = false;
-  ndn::Block block;
-  std::tie(isOk, block) = ndn::Block::fromBuffer(data, offset);
-
-  if (!isOk) {
-    if (m_allowCreate) {
-      startFaceCreate(canonicalUri);
-    }
-    else {
-      fail("Fail to find faceId");
-    }
-  }
-  else {
-    try {
-      ndn::nfd::FaceStatus status(block);
-      succeed(status.getFaceId());
-    }
-    catch (const ndn::tlv::Error& e) {
-      std::string errorMessage(e.what());
-      fail("ERROR: " + errorMessage);
-    }
-  }
-}
-
-void
-FaceIdFetcher::onQueryFailure(uint32_t errorCode,
-                              const FaceUri& canonicalUri)
-{
-  std::stringstream ss;
-  ss << "Cannot fetch data (code " << errorCode << ")";
-  fail(ss.str());
-}
-
-void
-FaceIdFetcher::onFaceCreateError(const ndn::nfd::ControlResponse& response,
-                                 const std::string& message)
-{
-  std::stringstream ss;
-  ss << message << " : " << response.getText() << " (code " << response.getCode() << ")";
-  fail(ss.str());
-}
-
-void
-FaceIdFetcher::startFaceCreate(const FaceUri& canonicalUri)
-{
-  ndn::nfd::ControlParameters parameters;
-  parameters.setUri(canonicalUri.toString());
-
-  m_controller.start<ndn::nfd::FaceCreateCommand>(parameters,
-    [this] (const ndn::nfd::ControlParameters& result) { succeed(result.getFaceId()); },
-    bind(&FaceIdFetcher::onFaceCreateError, this, _1, "Face creation failed"));
-}
-
-void
-FaceIdFetcher::succeed(uint32_t faceId)
-{
-  m_onSucceed(faceId);
-  delete this;
-}
-
-void
-FaceIdFetcher::fail(const std::string& reason)
-{
-  m_onFail(reason);
-  delete this;
-}
-
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
diff --git a/tools/nfdc/face-id-fetcher.hpp b/tools/nfdc/face-id-fetcher.hpp
deleted file mode 100644
index 5e45b7b..0000000
--- a/tools/nfdc/face-id-fetcher.hpp
+++ /dev/null
@@ -1,108 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2014-2017,  Regents of the University of California,
- *                           Arizona Board of Regents,
- *                           Colorado State University,
- *                           University Pierre & Marie Curie, Sorbonne University,
- *                           Washington University in St. Louis,
- *                           Beijing Institute of Technology,
- *                           The University of Memphis.
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD 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.
- *
- * NFD 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
- * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef NFD_TOOLS_NFDC_FACE_ID_FETCHER_HPP
-#define NFD_TOOLS_NFDC_FACE_ID_FETCHER_HPP
-
-#include "core/common.hpp"
-#include <ndn-cxx/face.hpp>
-#include <ndn-cxx/mgmt/nfd/controller.hpp>
-
-namespace nfd {
-namespace tools {
-namespace nfdc {
-
-class FaceIdFetcher
-{
-public:
-  typedef std::function<void(uint32_t)> SuccessCallback;
-  typedef std::function<void(const std::string&)> FailureCallback;
-
-  /** \brief obtain FaceId from input
-   *  \param face Reference to the Face that should be used to fetch data
-   *  \param controller Reference to the controller that should be used to sign the Interest
-   *  \param input User input, either FaceId or FaceUri
-   *  \param allowCreate Whether creating face is allowed
-   *  \param onSucceed Callback to be fired when faceId is obtained
-   *  \param onFail Callback to be fired when an error occurs
-   */
-  static void
-  start(ndn::Face& face,
-        ndn::nfd::Controller& controller,
-        const std::string& input,
-        bool allowCreate,
-        const SuccessCallback& onSucceed,
-        const FailureCallback& onFail);
-
-private:
-  FaceIdFetcher(ndn::Face& face,
-                ndn::nfd::Controller& controller,
-                bool allowCreate,
-                const SuccessCallback& onSucceed,
-                const FailureCallback& onFail);
-
-  void
-  onQuerySuccess(const ndn::ConstBufferPtr& data,
-                 const FaceUri& canonicalUri);
-
-  void
-  onQueryFailure(uint32_t errorCode,
-                 const FaceUri& canonicalUri);
-
-  void
-  onCanonizeSuccess(const FaceUri& canonicalUri);
-
-  void
-  onCanonizeFailure(const std::string& reason);
-
-  void
-  startGetFaceId(const FaceUri& faceUri);
-
-  void
-  startFaceCreate(const FaceUri& canonicalUri);
-
-  void
-  onFaceCreateError(const ndn::nfd::ControlResponse& response,
-                    const std::string& message);
-
-  void
-  succeed(uint32_t faceId);
-
-  void
-  fail(const std::string& reason);
-
-private:
-  ndn::Face& m_face;
-  ndn::nfd::Controller& m_controller;
-  bool m_allowCreate;
-  SuccessCallback m_onSucceed;
-  FailureCallback m_onFail;
-};
-
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
-
-#endif // NFD_TOOLS_NFDC_FACE_ID_FETCHER_HPP
diff --git a/tools/nfdc/legacy-nfdc.cpp b/tools/nfdc/legacy-nfdc.cpp
deleted file mode 100644
index e0e6bcd..0000000
--- a/tools/nfdc/legacy-nfdc.cpp
+++ /dev/null
@@ -1,405 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017,  Regents of the University of California,
- *                           Arizona Board of Regents,
- *                           Colorado State University,
- *                           University Pierre & Marie Curie, Sorbonne University,
- *                           Washington University in St. Louis,
- *                           Beijing Institute of Technology,
- *                           The University of Memphis.
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD 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.
- *
- * NFD 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
- * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "legacy-nfdc.hpp"
-#include "face-id-fetcher.hpp"
-
-#include <boost/program_options.hpp>
-#include <boost/regex.hpp>
-
-namespace nfd {
-namespace tools {
-namespace nfdc {
-
-using ndn::nfd::ControlParameters;
-
-const time::milliseconds LegacyNfdc::DEFAULT_EXPIRATION_PERIOD = time::milliseconds::max();
-const uint64_t LegacyNfdc::DEFAULT_COST = 0;
-
-LegacyNfdc::LegacyNfdc(Face& face, KeyChain& keyChain)
-  : m_flags(ndn::nfd::ROUTE_FLAG_CHILD_INHERIT)
-  , m_cost(DEFAULT_COST)
-  , m_origin(ndn::nfd::ROUTE_ORIGIN_STATIC)
-  , m_expires(DEFAULT_EXPIRATION_PERIOD)
-  , m_facePersistency(ndn::nfd::FACE_PERSISTENCY_PERSISTENT)
-  , m_face(face)
-  , m_controller(face, keyChain)
-{
-}
-
-bool
-LegacyNfdc::dispatch(const std::string& command)
-{
-  if (command == "add-nexthop") {
-    if (m_commandLineArguments.size() != 2)
-      return false;
-    fibAddNextHop();
-  }
-  else if (command == "remove-nexthop") {
-    if (m_commandLineArguments.size() != 2)
-      return false;
-    fibRemoveNextHop();
-  }
-  else if (command == "register") {
-    if (m_commandLineArguments.size() != 2)
-      return false;
-    ribRegisterPrefix();
-  }
-  else if (command == "unregister") {
-    if (m_commandLineArguments.size() != 2)
-      return false;
-    ribUnregisterPrefix();
-  }
-  else if (command == "create") {
-    if (m_commandLineArguments.size() != 1)
-      return false;
-    faceCreate();
-  }
-  else if (command == "destroy") {
-    if (m_commandLineArguments.size() != 1)
-      return false;
-    faceDestroy();
-  }
-  else if (command == "set-strategy") {
-    if (m_commandLineArguments.size() != 2)
-      return false;
-    strategyChoiceSet();
-  }
-  else if (command == "unset-strategy") {
-    if (m_commandLineArguments.size() != 1)
-      return false;
-    strategyChoiceUnset();
-  }
-  else
-    return false;
-
-  return true;
-}
-
-void
-LegacyNfdc::fibAddNextHop()
-{
-  m_name = m_commandLineArguments[0];
-  const std::string& faceName = m_commandLineArguments[1];
-
-  FaceIdFetcher::start(m_face, m_controller, faceName, true,
-    [this] (const uint32_t faceId) {
-      ControlParameters parameters;
-      parameters
-        .setName(m_name)
-        .setCost(m_cost)
-        .setFaceId(faceId);
-
-      m_controller.start<ndn::nfd::FibAddNextHopCommand>(parameters,
-        bind(&LegacyNfdc::onSuccess, this, _1, "Nexthop insertion succeeded"),
-        bind(&LegacyNfdc::onError, this, _1, "Nexthop insertion failed"));
-    },
-    bind(&LegacyNfdc::onObtainFaceIdFailure, this, _1));
-}
-
-void
-LegacyNfdc::fibRemoveNextHop()
-{
-  m_name = m_commandLineArguments[0];
-  const std::string& faceName = m_commandLineArguments[1];
-
-  FaceIdFetcher::start(m_face, m_controller, faceName, false,
-    [this] (const uint32_t faceId) {
-      ControlParameters parameters;
-      parameters
-        .setName(m_name)
-        .setFaceId(faceId);
-
-      m_controller.start<ndn::nfd::FibRemoveNextHopCommand>(parameters,
-        bind(&LegacyNfdc::onSuccess, this, _1, "Nexthop removal succeeded"),
-        bind(&LegacyNfdc::onError, this, _1, "Nexthop removal failed"));
-    },
-    bind(&LegacyNfdc::onObtainFaceIdFailure, this, _1));
-}
-
-void
-LegacyNfdc::ribRegisterPrefix()
-{
-  m_name = m_commandLineArguments[0];
-  const std::string& faceName = m_commandLineArguments[1];
-
-  FaceIdFetcher::start(m_face, m_controller, faceName, true,
-    [this] (const uint32_t faceId) {
-      ControlParameters parameters;
-      parameters
-        .setName(m_name)
-        .setCost(m_cost)
-        .setFlags(m_flags)
-        .setOrigin(m_origin)
-        .setFaceId(faceId);
-
-      if (m_expires != DEFAULT_EXPIRATION_PERIOD)
-        parameters.setExpirationPeriod(m_expires);
-
-      m_controller.start<ndn::nfd::RibRegisterCommand>(parameters,
-        bind(&LegacyNfdc::onSuccess, this, _1, "Successful in name registration"),
-        bind(&LegacyNfdc::onError, this, _1, "Failed in name registration"));
-    },
-    bind(&LegacyNfdc::onObtainFaceIdFailure, this, _1));
-}
-
-void
-LegacyNfdc::ribUnregisterPrefix()
-{
-  m_name = m_commandLineArguments[0];
-  const std::string& faceName = m_commandLineArguments[1];
-
-  FaceIdFetcher::start(m_face, m_controller, faceName, false,
-    [this] (const uint32_t faceId) {
-      ControlParameters parameters;
-      parameters
-        .setName(m_name)
-        .setFaceId(faceId)
-        .setOrigin(m_origin);
-
-      m_controller.start<ndn::nfd::RibUnregisterCommand>(parameters,
-        bind(&LegacyNfdc::onSuccess, this, _1, "Successful in unregistering name"),
-        bind(&LegacyNfdc::onError, this, _1, "Failed in unregistering name"));
-    },
-    bind(&LegacyNfdc::onObtainFaceIdFailure, this, _1));
-}
-
-void
-LegacyNfdc::onCanonizeFailure(const std::string& reason)
-{
-  BOOST_THROW_EXCEPTION(Error(reason));
-}
-
-void
-LegacyNfdc::onObtainFaceIdFailure(const std::string& message)
-{
-  BOOST_THROW_EXCEPTION(Error(message));
-}
-
-void
-LegacyNfdc::faceCreate()
-{
-  boost::regex e("^[a-z0-9]+\\:.*");
-  if (!boost::regex_match(m_commandLineArguments[0], e))
-    BOOST_THROW_EXCEPTION(Error("invalid uri format"));
-
-  FaceUri faceUri;
-  faceUri.parse(m_commandLineArguments[0]);
-
-  faceUri.canonize(bind(&LegacyNfdc::startFaceCreate, this, _1),
-                   bind(&LegacyNfdc::onCanonizeFailure, this, _1),
-                   m_face.getIoService(), time::seconds(4));
-}
-
-void
-LegacyNfdc::startFaceCreate(const FaceUri& canonicalUri)
-{
-  ControlParameters parameters;
-  parameters.setUri(canonicalUri.toString());
-  parameters.setFacePersistency(m_facePersistency);
-
-  m_controller.start<ndn::nfd::FaceCreateCommand>(parameters,
-    bind(&LegacyNfdc::onSuccess, this, _1, "Face creation succeeded"),
-    bind(&LegacyNfdc::onError, this, _1, "Face creation failed"));
-}
-
-void
-LegacyNfdc::faceDestroy()
-{
-  ControlParameters parameters;
-  const std::string& faceName = m_commandLineArguments[0];
-
-  FaceIdFetcher::start(m_face, m_controller, faceName, false,
-    [this] (const uint32_t faceId) {
-      ControlParameters faceParameters;
-      faceParameters.setFaceId(faceId);
-
-      m_controller.start<ndn::nfd::FaceDestroyCommand>(faceParameters,
-        bind(&LegacyNfdc::onSuccess, this, _1, "Face destroy succeeded"),
-        bind(&LegacyNfdc::onError, this, _1, "Face destroy failed"));
-    },
-    bind(&LegacyNfdc::onObtainFaceIdFailure, this, _1));
-}
-
-void
-LegacyNfdc::strategyChoiceSet()
-{
-  const std::string& name = m_commandLineArguments[0];
-  const std::string& strategy = m_commandLineArguments[1];
-
-  ControlParameters parameters;
-  parameters
-    .setName(name)
-    .setStrategy(strategy);
-
-  m_controller.start<ndn::nfd::StrategyChoiceSetCommand>(parameters,
-    bind(&LegacyNfdc::onSuccess, this, _1, "Successfully set strategy choice"),
-    bind(&LegacyNfdc::onError, this, _1, "Failed to set strategy choice"));
-}
-
-void
-LegacyNfdc::strategyChoiceUnset()
-{
-  const std::string& name = m_commandLineArguments[0];
-
-  ControlParameters parameters;
-  parameters.setName(name);
-
-  m_controller.start<ndn::nfd::StrategyChoiceUnsetCommand>(parameters,
-    bind(&LegacyNfdc::onSuccess, this, _1, "Successfully unset strategy choice"),
-    bind(&LegacyNfdc::onError, this, _1, "Failed to unset strategy choice"));
-}
-
-void
-LegacyNfdc::onSuccess(const ControlParameters& commandSuccessResult, const std::string& message)
-{
-  std::cout << message << ": " << commandSuccessResult << std::endl;
-}
-
-void
-LegacyNfdc::onError(const ndn::nfd::ControlResponse& response, const std::string& message)
-{
-  std::ostringstream os;
-  os << message << ": " << response.getText() << " (code: " << response.getCode() << ")";
-  BOOST_THROW_EXCEPTION(Error(os.str()));
-}
-
-void
-legacyNfdcUsage()
-{
-  std::cout << "Usage:\n"
-    "nfdc [-h] [-V] COMMAND [<Command Options>]\n"
-    "       -h print usage and exit\n"
-    "       -V print version and exit\n"
-    "\n"
-    "   COMMAND can be one of the following:\n"
-    "       register [-I] [-C] [-c cost] [-e expiration time] [-o origin] name <faceId | faceUri>\n"
-    "           register name to the given faceId or faceUri\n"
-    "           -I: unset CHILD_INHERIT flag\n"
-    "           -C: set CAPTURE flag\n"
-    "           -c: specify cost (default 0)\n"
-    "           -e: specify expiration time in ms\n"
-    "               (by default the entry remains in FIB for the lifetime of the associated face)\n"
-    "           -o: specify origin\n"
-    "               0 for Local producer applications, 128 for NLSR, 255(default) for static routes\n"
-    "       unregister [-o origin] name <faceId | faceUri>\n"
-    "           unregister name from the given faceId\n"
-    "       create [-P] <faceUri> \n"
-    "           Create a face in one of the following formats:\n"
-    "           UDP unicast:    udp[4|6]://<remote-IP-or-host>[:<remote-port>]\n"
-    "           TCP:            tcp[4|6]://<remote-IP-or-host>[:<remote-port>] \n"
-    "           -P: create permanent (instead of persistent) face\n"
-    "       destroy <faceId | faceUri> \n"
-    "           Destroy a face\n"
-    "       set-strategy <name> <strategy> \n"
-    "           Set the strategy for a namespace \n"
-    "       unset-strategy <name> \n"
-    "           Unset the strategy for a namespace \n"
-    "       add-nexthop [-c <cost>] <name> <faceId | faceUri>\n"
-    "           Add a nexthop to a FIB entry\n"
-    "           -c: specify cost (default 0)\n"
-    "       remove-nexthop <name> <faceId | faceUri> \n"
-    "           Remove a nexthop from a FIB entry\n"
-    << std::endl;
-}
-
-void
-legacyNfdcMain(ExecuteContext& ctx, const std::string& replacementCommand)
-{
-  if (!replacementCommand.empty()) {
-    std::cerr << "'nfdc " << ctx.noun << "' command is deprecated. "
-              << "Use 'nfdc " << replacementCommand << "' instead.\n";
-  }
-
-  LegacyNfdc p(ctx.face, ctx.keyChain);
-
-  const std::string& subcommand = ctx.noun;
-  auto args = ctx.args.get<std::vector<std::string>>("args");
-  bool wantUnsetChildInherit = false;
-  bool wantCapture = false;
-  bool wantPermanentFace = false;
-  int64_t expires = -1;
-  std::underlying_type<ndn::nfd::RouteOrigin>::type origin = ndn::nfd::ROUTE_ORIGIN_STATIC;
-
-  namespace po = boost::program_options;
-  po::options_description options;
-  options.add_options()
-    (",I", po::bool_switch(&wantUnsetChildInherit))
-    (",C", po::bool_switch(&wantCapture))
-    (",c", po::value<uint64_t>(&p.m_cost))
-    (",e", po::value<int64_t>(&expires))
-    (",o", po::value<std::underlying_type<ndn::nfd::RouteOrigin>::type>(&origin))
-    (",P", po::bool_switch(&wantPermanentFace));
-  po::variables_map vm;
-  std::vector<std::string> unparsed;
-  try {
-    po::parsed_options parsed = po::command_line_parser(args).options(options).allow_unregistered().run();
-    unparsed = po::collect_unrecognized(parsed.options, po::include_positional);
-    po::store(parsed, vm);
-    po::notify(vm);
-  }
-  catch (const po::error& e) {
-    std::cerr << e.what() << std::endl;
-    legacyNfdcUsage();
-    ctx.exitCode = 2;
-    return;
-  }
-
-  if (wantUnsetChildInherit) {
-    p.m_flags &= ~(ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
-  }
-  if (wantCapture) {
-    p.m_flags |= ndn::nfd::ROUTE_FLAG_CAPTURE;
-  }
-  if (expires >= 0) {
-    // accept negative values as no expiration
-    p.m_expires = time::milliseconds(expires);
-  }
-  p.m_origin = static_cast<ndn::nfd::RouteOrigin>(origin);
-  if (wantPermanentFace) {
-    p.m_facePersistency = ndn::nfd::FACE_PERSISTENCY_PERMANENT;
-  }
-
-  if (std::any_of(unparsed.begin(), unparsed.end(),
-      [] (const std::string& s) { return s.empty() || s[0] == '-'; })) {
-    // unrecognized -option
-    legacyNfdcUsage();
-    ctx.exitCode = 2;
-    return;
-  }
-  p.m_commandLineArguments = unparsed;
-
-  bool isOk = p.dispatch(subcommand);
-  if (!isOk) {
-    legacyNfdcUsage();
-    ctx.exitCode = 2;
-    return;
-  }
-  ctx.face.processEvents();
-}
-
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
diff --git a/tools/nfdc/legacy-nfdc.hpp b/tools/nfdc/legacy-nfdc.hpp
deleted file mode 100644
index 782c255..0000000
--- a/tools/nfdc/legacy-nfdc.hpp
+++ /dev/null
@@ -1,185 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017,  Regents of the University of California,
- *                           Arizona Board of Regents,
- *                           Colorado State University,
- *                           University Pierre & Marie Curie, Sorbonne University,
- *                           Washington University in St. Louis,
- *                           Beijing Institute of Technology,
- *                           The University of Memphis.
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD 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.
- *
- * NFD 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
- * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef NFD_TOOLS_NFDC_LEGACY_NFDC_HPP
-#define NFD_TOOLS_NFDC_LEGACY_NFDC_HPP
-
-#include "execute-command.hpp"
-
-#include <ndn-cxx/encoding/nfd-constants.hpp>
-#include <ndn-cxx/mgmt/nfd/controller.hpp>
-
-namespace nfd {
-namespace tools {
-namespace nfdc {
-
-class LegacyNfdc : noncopyable
-{
-public:
-  static const time::milliseconds DEFAULT_EXPIRATION_PERIOD;
-  static const uint64_t DEFAULT_COST;
-
-  class Error : public std::runtime_error
-  {
-  public:
-    explicit
-    Error(const std::string& what)
-      : std::runtime_error(what)
-    {
-    }
-  };
-
-  LegacyNfdc(Face& face, KeyChain& keyChain);
-
-  bool
-  dispatch(const std::string& cmd);
-
-  /**
-   * \brief Adds a nexthop to a FIB entry
-   *
-   * If the FIB entry does not exist, it is inserted automatically
-   *
-   * cmd format:
-   *  [-c cost]  name faceId|faceUri
-   *
-   */
-  void
-  fibAddNextHop();
-
-  /**
-   * \brief Removes a nexthop from an existing FIB entry
-   *
-   * If the last nexthop record in a FIB entry is removed, the FIB entry is also deleted
-   *
-   * cmd format:
-   *  name faceId
-   *
-   */
-  void
-  fibRemoveNextHop();
-
-  /**
-   * \brief Registers name to the given faceId or faceUri
-   *
-   * cmd format:
-   *  [-I] [-C] [-c cost] name faceId|faceUri
-   */
-  void
-  ribRegisterPrefix();
-
-  /**
-   * \brief Unregisters name from the given faceId/faceUri
-   *
-   * cmd format:
-   *  name faceId/faceUri
-   */
-  void
-  ribUnregisterPrefix();
-
-  /**
-   * \brief Creates new face
-   *
-   * This command allows creation of UDP unicast and TCP faces only
-   *
-   * cmd format:
-   *  uri
-   *
-   */
-  void
-  faceCreate();
-
-  /**
-   * \brief Destroys face
-   *
-   * cmd format:
-   *  faceId|faceUri
-   *
-   */
-  void
-  faceDestroy();
-
-  /**
-   * \brief Sets the strategy for a namespace
-   *
-   * cmd format:
-   *  name strategy
-   *
-   */
-  void
-  strategyChoiceSet();
-
-  /**
-   * \brief Unset the strategy for a namespace
-   *
-   * cmd format:
-   *  name strategy
-   *
-   */
-  void
-  strategyChoiceUnset();
-
-private:
-  void
-  onSuccess(const ndn::nfd::ControlParameters& commandSuccessResult,
-            const std::string& message);
-
-  void
-  onError(const ndn::nfd::ControlResponse& response, const std::string& message);
-
-  void
-  onCanonizeFailure(const std::string& reason);
-
-  void
-  startFaceCreate(const FaceUri& canonicalUri);
-
-  void
-  onObtainFaceIdFailure(const std::string& message);
-
-public:
-  std::vector<std::string> m_commandLineArguments; // positional arguments
-  uint64_t m_flags;
-  uint64_t m_cost;
-  uint64_t m_faceId;
-  ndn::nfd::RouteOrigin m_origin;
-  time::milliseconds m_expires;
-  std::string m_name;
-  ndn::nfd::FacePersistency m_facePersistency;
-
-private:
-  Face& m_face;
-  ndn::nfd::Controller m_controller;
-};
-
-void
-legacyNfdcUsage();
-
-void
-legacyNfdcMain(ExecuteContext& ctx, const std::string& replacementCommand);
-
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
-
-#endif // NFD_TOOLS_NFDC_LEGACY_NFDC_HPP
diff --git a/tools/nfdc/legacy-status.cpp b/tools/nfdc/legacy-status.cpp
deleted file mode 100644
index a61defd..0000000
--- a/tools/nfdc/legacy-status.cpp
+++ /dev/null
@@ -1,126 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017,  Regents of the University of California,
- *                           Arizona Board of Regents,
- *                           Colorado State University,
- *                           University Pierre & Marie Curie, Sorbonne University,
- *                           Washington University in St. Louis,
- *                           Beijing Institute of Technology,
- *                           The University of Memphis.
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD 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.
- *
- * NFD 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
- * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "legacy-status.hpp"
-#include "core/version.hpp"
-
-#include <boost/program_options.hpp>
-
-namespace nfd {
-namespace tools {
-namespace nfdc {
-
-static void
-showUsage(std::ostream& os, const boost::program_options::options_description& cmdOptions)
-{
-  os << "Usage: nfd-status [options]\n\n"
-     << "Show NFD version and status information.\n\n"
-     << cmdOptions;
-}
-
-/** \brief parse legacy nfd-status command line, and show usage if necessary
- *  \return if first item is -1, caller should retrieve and display StatusReport;
- *          otherwise, caller should immediately exit with the specified exit code
- */
-static std::tuple<int, StatusReportOptions>
-parseCommandLine(ExecuteContext& ctx, const std::vector<std::string>& args)
-{
-  StatusReportOptions options;
-
-  namespace po = boost::program_options;
-  po::options_description cmdOptions("StatusReportOptions");
-  cmdOptions.add_options()
-    ("help,h", "print this help message")
-    ("version,V", "show program version")
-    ("general,v", po::bool_switch(&options.wantForwarderGeneral), "show general status")
-    ("channels,c", po::bool_switch(&options.wantChannels), "show channels")
-    ("faces,f", po::bool_switch(&options.wantFaces), "show faces")
-    ("fib,b", po::bool_switch(&options.wantFib), "show FIB entries")
-    ("rib,r", po::bool_switch(&options.wantRib), "show RIB routes")
-    ("sc,s", po::bool_switch(&options.wantStrategyChoice), "show strategy choice entries")
-    ("xml,x", "output as XML instead of text (implies -vcfbrs)");
-  po::variables_map vm;
-  try {
-    po::store(po::command_line_parser(args).options(cmdOptions).run(), vm);
-    po::notify(vm);
-  }
-  catch (const po::error& e) {
-    ctx.err << e.what() << "\n";
-    showUsage(ctx.err, cmdOptions);
-    return std::make_tuple(2, options);
-  }
-
-  if (vm.count("help") > 0) {
-    showUsage(ctx.out, cmdOptions);
-    return std::make_tuple(0, options);
-  }
-  if (vm.count("version") > 0) {
-    ctx.out << "nfd-status " << NFD_VERSION_BUILD_STRING << "\n";
-    return std::make_tuple(0, options);
-  }
-
-  if (vm.count("xml") > 0) {
-    options.output = ReportFormat::XML;
-  }
-  if (options.output == ReportFormat::XML ||
-      (!options.wantForwarderGeneral && !options.wantChannels && !options.wantFaces &&
-       !options.wantFib && !options.wantRib && !options.wantStrategyChoice)) {
-    options.wantForwarderGeneral = options.wantChannels = options.wantFaces =
-      options.wantFib = options.wantRib = options.wantStrategyChoice = true;
-  }
-
-  return std::make_tuple(-1, options);
-}
-
-/** \brief the 'legacy-nfd-status' command
- */
-static void
-legacyNfdStatus(ExecuteContext& ctx)
-{
-  auto args = ctx.args.get<std::vector<std::string>>("args");
-
-  int exitCode = -1;
-  StatusReportOptions options;
-  std::tie(exitCode, options) = parseCommandLine(ctx, args);
-  if (exitCode >= 0) {
-    ctx.exitCode = exitCode;
-    return;
-  }
-
-  reportStatus(ctx, options);
-}
-
-void
-registerLegacyStatusCommand(CommandParser& parser)
-{
-  CommandDefinition defLegacyNfdStatus("legacy-nfd-status", "");
-  defLegacyNfdStatus
-    .addArg("args", ArgValueType::ANY, Required::NO, Positional::YES);
-  parser.addCommand(defLegacyNfdStatus, &legacyNfdStatus, AVAILABLE_IN_ALL & ~AVAILABLE_IN_HELP);
-}
-
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
diff --git a/tools/nfdc/legacy-status.hpp b/tools/nfdc/legacy-status.hpp
deleted file mode 100644
index e200292..0000000
--- a/tools/nfdc/legacy-status.hpp
+++ /dev/null
@@ -1,44 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2016,  Regents of the University of California,
- *                           Arizona Board of Regents,
- *                           Colorado State University,
- *                           University Pierre & Marie Curie, Sorbonne University,
- *                           Washington University in St. Louis,
- *                           Beijing Institute of Technology,
- *                           The University of Memphis.
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD 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.
- *
- * NFD 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
- * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef NFD_TOOLS_NFDC_LEGACY_STATUS_HPP
-#define NFD_TOOLS_NFDC_LEGACY_STATUS_HPP
-
-#include "status.hpp"
-
-namespace nfd {
-namespace tools {
-namespace nfdc {
-
-/** \brief registers 'legacy-nfd-status' command
- */
-void
-registerLegacyStatusCommand(CommandParser& parser);
-
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
-
-#endif // NFD_TOOLS_NFDC_LEGACY_STATUS_HPP
