diff --git a/src/detail/face-impl.hpp b/src/detail/face-impl.hpp
index a7c332d..998ab34 100644
--- a/src/detail/face-impl.hpp
+++ b/src/detail/face-impl.hpp
@@ -37,8 +37,8 @@
 #include "../transport/unix-transport.hpp"
 #include "../transport/tcp-transport.hpp"
 
-#include "../management/nfd-controller.hpp"
-#include "../management/nfd-command-options.hpp"
+#include "../mgmt/nfd/controller.hpp"
+#include "../mgmt/nfd/command-options.hpp"
 
 #include "../lp/packet.hpp"
 #include "../lp/tags.hpp"
diff --git a/src/detail/registered-prefix.hpp b/src/detail/registered-prefix.hpp
index bdc69bf..5b08167 100644
--- a/src/detail/registered-prefix.hpp
+++ b/src/detail/registered-prefix.hpp
@@ -27,8 +27,8 @@
 #include "../interest.hpp"
 
 #include "interest-filter-record.hpp"
-#include "management/nfd-command-options.hpp"
-#include "management/nfd-control-parameters.hpp"
+#include "mgmt/nfd/command-options.hpp"
+#include "mgmt/nfd/control-parameters.hpp"
 
 namespace ndn {
 
diff --git a/src/management/nfd-channel-status.hpp b/src/management/nfd-channel-status.hpp
index 422de2b..524d9f9 100644
--- a/src/management/nfd-channel-status.hpp
+++ b/src/management/nfd-channel-status.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2013-2015 Regents of the University of California.
+ * Copyright (c) 2013-2016 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -19,64 +19,7 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#ifndef NDN_MANAGEMENT_NFD_CHANNEL_STATUS_HPP
-#define NDN_MANAGEMENT_NFD_CHANNEL_STATUS_HPP
-
-#include "../encoding/block.hpp"
-
-namespace ndn {
-namespace nfd {
-
-/**
- * @ingroup management
- * @brief represents NFD Channel Status dataset
- * @sa http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Channel-Dataset
+/** \file
+ *  \deprecated Use mgmt/nfd/channel-status.hpp
  */
-class ChannelStatus
-{
-public:
-  class Error : public tlv::Error
-  {
-  public:
-    explicit
-    Error(const std::string& what)
-      : tlv::Error(what)
-    {
-    }
-  };
-
-  ChannelStatus();
-
-  explicit
-  ChannelStatus(const Block& payload);
-
-  template<encoding::Tag TAG>
-  size_t
-  wireEncode(EncodingImpl<TAG>& encoder) const;
-
-  const Block&
-  wireEncode() const;
-
-  void
-  wireDecode(const Block& wire);
-
-public: // getters & setters
-  const std::string&
-  getLocalUri() const
-  {
-    return m_localUri;
-  }
-
-  ChannelStatus&
-  setLocalUri(const std::string localUri);
-
-private:
-  std::string m_localUri;
-
-  mutable Block m_wire;
-};
-
-} // namespace nfd
-} // namespace ndn
-
-#endif // NDN_MANAGEMENT_NFD_CHANNEL_STATUS_HPP
+#include "../mgmt/nfd/channel-status.hpp"
diff --git a/src/management/nfd-command-options.hpp b/src/management/nfd-command-options.hpp
index 4ca0a6b..7cf8c77 100644
--- a/src/management/nfd-command-options.hpp
+++ b/src/management/nfd-command-options.hpp
@@ -19,178 +19,7 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#ifndef NDN_MANAGEMENT_NFD_COMMAND_OPTIONS_HPP
-#define NDN_MANAGEMENT_NFD_COMMAND_OPTIONS_HPP
-
-#include "../security/signing-info.hpp"
-
-#define NDN_MANAGEMENT_NFD_COMMAND_OPTIONS_KEEP_DEPRECATED_SIGNING_PARAMS
-
-namespace ndn {
-
-namespace security {
-namespace v1 {
-class IdentityCertificate;
-} // namespace v1
-} // namespace security
-
-namespace nfd {
-
-/** \ingroup management
- *  \brief contains options for ControlCommand execution
- *  \note This type is intentionally copyable
+/** \file
+ *  \deprecated Use mgmt/nfd/command-options.hpp
  */
-class CommandOptions
-{
-public:
-  /** \brief constructs CommandOptions
-   *  \post getTimeout() == DEFAULT_TIMEOUT
-   *  \post getPrefix() == DEFAULT_PREFIX
-   *  \post getSigningInfo().getSignerType() == SIGNER_TYPE_NULL
-   */
-  CommandOptions();
-
-  /** \return command timeout
-   */
-  const time::milliseconds&
-  getTimeout() const
-  {
-    return m_timeout;
-  }
-
-  /** \brief sets command timeout
-   *  \param timeout the new command timeout, must be positive
-   *  \throw std::out_of_range if timeout is non-positive
-   *  \return self
-   */
-  CommandOptions&
-  setTimeout(const time::milliseconds& timeout);
-
-  /** \return command prefix
-   */
-  const Name&
-  getPrefix() const
-  {
-    return m_prefix;
-  }
-
-  /** \brief sets command prefix
-   *  \return self
-   */
-  CommandOptions&
-  setPrefix(const Name& prefix);
-
-  /** \return signing parameters
-   */
-  const security::SigningInfo&
-  getSigningInfo() const
-  {
-    return m_signingInfo;
-  }
-
-  /** \brief sets signing parameters
-   *  \return self
-   */
-  CommandOptions&
-  setSigningInfo(const security::SigningInfo& signingInfo);
-
-#ifdef NDN_MANAGEMENT_NFD_COMMAND_OPTIONS_KEEP_DEPRECATED_SIGNING_PARAMS
-public: // signing parameters
-  /** \deprecated use getSigningInfo and setSigningInfo
-   *  \brief indicates the selection of signing parameters
-   */
-  enum SigningParamsKind {
-    /** \brief picks the default signing identity and certificate
-     */
-    SIGNING_PARAMS_DEFAULT,
-    /** \brief picks the default certificate of a specific identity Name
-     */
-    SIGNING_PARAMS_IDENTITY,
-    /** \brief picks a specific identity certificate
-     */
-    SIGNING_PARAMS_CERTIFICATE
-  };
-
-  /** \deprecated use getSigningInfo and setSigningInfo
-   *  \return selection of signing parameters
-   */
-  DEPRECATED(
-  SigningParamsKind
-  getSigningParamsKind() const);
-
-  /** \deprecated use getSigningInfo and setSigningInfo
-   *  \return identity Name
-   *  \pre getSigningParamsKind() == SIGNING_PARAMS_IDENTITY
-   */
-  DEPRECATED(
-  const Name&
-  getSigningIdentity() const);
-
-  /** \deprecated use getSigningInfo and setSigningInfo
-   *  \return certificate Name
-   *  \pre getSigningParamsKind() == SIGNING_PARAMS_CERTIFICATE
-   */
-  DEPRECATED(
-  const Name&
-  getSigningCertificate() const);
-
-  /** \deprecated use getSigningInfo and setSigningInfo
-   *  \brief chooses to use default identity and certificate
-   *  \post getSigningParamsKind() == SIGNING_PARAMS_DEFAULT
-   *  \return self
-   */
-  DEPRECATED(
-  CommandOptions&
-  setSigningDefault());
-
-  /** \deprecated use getSigningInfo and setSigningInfo
-   *  \brief chooses to use a specific identity and its default certificate
-   *  \post getSigningParamsKind() == SIGNING_PARAMS_IDENTITY
-   *  \post getIdentityName() == identityName
-   *  \return self
-   */
-  DEPRECATED(
-  CommandOptions&
-  setSigningIdentity(const Name& identityName));
-
-  /** \deprecated use getSigningInfo and setSigningInfo
-   *  \brief chooses to use a specific identity certificate
-   *  \param certificateName identity certificate Name
-   *  \throw std::invalid_argument if certificateName is invalid
-   *  \post getSigningParamsKind() == SIGNING_PARAMS_CERTIFICATE
-   *  \post getSigningCertificate() == certificateName
-   *  \return self
-   */
-  DEPRECATED(
-  CommandOptions&
-  setSigningCertificate(const Name& certificateName));
-
-  /** \deprecated use getSigningInfo and setSigningInfo
-   *  \brief chooses to use a specific identity certificate
-   *  \details This is equivalent to .setIdentityCertificate(certificate.getName())
-   */
-  DEPRECATED(
-  CommandOptions&
-  setSigningCertificate(const security::v1::IdentityCertificate& certificate));
-
-#endif // NDN_MANAGEMENT_NFD_COMMAND_OPTIONS_KEEP_DEPRECATED_SIGNING_PARAMS
-
-public:
-  /** \brief gives the default command timeout: 10000ms
-   */
-  static const time::milliseconds DEFAULT_TIMEOUT;
-
-  /** \brief gives the default command prefix: ndn:/localhost/nfd
-   */
-  static const Name DEFAULT_PREFIX;
-
-private:
-  time::milliseconds m_timeout;
-  Name m_prefix;
-  security::SigningInfo m_signingInfo;
-};
-
-} // namespace nfd
-} // namespace ndn
-
-#endif // NDN_MANAGEMENT_NFD_COMMAND_OPTIONS_HPP
+#include "../mgmt/nfd/command-options.hpp"
diff --git a/src/management/nfd-control-command.hpp b/src/management/nfd-control-command.hpp
index 169d837..393e174 100644
--- a/src/management/nfd-control-command.hpp
+++ b/src/management/nfd-control-command.hpp
@@ -19,330 +19,7 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#ifndef NDN_MANAGEMENT_NFD_CONTROL_COMMAND_HPP
-#define NDN_MANAGEMENT_NFD_CONTROL_COMMAND_HPP
-
-#include "nfd-control-parameters.hpp"
-
-namespace ndn {
-namespace nfd {
-
-/**
- * \ingroup management
- * \brief base class of NFD ControlCommand
- * \sa http://redmine.named-data.net/projects/nfd/wiki/ControlCommand
+/** \file
+ *  \deprecated Use mgmt/nfd/control-command.hpp
  */
-class ControlCommand : noncopyable
-{
-public:
-  /** \brief represents an error in ControlParameters
-   */
-  class ArgumentError : public std::invalid_argument
-  {
-  public:
-    explicit
-    ArgumentError(const std::string& what)
-      : std::invalid_argument(what)
-    {
-    }
-  };
-
-  virtual
-  ~ControlCommand();
-
-  /** \brief validate request parameters
-   *  \throw ArgumentError if parameters are invalid
-   */
-  virtual void
-  validateRequest(const ControlParameters& parameters) const;
-
-  /** \brief apply default values to missing fields in request
-   */
-  virtual void
-  applyDefaultsToRequest(ControlParameters& parameters) const;
-
-  /** \brief validate response parameters
-   *  \throw ArgumentError if parameters are invalid
-   */
-  virtual void
-  validateResponse(const ControlParameters& parameters) const;
-
-  /** \brief apply default values to missing fields in response
-   */
-  virtual void
-  applyDefaultsToResponse(ControlParameters& parameters) const;
-
-  /** \brief construct the Name for a request Interest
-   *  \throw ArgumentError if parameters are invalid
-   */
-  Name
-  getRequestName(const Name& commandPrefix, const ControlParameters& parameters) const;
-
-protected:
-  ControlCommand(const std::string& module, const std::string& verb);
-
-  class FieldValidator
-  {
-  public:
-    FieldValidator();
-
-    /** \brief declare a required field
-     */
-    FieldValidator&
-    required(ControlParameterField field)
-    {
-      m_required[field] = true;
-      return *this;
-    }
-
-    /** \brief declare an optional field
-     */
-    FieldValidator&
-    optional(ControlParameterField field)
-    {
-      m_optional[field] = true;
-      return *this;
-    }
-
-    /** \brief verify that all required fields are present,
-     *         and all present fields are either required or optional
-     *  \throw ArgumentError
-     */
-    void
-    validate(const ControlParameters& parameters) const;
-
-  private:
-    std::vector<bool> m_required;
-    std::vector<bool> m_optional;
-  };
-
-protected:
-  /** \brief FieldValidator for request ControlParameters
-   *
-   *  Constructor of subclass should populate this validator.
-   */
-  FieldValidator m_requestValidator;
-  /** \brief FieldValidator for response ControlParameters
-   *
-   *  Constructor of subclass should populate this validator.
-   */
-  FieldValidator m_responseValidator;
-
-private:
-  name::Component m_module;
-  name::Component m_verb;
-};
-
-
-/**
- * \ingroup management
- * \brief represents a faces/create command
- * \sa http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Create-a-face
- */
-class FaceCreateCommand : public ControlCommand
-{
-public:
-  FaceCreateCommand();
-
-  virtual void
-  applyDefaultsToRequest(ControlParameters& parameters) const override;
-
-  virtual void
-  validateRequest(const ControlParameters& parameters) const override;
-
-  virtual void
-  validateResponse(const ControlParameters& parameters) const override;
-};
-
-
-/**
- * \ingroup management
- * \brief represents a faces/update command
- * \sa http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Update-a-face
- */
-class FaceUpdateCommand : public ControlCommand
-{
-public:
-  FaceUpdateCommand();
-
-  virtual void
-  applyDefaultsToRequest(ControlParameters& parameters) const override;
-
-  virtual void
-  validateRequest(const ControlParameters& parameters) const override;
-
-  /**
-   * \note This can only validate ControlParameters in a success response.
-   *       Failure responses should be validated with validateRequest.
-   */
-  virtual void
-  validateResponse(const ControlParameters& parameters) const override;
-};
-
-
-/**
- * \ingroup management
- * \brief represents a faces/destroy command
- * \sa http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Destroy-a-face
- */
-class FaceDestroyCommand : public ControlCommand
-{
-public:
-  FaceDestroyCommand();
-
-  virtual void
-  validateRequest(const ControlParameters& parameters) const override;
-
-  virtual void
-  validateResponse(const ControlParameters& parameters) const override;
-};
-
-
-/**
- * \ingroup management
- * \brief Base class for faces/[*]-local-control commands
- */
-class FaceLocalControlCommand : public ControlCommand
-{
-public:
-  virtual void
-  validateRequest(const ControlParameters& parameters) const override;
-
-  virtual void
-  validateResponse(const ControlParameters& parameters) const override;
-
-protected:
-  explicit
-  FaceLocalControlCommand(const std::string& verb);
-};
-
-
-/**
- * \ingroup management
- * \brief represents a faces/enable-local-control command
- * \sa http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Enable-a-LocalControlHeader-feature
- */
-class FaceEnableLocalControlCommand : public FaceLocalControlCommand
-{
-public:
-  FaceEnableLocalControlCommand();
-};
-
-
-/**
- * \ingroup management
- * \brief represents a faces/disable-local-control command
- * \sa http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Disable-a-LocalControlHeader-feature
- */
-class FaceDisableLocalControlCommand : public FaceLocalControlCommand
-{
-public:
-  FaceDisableLocalControlCommand();
-};
-
-
-/**
- * \ingroup management
- * \brief represents a fib/add-nexthop command
- * \sa http://redmine.named-data.net/projects/nfd/wiki/FibMgmt#Add-a-nexthop
- */
-class FibAddNextHopCommand : public ControlCommand
-{
-public:
-  FibAddNextHopCommand();
-
-  virtual void
-  applyDefaultsToRequest(ControlParameters& parameters) const override;
-
-  virtual void
-  validateResponse(const ControlParameters& parameters) const override;
-};
-
-
-/**
- * \ingroup management
- * \brief represents a fib/remove-nexthop command
- * \sa http://redmine.named-data.net/projects/nfd/wiki/FibMgmt#Remove-a-nexthop
- */
-class FibRemoveNextHopCommand : public ControlCommand
-{
-public:
-  FibRemoveNextHopCommand();
-
-  virtual void
-  applyDefaultsToRequest(ControlParameters& parameters) const override;
-
-  virtual void
-  validateResponse(const ControlParameters& parameters) const override;
-};
-
-
-/**
- * \ingroup management
- * \brief represents a strategy-choice/set command
- * \sa http://redmine.named-data.net/projects/nfd/wiki/StrategyChoice#Set-the-strategy-for-a-namespace
- */
-class StrategyChoiceSetCommand : public ControlCommand
-{
-public:
-  StrategyChoiceSetCommand();
-};
-
-
-/**
- * \ingroup management
- * \brief represents a strategy-choice/set command
- * \sa http://redmine.named-data.net/projects/nfd/wiki/StrategyChoice#Unset-the-strategy-for-a-namespace
- */
-class StrategyChoiceUnsetCommand : public ControlCommand
-{
-public:
-  StrategyChoiceUnsetCommand();
-
-  virtual void
-  validateRequest(const ControlParameters& parameters) const override;
-
-  virtual void
-  validateResponse(const ControlParameters& parameters) const override;
-};
-
-
-/**
- * \ingroup management
- * \brief represents a rib/register command
- * \sa http://redmine.named-data.net/projects/nfd/wiki/RibMgmt#Register-a-route
- */
-class RibRegisterCommand : public ControlCommand
-{
-public:
-  RibRegisterCommand();
-
-  virtual void
-  applyDefaultsToRequest(ControlParameters& parameters) const override;
-
-  virtual void
-  validateResponse(const ControlParameters& parameters) const override;
-};
-
-
-/**
- * \ingroup management
- * \brief represents a rib/unregister command
- * \sa http://redmine.named-data.net/projects/nfd/wiki/RibMgmt#Unregister-a-route
- */
-class RibUnregisterCommand : public ControlCommand
-{
-public:
-  RibUnregisterCommand();
-
-  virtual void
-  applyDefaultsToRequest(ControlParameters& parameters) const override;
-
-  virtual void
-  validateResponse(const ControlParameters& parameters) const override;
-};
-
-} // namespace nfd
-} // namespace ndn
-
-#endif // NDN_MANAGEMENT_NFD_CONTROL_COMMAND_HPP
+#include "../mgmt/nfd/control-command.hpp"
diff --git a/src/management/nfd-control-parameters.hpp b/src/management/nfd-control-parameters.hpp
index 92f40b8..a22bc6f 100644
--- a/src/management/nfd-control-parameters.hpp
+++ b/src/management/nfd-control-parameters.hpp
@@ -19,496 +19,7 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#ifndef NDN_MANAGEMENT_NFD_CONTROL_PARAMETERS_HPP
-#define NDN_MANAGEMENT_NFD_CONTROL_PARAMETERS_HPP
-
-#include "../encoding/nfd-constants.hpp"
-#include "../name.hpp"
-#include "../util/time.hpp"
-#include "../mgmt/control-parameters.hpp"
-
-namespace ndn {
-namespace nfd {
-
-/**
- * \ingroup management
+/** \file
+ *  \deprecated Use mgmt/nfd/control-parameters.hpp
  */
-enum ControlParameterField {
-  CONTROL_PARAMETER_NAME,
-  CONTROL_PARAMETER_FACE_ID,
-  CONTROL_PARAMETER_URI,
-  CONTROL_PARAMETER_LOCAL_CONTROL_FEATURE,
-  CONTROL_PARAMETER_ORIGIN,
-  CONTROL_PARAMETER_COST,
-  CONTROL_PARAMETER_FLAGS,
-  CONTROL_PARAMETER_MASK,
-  CONTROL_PARAMETER_STRATEGY,
-  CONTROL_PARAMETER_EXPIRATION_PERIOD,
-  CONTROL_PARAMETER_FACE_PERSISTENCY,
-  CONTROL_PARAMETER_UBOUND
-};
-
-const std::string CONTROL_PARAMETER_FIELD[CONTROL_PARAMETER_UBOUND] = {
-  "Name",
-  "FaceId",
-  "Uri",
-  "LocalControlFeature",
-  "Origin",
-  "Cost",
-  "Flags",
-  "Mask",
-  "Strategy",
-  "ExpirationPeriod",
-  "FacePersistency"
-};
-
-/**
- * \ingroup management
- * \deprecated use Flags+Mask fields instead
- */
-enum LocalControlFeature {
-  LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID = 1,
-  LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID = 2
-};
-
-/**
- * \ingroup management
- * \brief represents parameters in a ControlCommand request or response
- * \sa http://redmine.named-data.net/projects/nfd/wiki/ControlCommand#ControlParameters
- * \details This type is copyable because it's an abstraction of a TLV type.
- */
-class ControlParameters : public ndn::mgmt::ControlParameters
-{
-public:
-  class Error : public tlv::Error
-  {
-  public:
-    explicit
-    Error(const std::string& what)
-      : tlv::Error(what)
-    {
-    }
-  };
-
-  ControlParameters();
-
-  explicit
-  ControlParameters(const Block& block);
-
-  template<encoding::Tag TAG>
-  size_t
-  wireEncode(EncodingImpl<TAG>& encoder) const;
-
-  virtual Block
-  wireEncode() const final;
-
-  virtual void
-  wireDecode(const Block& wire) final;
-
-public: // getters & setters
-  bool
-  hasName() const
-  {
-    return m_hasFields[CONTROL_PARAMETER_NAME];
-  }
-
-  const Name&
-  getName() const
-  {
-    BOOST_ASSERT(this->hasName());
-    return m_name;
-  }
-
-  ControlParameters&
-  setName(const Name& name)
-  {
-    m_wire.reset();
-    m_name = name;
-    m_hasFields[CONTROL_PARAMETER_NAME] = true;
-    return *this;
-  }
-
-  ControlParameters&
-  unsetName()
-  {
-    m_wire.reset();
-    m_hasFields[CONTROL_PARAMETER_NAME] = false;
-    return *this;
-  }
-
-  bool
-  hasFaceId() const
-  {
-    return m_hasFields[CONTROL_PARAMETER_FACE_ID];
-  }
-
-  uint64_t
-  getFaceId() const
-  {
-    BOOST_ASSERT(this->hasFaceId());
-    return m_faceId;
-  }
-
-  ControlParameters&
-  setFaceId(uint64_t faceId)
-  {
-    m_wire.reset();
-    m_faceId = faceId;
-    m_hasFields[CONTROL_PARAMETER_FACE_ID] = true;
-    return *this;
-  }
-
-  ControlParameters&
-  unsetFaceId()
-  {
-    m_wire.reset();
-    m_hasFields[CONTROL_PARAMETER_FACE_ID] = false;
-    return *this;
-  }
-
-  bool
-  hasUri() const
-  {
-    return m_hasFields[CONTROL_PARAMETER_URI];
-  }
-
-  const std::string&
-  getUri() const
-  {
-    BOOST_ASSERT(this->hasUri());
-    return m_uri;
-  }
-
-  ControlParameters&
-  setUri(const std::string& uri)
-  {
-    m_wire.reset();
-    m_uri = uri;
-    m_hasFields[CONTROL_PARAMETER_URI] = true;
-    return *this;
-  }
-
-  ControlParameters&
-  unsetUri()
-  {
-    m_wire.reset();
-    m_hasFields[CONTROL_PARAMETER_URI] = false;
-    return *this;
-  }
-
-  /**
-   * \deprecated use Flags+Mask fields instead
-   */
-  bool
-  hasLocalControlFeature() const
-  {
-    return m_hasFields[CONTROL_PARAMETER_LOCAL_CONTROL_FEATURE];
-  }
-
-  /**
-   * \deprecated use Flags+Mask fields instead
-   */
-  LocalControlFeature
-  getLocalControlFeature() const
-  {
-    BOOST_ASSERT(this->hasLocalControlFeature());
-    return m_localControlFeature;
-  }
-
-  /**
-   * \deprecated use Flags+Mask fields instead
-   */
-  ControlParameters&
-  setLocalControlFeature(LocalControlFeature localControlFeature)
-  {
-    m_wire.reset();
-    m_localControlFeature = localControlFeature;
-    m_hasFields[CONTROL_PARAMETER_LOCAL_CONTROL_FEATURE] = true;
-    return *this;
-  }
-
-  /**
-   * \deprecated use Flags+Mask fields instead
-   */
-  ControlParameters&
-  unsetLocalControlFeature()
-  {
-    m_wire.reset();
-    m_hasFields[CONTROL_PARAMETER_LOCAL_CONTROL_FEATURE] = false;
-    return *this;
-  }
-
-  bool
-  hasOrigin() const
-  {
-    return m_hasFields[CONTROL_PARAMETER_ORIGIN];
-  }
-
-  uint64_t
-  getOrigin() const
-  {
-    BOOST_ASSERT(this->hasOrigin());
-    return m_origin;
-  }
-
-  ControlParameters&
-  setOrigin(uint64_t origin)
-  {
-    m_wire.reset();
-    m_origin = origin;
-    m_hasFields[CONTROL_PARAMETER_ORIGIN] = true;
-    return *this;
-  }
-
-  ControlParameters&
-  unsetOrigin()
-  {
-    m_wire.reset();
-    m_hasFields[CONTROL_PARAMETER_ORIGIN] = false;
-    return *this;
-  }
-
-  bool
-  hasCost() const
-  {
-    return m_hasFields[CONTROL_PARAMETER_COST];
-  }
-
-  uint64_t
-  getCost() const
-  {
-    BOOST_ASSERT(this->hasCost());
-    return m_cost;
-  }
-
-  ControlParameters&
-  setCost(uint64_t cost)
-  {
-    m_wire.reset();
-    m_cost = cost;
-    m_hasFields[CONTROL_PARAMETER_COST] = true;
-    return *this;
-  }
-
-  ControlParameters&
-  unsetCost()
-  {
-    m_wire.reset();
-    m_hasFields[CONTROL_PARAMETER_COST] = false;
-    return *this;
-  }
-
-  bool
-  hasFlags() const
-  {
-    return m_hasFields[CONTROL_PARAMETER_FLAGS];
-  }
-
-  uint64_t
-  getFlags() const
-  {
-    BOOST_ASSERT(this->hasFlags());
-    return m_flags;
-  }
-
-  ControlParameters&
-  setFlags(uint64_t flags)
-  {
-    m_wire.reset();
-    m_flags = flags;
-    m_hasFields[CONTROL_PARAMETER_FLAGS] = true;
-    return *this;
-  }
-
-  ControlParameters&
-  unsetFlags()
-  {
-    m_wire.reset();
-    m_hasFields[CONTROL_PARAMETER_FLAGS] = false;
-    return *this;
-  }
-
-  bool
-  hasMask() const
-  {
-    return m_hasFields[CONTROL_PARAMETER_MASK];
-  }
-
-  uint64_t
-  getMask() const
-  {
-    BOOST_ASSERT(this->hasMask());
-    return m_mask;
-  }
-
-  ControlParameters&
-  setMask(uint64_t mask)
-  {
-    m_wire.reset();
-    m_mask = mask;
-    m_hasFields[CONTROL_PARAMETER_MASK] = true;
-    return *this;
-  }
-
-  ControlParameters&
-  unsetMask()
-  {
-    m_wire.reset();
-    m_hasFields[CONTROL_PARAMETER_MASK] = false;
-    return *this;
-  }
-
-  bool
-  hasStrategy() const
-  {
-    return m_hasFields[CONTROL_PARAMETER_STRATEGY];
-  }
-
-  const Name&
-  getStrategy() const
-  {
-    BOOST_ASSERT(this->hasStrategy());
-    return m_strategy;
-  }
-
-  ControlParameters&
-  setStrategy(const Name& strategy)
-  {
-    m_wire.reset();
-    m_strategy = strategy;
-    m_hasFields[CONTROL_PARAMETER_STRATEGY] = true;
-    return *this;
-  }
-
-  ControlParameters&
-  unsetStrategy()
-  {
-    m_wire.reset();
-    m_hasFields[CONTROL_PARAMETER_STRATEGY] = false;
-    return *this;
-  }
-
-  bool
-  hasExpirationPeriod() const
-  {
-    return m_hasFields[CONTROL_PARAMETER_EXPIRATION_PERIOD];
-  }
-
-  const time::milliseconds&
-  getExpirationPeriod() const
-  {
-    BOOST_ASSERT(this->hasExpirationPeriod());
-    return m_expirationPeriod;
-  }
-
-  ControlParameters&
-  setExpirationPeriod(const time::milliseconds& expirationPeriod)
-  {
-    m_wire.reset();
-    m_expirationPeriod = expirationPeriod;
-    m_hasFields[CONTROL_PARAMETER_EXPIRATION_PERIOD] = true;
-    return *this;
-  }
-
-  ControlParameters&
-  unsetExpirationPeriod()
-  {
-    m_wire.reset();
-    m_hasFields[CONTROL_PARAMETER_EXPIRATION_PERIOD] = false;
-    return *this;
-  }
-
-  bool
-  hasFacePersistency() const
-  {
-    return m_hasFields[CONTROL_PARAMETER_FACE_PERSISTENCY];
-  }
-
-  FacePersistency
-  getFacePersistency() const
-  {
-    BOOST_ASSERT(this->hasFacePersistency());
-    return m_facePersistency;
-  }
-
-  ControlParameters&
-  setFacePersistency(FacePersistency persistency)
-  {
-    m_wire.reset();
-    m_facePersistency = persistency;
-    m_hasFields[CONTROL_PARAMETER_FACE_PERSISTENCY] = true;
-    return *this;
-  }
-
-  ControlParameters&
-  unsetFacePersistency()
-  {
-    m_wire.reset();
-    m_hasFields[CONTROL_PARAMETER_FACE_PERSISTENCY] = false;
-    return *this;
-  }
-
-  const std::vector<bool>&
-  getPresentFields() const
-  {
-    return m_hasFields;
-  }
-
-public: // Flags and Mask helpers
-  /**
-   * \return whether bit is enabled in Mask
-   * \param bit bit position within range [0, 64) (least significant bit is 0)
-   */
-  bool
-  hasFlagBit(size_t bit) const;
-
-  /**
-   * \return bit at a position in Flags
-   * \param bit bit position within range [0, 64) (least significant bit is 0)
-   */
-  bool
-  getFlagBit(size_t bit) const;
-
-  /**
-   * \brief set a bit in Flags
-   * \param bit bit position within range [0, 64) (least significant bit is 0)
-   * \param value new value in Flags
-   * \param wantMask if true, enable the bit in Mask
-   */
-  ControlParameters&
-  setFlagBit(size_t bit, bool value, bool wantMask = true);
-
-  /**
-   * \brief disable a bit in Mask
-   * \param bit bit position within range [0, 64) (least significant bit is 0)
-   * \post If all bits are disabled, Flags and Mask fields are deleted.
-   */
-  ControlParameters&
-  unsetFlagBit(size_t bit);
-
-private: // fields
-  std::vector<bool>   m_hasFields;
-
-  Name                m_name;
-  uint64_t            m_faceId;
-  std::string         m_uri;
-  LocalControlFeature m_localControlFeature;
-  uint64_t            m_origin;
-  uint64_t            m_cost;
-  uint64_t            m_flags;
-  uint64_t            m_mask;
-  Name                m_strategy;
-  time::milliseconds  m_expirationPeriod;
-  FacePersistency     m_facePersistency;
-
-private:
-  mutable Block m_wire;
-};
-
-std::ostream&
-operator<<(std::ostream& os, const ControlParameters& parameters);
-
-} // namespace nfd
-} // namespace ndn
-
-#endif // NDN_MANAGEMENT_NFD_CONTROL_PARAMETERS_HPP
+#include "../mgmt/nfd/control-parameters.hpp"
diff --git a/src/management/nfd-control-response.hpp b/src/management/nfd-control-response.hpp
index 44f2007..74e38f3 100644
--- a/src/management/nfd-control-response.hpp
+++ b/src/management/nfd-control-response.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2013-2015 Regents of the University of California.
+ * Copyright (c) 2013-2016 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -19,17 +19,7 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#ifndef NDN_MANAGEMENT_CONTROL_RESPONSE_HPP
-#define NDN_MANAGEMENT_CONTROL_RESPONSE_HPP
-
-#include "../mgmt/dispatcher.hpp"
-
-namespace ndn {
-namespace nfd {
-
-typedef ndn::mgmt::ControlResponse ControlResponse;
-
-} // namespace nfd
-} // namespace ndn
-
-#endif // NDN_MANAGEMENT_CONTROL_RESPONSE_HPP
+/** \file
+ *  \deprecated Use mgmt/nfd/control-response.hpp
+ */
+#include "../mgmt/nfd/control-response.hpp"
diff --git a/src/management/nfd-controller.hpp b/src/management/nfd-controller.hpp
index 8674a61..b127d57 100644
--- a/src/management/nfd-controller.hpp
+++ b/src/management/nfd-controller.hpp
@@ -19,203 +19,7 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#ifndef NDN_MANAGEMENT_NFD_CONTROLLER_HPP
-#define NDN_MANAGEMENT_NFD_CONTROLLER_HPP
-
-#include "nfd-control-command.hpp"
-#include "nfd-control-response.hpp"
-#include "nfd-status-dataset.hpp"
-#include "nfd-command-options.hpp"
-#include "../security/validator-null.hpp"
-
-namespace ndn {
-
-namespace security {
-class KeyChain;
-class Validator;
-} // namespace security
-class Face;
-
-namespace nfd {
-
-/**
- * \defgroup management Management
- * \brief Classes and data structures to manage NDN forwarder
+/** \file
+ *  \deprecated Use mgmt/nfd/controller.hpp
  */
-
-/**
- * \ingroup management
- * \brief NFD Management protocol client
- * \sa https://redmine.named-data.net/projects/nfd/wiki/Management
- */
-class Controller : noncopyable
-{
-public:
-  /** \brief a callback on command success
-   */
-  typedef function<void(const ControlParameters&)> CommandSucceedCallback;
-
-  /** \brief a callback on command failure
-   */
-  typedef function<void(const ControlResponse&)> CommandFailCallback;
-
-  /** \brief a callback on dataset retrieval failure
-   */
-  typedef function<void(uint32_t code, const std::string& reason)> DatasetFailCallback;
-
-  /** \brief construct a Controller that uses face for transport,
-   *         and uses the passed KeyChain to sign commands
-   */
-  Controller(Face& face, security::KeyChain& keyChain, security::Validator& validator = s_validatorNull);
-
-  /** \brief start command execution
-   */
-  template<typename Command>
-  void
-  start(const ControlParameters& parameters,
-        const CommandSucceedCallback& onSuccess,
-        const CommandFailCallback& onFailure,
-        const CommandOptions& options = CommandOptions())
-  {
-    shared_ptr<ControlCommand> command = make_shared<Command>();
-    this->startCommand(command, parameters, onSuccess, onFailure, options);
-  }
-
-  /** \brief start dataset fetching
-   */
-  template<typename Dataset>
-  typename std::enable_if<std::is_default_constructible<Dataset>::value>::type
-  fetch(const std::function<void(typename Dataset::ResultType)>& onSuccess,
-        const DatasetFailCallback& onFailure,
-        const CommandOptions& options = CommandOptions())
-  {
-    this->fetchDataset(make_shared<Dataset>(), onSuccess, onFailure, options);
-  }
-
-  /** \brief start dataset fetching
-   */
-  template<typename Dataset, typename ParamType = typename Dataset::ParamType>
-  void
-  fetch(const ParamType& param,
-        const std::function<void(typename Dataset::ResultType)>& onSuccess,
-        const DatasetFailCallback& onFailure,
-        const CommandOptions& options = CommandOptions())
-  {
-    this->fetchDataset(make_shared<Dataset>(param), onSuccess, onFailure, options);
-  }
-
-private:
-  void
-  startCommand(const shared_ptr<ControlCommand>& command,
-               const ControlParameters& parameters,
-               const CommandSucceedCallback& onSuccess,
-               const CommandFailCallback& onFailure,
-               const CommandOptions& options);
-
-  void
-  processCommandResponse(const Data& data,
-                         const shared_ptr<ControlCommand>& command,
-                         const CommandSucceedCallback& onSuccess,
-                         const CommandFailCallback& onFailure);
-
-  void
-  processValidatedCommandResponse(const Data& data,
-                                  const shared_ptr<ControlCommand>& command,
-                                  const CommandSucceedCallback& onSuccess,
-                                  const CommandFailCallback& onFailure);
-
-  template<typename Dataset>
-  void
-  fetchDataset(shared_ptr<Dataset> dataset,
-               const std::function<void(typename Dataset::ResultType)>& onSuccess,
-               const DatasetFailCallback& onFailure,
-               const CommandOptions& options);
-
-  void
-  fetchDataset(const Name& prefix,
-               const std::function<void(const ConstBufferPtr&)>& processResponse,
-               const DatasetFailCallback& onFailure,
-               const CommandOptions& options);
-
-  template<typename Dataset>
-  void
-  processDatasetResponse(shared_ptr<Dataset> dataset,
-                         const std::function<void(typename Dataset::ResultType)>& onSuccess,
-                         const DatasetFailCallback& onFailure,
-                         ConstBufferPtr payload);
-
-  void
-  processDatasetFetchError(const DatasetFailCallback& onFailure, uint32_t code, std::string msg);
-
-public:
-  /** \brief error code for timeout
-   */
-  static const uint32_t ERROR_TIMEOUT;
-
-  /** \brief error code for network Nack
-   */
-  static const uint32_t ERROR_NACK;
-
-  /** \brief error code for response validation failure
-   */
-  static const uint32_t ERROR_VALIDATION;
-
-  /** \brief error code for server error
-   */
-  static const uint32_t ERROR_SERVER;
-
-  /** \brief inclusive lower bound of error codes
-   */
-  static const uint32_t ERROR_LBOUND;
-
-protected:
-  Face& m_face;
-  security::KeyChain& m_keyChain;
-  security::Validator& m_validator;
-
-private:
-  static ValidatorNull s_validatorNull;
-};
-
-template<typename Dataset>
-inline void
-Controller::fetchDataset(shared_ptr<Dataset> dataset,
-                         const std::function<void(typename Dataset::ResultType)>& onSuccess1,
-                         const DatasetFailCallback& onFailure1,
-                         const CommandOptions& options)
-{
-  const std::function<void(typename Dataset::ResultType)>& onSuccess = onSuccess1 ?
-    onSuccess1 : [] (const typename Dataset::ResultType&) {};
-  const DatasetFailCallback& onFailure = onFailure1 ?
-    onFailure1 : [] (uint32_t, const std::string&) {};
-
-  Name prefix = dataset->getDatasetPrefix(options.getPrefix());
-  this->fetchDataset(prefix,
-                     bind(&Controller::processDatasetResponse<Dataset>, this, dataset, onSuccess, onFailure, _1),
-                     onFailure,
-                     options);
-}
-
-template<typename Dataset>
-inline void
-Controller::processDatasetResponse(shared_ptr<Dataset> dataset,
-                                   const std::function<void(typename Dataset::ResultType)>& onSuccess,
-                                   const DatasetFailCallback& onFailure,
-                                   ConstBufferPtr payload)
-{
-  typename Dataset::ResultType result;
-  try {
-    result = dataset->parseResult(payload);
-  }
-  catch (const tlv::Error& e) {
-    onFailure(ERROR_SERVER, e.what());
-    return;
-  }
-
-  onSuccess(result);
-}
-
-} // namespace nfd
-} // namespace ndn
-
-#endif // NDN_MANAGEMENT_NFD_CONTROLLER_HPP
+#include "../mgmt/nfd/controller.hpp"
diff --git a/src/management/nfd-face-event-notification.hpp b/src/management/nfd-face-event-notification.hpp
index 56325ef..3749390 100644
--- a/src/management/nfd-face-event-notification.hpp
+++ b/src/management/nfd-face-event-notification.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2013-2015 Regents of the University of California.
+ * Copyright (c) 2013-2016 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -19,76 +19,7 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#ifndef NDN_MANAGEMENT_NFD_FACE_EVENT_NOTIFICATION_HPP
-#define NDN_MANAGEMENT_NFD_FACE_EVENT_NOTIFICATION_HPP
-
-#include "nfd-face-traits.hpp"
-#include "../encoding/block.hpp"
-
-namespace ndn {
-namespace nfd {
-
-/**
- * \ingroup management
+/** \file
+ *  \deprecated Use mgmt/nfd/face-event-notification.hpp
  */
-enum FaceEventKind {
-  FACE_EVENT_CREATED = 1,
-  FACE_EVENT_DESTROYED = 2
-};
-
-/**
- * \ingroup management
- * \brief represents a Face status change notification
- * \sa http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Face-Status-Change-Notification
- */
-class FaceEventNotification : public FaceTraits<FaceEventNotification>
-{
-public:
-  FaceEventNotification();
-
-  explicit
-  FaceEventNotification(const Block& block);
-
-  /** \brief prepend FaceEventNotification to the encoder
-   */
-  template<encoding::Tag TAG>
-  size_t
-  wireEncode(EncodingImpl<TAG>& encoder) const;
-
-  /** \brief encode FaceEventNotification
-   */
-  const Block&
-  wireEncode() const;
-
-  /** \brief decode FaceEventNotification
-   */
-  void
-  wireDecode(const Block& wire);
-
-public: // getters & setters
-  FaceEventKind
-  getKind() const
-  {
-    return m_kind;
-  }
-
-  FaceEventNotification&
-  setKind(FaceEventKind kind);
-
-protected:
-  void
-  wireReset() const;
-
-private:
-  FaceEventKind m_kind;
-
-  mutable Block m_wire;
-};
-
-std::ostream&
-operator<<(std::ostream& os, const FaceEventNotification& notification);
-
-} // namespace nfd
-} // namespace ndn
-
-#endif // NDN_MANAGEMENT_NFD_FACE_EVENT_NOTIFICATION_HPP
+#include "../mgmt/nfd/face-event-notification.hpp"
diff --git a/src/management/nfd-face-monitor.hpp b/src/management/nfd-face-monitor.hpp
index da6e510..f6bc943 100644
--- a/src/management/nfd-face-monitor.hpp
+++ b/src/management/nfd-face-monitor.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2013-2014 Regents of the University of California.
+ * Copyright (c) 2013-2016 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -19,54 +19,7 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-/**
- * Original copyright notice from NFD:
- *
- * Copyright (c) 2014,  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/>.
+/** \file
+ *  \deprecated Use mgmt/nfd/face-monitor.hpp
  */
-
-#ifndef NDN_MANAGEMENT_NFD_FACE_MONITOR_HPP
-#define NDN_MANAGEMENT_NFD_FACE_MONITOR_HPP
-
-#include "../util/notification-subscriber.hpp"
-#include "nfd-face-event-notification.hpp"
-
-namespace ndn {
-namespace nfd {
-
-/** \brief A subscriber for Face status change notification stream
- *  \sa http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Face-Status-Change-Notification
- */
-class FaceMonitor : public util::NotificationSubscriber<FaceEventNotification>
-{
-public:
-  FaceMonitor(Face& face)
-    : NotificationSubscriber<nfd::FaceEventNotification>(face, "ndn:/localhost/nfd/faces/events")
-  {
-  }
-};
-
-} // namespace nfd
-} // namespace ndn
-
-#endif // NDN_MANAGEMENT_NFD_FACE_MONITOR_HPP
+#include "../mgmt/nfd/face-monitor.hpp"
diff --git a/src/management/nfd-face-query-filter.hpp b/src/management/nfd-face-query-filter.hpp
index 30ea386..345af3e 100644
--- a/src/management/nfd-face-query-filter.hpp
+++ b/src/management/nfd-face-query-filter.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2013-2015 Regents of the University of California.
+ * Copyright (c) 2013-2016 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -19,213 +19,7 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#ifndef NDN_MANAGEMENT_NFD_FACE_QUERY_FILTER_HPP
-#define NDN_MANAGEMENT_NFD_FACE_QUERY_FILTER_HPP
-
-#include "../encoding/block.hpp"
-#include "../encoding/nfd-constants.hpp"
-
-namespace ndn {
-namespace nfd {
-
-/**
- * \ingroup management
- * \brief represents Face Query Filter
- * \sa http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Query-Operation
+/** \file
+ *  \deprecated Use mgmt/nfd/face-query-filter.hpp
  */
-class FaceQueryFilter
-{
-public:
-  class Error : public tlv::Error
-  {
-  public:
-    explicit
-    Error(const std::string& what)
-      : tlv::Error(what)
-    {
-    }
-  };
-
-  FaceQueryFilter();
-
-  explicit
-  FaceQueryFilter(const Block& block);
-
-  /** \brief prepend FaceQueryFilter to the encoder
-   */
-  template<encoding::Tag TAG>
-  size_t
-  wireEncode(EncodingImpl<TAG>& encoder) const;
-
-  /** \brief encode FaceQueryFilter
-   */
-  const Block&
-  wireEncode() const;
-
-  /** \brief decode FaceQueryFilter
-   */
-  void
-  wireDecode(const Block& wire);
-
-public: // getters & setters
-
-  bool
-  hasFaceId() const
-  {
-    return m_hasFaceId;
-  }
-
-  uint64_t
-  getFaceId() const
-  {
-    BOOST_ASSERT(this->hasFaceId());
-    return m_faceId;
-  }
-
-  FaceQueryFilter&
-  setFaceId(uint64_t faceId);
-
-  FaceQueryFilter&
-  unsetFaceId();
-
-  bool
-  hasUriScheme() const
-  {
-    return m_hasUriScheme;
-  }
-
-  const std::string&
-  getUriScheme() const
-  {
-    BOOST_ASSERT(this->hasUriScheme());
-    return m_uriScheme;
-  }
-
-  FaceQueryFilter&
-  setUriScheme(const std::string& uriScheme);
-
-  FaceQueryFilter&
-  unsetUriScheme();
-
-  bool
-  hasRemoteUri() const
-  {
-    return m_hasRemoteUri;
-  }
-
-  const std::string&
-  getRemoteUri() const
-  {
-    BOOST_ASSERT(this->hasRemoteUri());
-    return m_remoteUri;
-  }
-
-  FaceQueryFilter&
-  setRemoteUri(const std::string& remoteUri);
-
-  FaceQueryFilter&
-  unsetRemoteUri();
-
-  bool
-  hasLocalUri() const
-  {
-    return m_hasLocalUri;
-  }
-
-  const std::string&
-  getLocalUri() const
-  {
-    BOOST_ASSERT(this->hasLocalUri());
-    return m_localUri;
-  }
-
-  FaceQueryFilter&
-  setLocalUri(const std::string& localUri);
-
-  FaceQueryFilter&
-  unsetLocalUri();
-
-  bool
-  hasFaceScope() const
-  {
-    return m_hasFaceScope;
-  }
-
-  FaceScope
-  getFaceScope() const
-  {
-    BOOST_ASSERT(this->hasFaceScope());
-    return m_faceScope;
-  }
-
-  FaceQueryFilter&
-  setFaceScope(FaceScope faceScope);
-
-  FaceQueryFilter&
-  unsetFaceScope();
-
-  bool
-  hasFacePersistency() const
-  {
-    return m_hasFacePersistency;
-  }
-
-  FacePersistency
-  getFacePersistency() const
-  {
-    BOOST_ASSERT(this->hasFacePersistency());
-    return m_facePersistency;
-  }
-
-  FaceQueryFilter&
-  setFacePersistency(FacePersistency facePersistency);
-
-  FaceQueryFilter&
-  unsetFacePersistency();
-
-  bool
-  hasLinkType() const
-  {
-    return m_hasLinkType;
-  }
-
-  LinkType
-  getLinkType() const
-  {
-    BOOST_ASSERT(this->hasLinkType());
-    return m_linkType;
-  }
-
-  FaceQueryFilter&
-  setLinkType(LinkType linkType);
-
-  FaceQueryFilter&
-  unsetLinkType();
-
-private:
-  uint64_t m_faceId;
-  std::string m_uriScheme;
-  std::string m_remoteUri;
-  std::string m_localUri;
-  FaceScope m_faceScope;
-  FacePersistency m_facePersistency;
-  LinkType m_linkType;
-
-  bool m_hasFaceId;
-  bool m_hasUriScheme;
-  bool m_hasRemoteUri;
-  bool m_hasLocalUri;
-  bool m_hasFaceScope;
-  bool m_hasFacePersistency;
-  bool m_hasLinkType;
-
-  mutable Block m_wire;
-};
-
-std::ostream&
-operator<<(std::ostream& os, const FaceQueryFilter& filter);
-
-} // namespace nfd
-} // namespace ndn
-
-#endif // NDN_MANAGEMENT_NFD_FACE_QUERY_FILTER_HPP
+#include "../mgmt/nfd/face-query-filter.hpp"
diff --git a/src/management/nfd-face-status.hpp b/src/management/nfd-face-status.hpp
index 521f3d3..13e4919 100644
--- a/src/management/nfd-face-status.hpp
+++ b/src/management/nfd-face-status.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2013-2015 Regents of the University of California.
+ * Copyright (c) 2013-2016 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -19,157 +19,7 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#ifndef NDN_MANAGEMENT_NFD_FACE_STATUS_HPP
-#define NDN_MANAGEMENT_NFD_FACE_STATUS_HPP
-
-#include "nfd-face-traits.hpp" // include this first, to ensure it compiles on its own.
-#include "../encoding/block.hpp"
-#include "../util/time.hpp"
-
-namespace ndn {
-namespace nfd {
-
-/**
- * \ingroup management
- * \brief represents Face status
- * \sa http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Face-Dataset
+/** \file
+ *  \deprecated Use mgmt/nfd/face-status.hpp
  */
-class FaceStatus : public FaceTraits<FaceStatus>
-{
-public:
-  FaceStatus();
-
-  explicit
-  FaceStatus(const Block& block);
-
-  /** \brief prepend FaceStatus to the encoder
-   */
-  template<encoding::Tag TAG>
-  size_t
-  wireEncode(EncodingImpl<TAG>& encoder) const;
-
-  /** \brief encode FaceStatus
-   */
-  const Block&
-  wireEncode() const;
-
-  /** \brief decode FaceStatus
-   */
-  void
-  wireDecode(const Block& wire);
-
-public: // getters & setters
-  bool
-  hasExpirationPeriod() const
-  {
-    return m_hasExpirationPeriod;
-  }
-
-  const time::milliseconds&
-  getExpirationPeriod() const
-  {
-    BOOST_ASSERT(m_hasExpirationPeriod);
-    return m_expirationPeriod;
-  }
-
-  FaceStatus&
-  setExpirationPeriod(const time::milliseconds& expirationPeriod);
-
-  uint64_t
-  getNInInterests() const
-  {
-    return m_nInInterests;
-  }
-
-  FaceStatus&
-  setNInInterests(uint64_t nInInterests);
-
-  uint64_t
-  getNInDatas() const
-  {
-    return m_nInDatas;
-  }
-
-  FaceStatus&
-  setNInDatas(uint64_t nInDatas);
-
-  uint64_t
-  getNInNacks() const
-  {
-    return m_nInNacks;
-  }
-
-  FaceStatus&
-  setNInNacks(uint64_t nInNacks);
-
-  uint64_t
-  getNOutInterests() const
-  {
-    return m_nOutInterests;
-  }
-
-  FaceStatus&
-  setNOutInterests(uint64_t nOutInterests);
-
-  uint64_t
-  getNOutDatas() const
-  {
-    return m_nOutDatas;
-  }
-
-  FaceStatus&
-  setNOutDatas(uint64_t nOutDatas);
-
-  uint64_t
-  getNOutNacks() const
-  {
-    return m_nOutNacks;
-  }
-
-  FaceStatus&
-  setNOutNacks(uint64_t nOutNacks);
-
-  uint64_t
-  getNInBytes() const
-  {
-    return m_nInBytes;
-  }
-
-  FaceStatus&
-  setNInBytes(uint64_t nInBytes);
-
-  uint64_t
-  getNOutBytes() const
-  {
-    return m_nOutBytes;
-  }
-
-  FaceStatus&
-  setNOutBytes(uint64_t nOutBytes);
-
-protected:
-  void
-  wireReset() const;
-
-private:
-  time::milliseconds m_expirationPeriod;
-  bool m_hasExpirationPeriod;
-  uint64_t m_nInInterests;
-  uint64_t m_nInDatas;
-  uint64_t m_nInNacks;
-  uint64_t m_nOutInterests;
-  uint64_t m_nOutDatas;
-  uint64_t m_nOutNacks;
-  uint64_t m_nInBytes;
-  uint64_t m_nOutBytes;
-
-  mutable Block m_wire;
-};
-
-std::ostream&
-operator<<(std::ostream& os, const FaceStatus& status);
-
-} // namespace nfd
-} // namespace ndn
-
-#endif // NDN_MANAGEMENT_NFD_FACE_STATUS_HPP
+#include "../mgmt/nfd/face-status.hpp"
diff --git a/src/management/nfd-face-traits.hpp b/src/management/nfd-face-traits.hpp
index f473d8a..914c4d5 100644
--- a/src/management/nfd-face-traits.hpp
+++ b/src/management/nfd-face-traits.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2013-2014 Regents of the University of California.
+ * Copyright (c) 2013-2016 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -19,139 +19,7 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#ifndef NDN_MANAGEMENT_NFD_FACE_TRAITS_HPP
-#define NDN_MANAGEMENT_NFD_FACE_TRAITS_HPP
-
-#include "../encoding/tlv-nfd.hpp"
-
-namespace ndn {
-namespace nfd {
-
-/** \ingroup management
- *  \brief providers getters and setters of face information fields
- *  \tparam C the concrete class; it must provide .wireReset() method
-            to clear wire encoding when a field changes
+/** \file
+ *  \deprecated Use mgmt/nfd/face-traits.hpp
  */
-template<class C>
-class FaceTraits
-{
-public:
-  class Error : public tlv::Error
-  {
-  public:
-    explicit
-    Error(const std::string& what)
-      : tlv::Error(what)
-    {
-    }
-  };
-
-  FaceTraits()
-    : m_faceId(0)
-    , m_faceScope(FACE_SCOPE_NON_LOCAL)
-    , m_facePersistency(FACE_PERSISTENCY_PERSISTENT)
-    , m_linkType(LINK_TYPE_POINT_TO_POINT)
-  {
-  }
-
-  uint64_t
-  getFaceId() const
-  {
-    return m_faceId;
-  }
-
-  C&
-  setFaceId(uint64_t faceId)
-  {
-    wireReset();
-    m_faceId = faceId;
-    return static_cast<C&>(*this);
-  }
-
-  const std::string&
-  getRemoteUri() const
-  {
-    return m_remoteUri;
-  }
-
-  C&
-  setRemoteUri(const std::string& remoteUri)
-  {
-    wireReset();
-    m_remoteUri = remoteUri;
-    return static_cast<C&>(*this);
-  }
-
-  const std::string&
-  getLocalUri() const
-  {
-    return m_localUri;
-  }
-
-  C&
-  setLocalUri(const std::string& localUri)
-  {
-    wireReset();
-    m_localUri = localUri;
-    return static_cast<C&>(*this);
-  }
-
-  FaceScope
-  getFaceScope() const
-  {
-    return m_faceScope;
-  }
-
-  C&
-  setFaceScope(FaceScope faceScope)
-  {
-    wireReset();
-    m_faceScope = faceScope;
-    return static_cast<C&>(*this);
-  }
-
-  FacePersistency
-  getFacePersistency() const
-  {
-    return m_facePersistency;
-  }
-
-  C&
-  setFacePersistency(FacePersistency facePersistency)
-  {
-    wireReset();
-    m_facePersistency = facePersistency;
-    return static_cast<C&>(*this);
-  }
-
-  LinkType
-  getLinkType() const
-  {
-    return m_linkType;
-  }
-
-  C&
-  setLinkType(LinkType linkType)
-  {
-    wireReset();
-    m_linkType = linkType;
-    return static_cast<C&>(*this);
-  }
-
-protected:
-  virtual void
-  wireReset() const = 0;
-
-protected:
-  uint64_t m_faceId;
-  std::string m_remoteUri;
-  std::string m_localUri;
-  FaceScope m_faceScope;
-  FacePersistency  m_facePersistency;
-  LinkType m_linkType;
-};
-
-} // namespace nfd
-} // namespace ndn
-
-#endif // NDN_MANAGEMENT_NFD_FACE_TRAITS_HPP
+#include "../mgmt/nfd/face-traits.hpp"
diff --git a/src/management/nfd-fib-entry.hpp b/src/management/nfd-fib-entry.hpp
index f1f3003..5f3a4c3 100644
--- a/src/management/nfd-fib-entry.hpp
+++ b/src/management/nfd-fib-entry.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2013-2015 Regents of the University of California.
+ * Copyright (c) 2013-2016 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -19,137 +19,7 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#ifndef NDN_MANAGEMENT_NFD_FIB_ENTRY_HPP
-#define NDN_MANAGEMENT_NFD_FIB_ENTRY_HPP
-
-#include "../encoding/block.hpp"
-#include "../name.hpp"
-#include <list>
-
-namespace ndn {
-namespace nfd {
-
-/** @ingroup management
+/** \file
+ *  \deprecated Use mgmt/nfd/fib-entry.hpp
  */
-class NextHopRecord
-{
-public:
-  class Error : public tlv::Error
-  {
-  public:
-    explicit
-    Error(const std::string& what)
-      : tlv::Error(what)
-    {
-    }
-  };
-
-  NextHopRecord();
-
-  explicit
-  NextHopRecord(const Block& block);
-
-  uint64_t
-  getFaceId() const
-  {
-    return m_faceId;
-  }
-
-  NextHopRecord&
-  setFaceId(uint64_t faceId);
-
-  uint64_t
-  getCost() const
-  {
-    return m_cost;
-  }
-
-  NextHopRecord&
-  setCost(uint64_t cost);
-
-  template<encoding::Tag TAG>
-  size_t
-  wireEncode(EncodingImpl<TAG>& block) const;
-
-  const Block&
-  wireEncode() const;
-
-  void
-  wireDecode(const Block& wire);
-
-private:
-  uint64_t m_faceId;
-  uint64_t m_cost;
-
-  mutable Block m_wire;
-};
-
-/** @ingroup management
- */
-class FibEntry
-{
-public:
-  class Error : public tlv::Error
-  {
-  public:
-    explicit
-    Error(const std::string& what)
-      : tlv::Error(what)
-    {
-    }
-  };
-
-  FibEntry();
-
-  explicit
-  FibEntry(const Block& block);
-
-  const Name&
-  getPrefix() const
-  {
-    return m_prefix;
-  }
-
-  FibEntry&
-  setPrefix(const Name& prefix);
-
-  const std::list<NextHopRecord>&
-  getNextHopRecords() const
-  {
-    return m_nextHopRecords;
-  }
-
-  FibEntry&
-  addNextHopRecord(const NextHopRecord& nextHopRecord);
-
-  template<typename T>
-  FibEntry&
-  setNextHopRecords(const T& begin, const T& end)
-  {
-    m_nextHopRecords.clear();
-    m_nextHopRecords.assign(begin, end);
-    m_wire.reset();
-    return *this;
-  }
-
-  template<encoding::Tag TAG>
-  size_t
-  wireEncode(EncodingImpl<TAG>& block) const;
-
-  const Block&
-  wireEncode() const;
-
-  void
-  wireDecode(const Block& wire);
-
-private:
-  Name m_prefix;
-  std::list<NextHopRecord> m_nextHopRecords;
-
-  mutable Block m_wire;
-};
-
-} // namespace nfd
-} // namespace ndn
-
-#endif // NDN_MANAGEMENT_NFD_FIB_ENTRY_HPP
+#include "../mgmt/nfd/fib-entry.hpp"
diff --git a/src/management/nfd-forwarder-status.hpp b/src/management/nfd-forwarder-status.hpp
index 7083cb6..ca9a944 100644
--- a/src/management/nfd-forwarder-status.hpp
+++ b/src/management/nfd-forwarder-status.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2013-2015 Regents of the University of California.
+ * Copyright (c) 2013-2016 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -19,207 +19,7 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#ifndef NDN_MANAGEMENT_NFD_FORWARDER_STATUS_HPP
-#define NDN_MANAGEMENT_NFD_FORWARDER_STATUS_HPP
-
-#include "../encoding/block.hpp"
-#include "../util/time.hpp"
-
-namespace ndn {
-namespace nfd {
-
-/**
- * \ingroup management
- * \brief represents NFD Forwarder Status
- * \sa http://redmine.named-data.net/projects/nfd/wiki/ForwarderStatus
+/** \file
+ *  \deprecated Use mgmt/nfd/forwarder-status.hpp
  */
-class ForwarderStatus
-{
-public:
-  class Error : public tlv::Error
-  {
-  public:
-    explicit
-    Error(const std::string& what)
-      : tlv::Error(what)
-    {
-    }
-  };
-
-  ForwarderStatus();
-
-  explicit
-  ForwarderStatus(const Block& payload);
-
-  /** \brief prepend ForwarderStatus as a Content block to the encoder
-   *
-   *  The outermost Content element isn't part of ForwardStatus structure.
-   */
-  template<encoding::Tag TAG>
-  size_t
-  wireEncode(EncodingImpl<TAG>& encoder) const;
-
-  /** \brief encode ForwarderStatus as a Content block
-   *
-   *  The outermost Content element isn't part of ForwardStatus structure.
-   */
-  const Block&
-  wireEncode() const;
-
-  /** \brief decode ForwarderStatus from a Content block
-   *
-   *  The outermost Content element isn't part of ForwardStatus structure.
-   */
-  void
-  wireDecode(const Block& wire);
-
-public: // getters & setters
-  const std::string&
-  getNfdVersion() const
-  {
-    return m_nfdVersion;
-  }
-
-  ForwarderStatus&
-  setNfdVersion(const std::string& nfdVersion);
-
-  const time::system_clock::TimePoint&
-  getStartTimestamp() const
-  {
-    return m_startTimestamp;
-  }
-
-  ForwarderStatus&
-  setStartTimestamp(const time::system_clock::TimePoint& startTimestamp);
-
-  const time::system_clock::TimePoint&
-  getCurrentTimestamp() const
-  {
-    return m_currentTimestamp;
-  }
-
-  ForwarderStatus&
-  setCurrentTimestamp(const time::system_clock::TimePoint& currentTimestamp);
-
-  size_t
-  getNNameTreeEntries() const
-  {
-    return m_nNameTreeEntries;
-  }
-
-  ForwarderStatus&
-  setNNameTreeEntries(size_t nNameTreeEntries);
-
-  size_t
-  getNFibEntries() const
-  {
-    return m_nFibEntries;
-  }
-
-  ForwarderStatus&
-  setNFibEntries(size_t nFibEntries);
-
-  size_t
-  getNPitEntries() const
-  {
-    return m_nPitEntries;
-  }
-
-  ForwarderStatus&
-  setNPitEntries(size_t nPitEntries);
-
-  size_t
-  getNMeasurementsEntries() const
-  {
-    return m_nMeasurementsEntries;
-  }
-
-  ForwarderStatus&
-  setNMeasurementsEntries(size_t nMeasurementsEntries);
-
-  size_t
-  getNCsEntries() const
-  {
-    return m_nCsEntries;
-  }
-
-  ForwarderStatus&
-  setNCsEntries(size_t nCsEntries);
-
-  uint64_t
-  getNInInterests() const
-  {
-    return m_nInInterests;
-  }
-
-  ForwarderStatus&
-  setNInInterests(uint64_t nInInterests);
-
-  uint64_t
-  getNInDatas() const
-  {
-    return m_nInDatas;
-  }
-
-  ForwarderStatus&
-  setNInDatas(uint64_t nInDatas);
-
-  uint64_t
-  getNInNacks() const
-  {
-    return m_nInNacks;
-  }
-
-  ForwarderStatus&
-  setNInNacks(uint64_t nInNacks);
-
-  uint64_t
-  getNOutInterests() const
-  {
-    return m_nOutInterests;
-  }
-
-  ForwarderStatus&
-  setNOutInterests(uint64_t nOutInterests);
-
-  uint64_t
-  getNOutDatas() const
-  {
-    return m_nOutDatas;
-  }
-
-  ForwarderStatus&
-  setNOutDatas(uint64_t nOutDatas);
-
-  uint64_t
-  getNOutNacks() const
-  {
-    return m_nOutNacks;
-  }
-
-  ForwarderStatus&
-  setNOutNacks(uint64_t nOutNacks);
-
-private:
-  std::string m_nfdVersion;
-  time::system_clock::TimePoint m_startTimestamp;
-  time::system_clock::TimePoint m_currentTimestamp;
-  size_t m_nNameTreeEntries;
-  size_t m_nFibEntries;
-  size_t m_nPitEntries;
-  size_t m_nMeasurementsEntries;
-  size_t m_nCsEntries;
-  uint64_t m_nInInterests;
-  uint64_t m_nInDatas;
-  uint64_t m_nInNacks;
-  uint64_t m_nOutInterests;
-  uint64_t m_nOutDatas;
-  uint64_t m_nOutNacks;
-
-  mutable Block m_wire;
-};
-
-} // namespace nfd
-} // namespace ndn
-
-#endif // NDN_MANAGEMENT_NFD_FORWARDER_STATUS_HPP
+#include "../mgmt/nfd/forwarder-status.hpp"
diff --git a/src/management/nfd-rib-entry.hpp b/src/management/nfd-rib-entry.hpp
index ad5fe92..2673e6c 100644
--- a/src/management/nfd-rib-entry.hpp
+++ b/src/management/nfd-rib-entry.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2013-2015 Regents of the University of California.
+ * Copyright (c) 2013-2016 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -19,269 +19,7 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#ifndef NDN_MANAGEMENT_NFD_RIB_ENTRY_HPP
-#define NDN_MANAGEMENT_NFD_RIB_ENTRY_HPP
-
-#include "nfd-rib-flags.hpp" // include this first, to ensure it compiles on its own.
-#include "../name.hpp"
-#include "../util/time.hpp"
-
-#include <list>
-
-namespace ndn {
-namespace nfd {
-
-/**
- * @ingroup management
- *
- * @brief Data abstraction for Route
- *
- * A route indicates the availability of content via a certain face and
- * provides meta-information about the face.
- *
- *     Route := ROUTE-TYPE TLV-LENGTH
- *                FaceId
- *                Origin
- *                Cost
- *                Flags
- *                ExpirationPeriod?
- *
- * @sa http://redmine.named-data.net/projects/nfd/wiki/RibMgmt
+/** \file
+ *  \deprecated Use mgmt/nfd/rib-entry.hpp
  */
-class Route : public RibFlagsTraits<Route>
-{
-public:
-  class Error : public tlv::Error
-  {
-  public:
-    explicit
-    Error(const std::string& what) : tlv::Error(what)
-    {
-    }
-  };
-
-  Route();
-
-  explicit
-  Route(const Block& block);
-
-  uint64_t
-  getFaceId() const
-  {
-    return m_faceId;
-  }
-
-  Route&
-  setFaceId(uint64_t faceId)
-  {
-    m_faceId = faceId;
-    m_wire.reset();
-    return *this;
-  }
-
-  uint64_t
-  getOrigin() const
-  {
-    return m_origin;
-  }
-
-  /** @brief set Origin
-   *  @param origin a code defined in ndn::nfd::RouteOrigin
-   */
-  Route&
-  setOrigin(uint64_t origin)
-  {
-    m_origin = origin;
-    m_wire.reset();
-    return *this;
-  }
-
-  uint64_t
-  getCost() const
-  {
-    return m_cost;
-  }
-
-  Route&
-  setCost(uint64_t cost)
-  {
-    m_cost = cost;
-    m_wire.reset();
-    return *this;
-  }
-
-  uint64_t
-  getFlags() const
-  {
-    return m_flags;
-  }
-
-  /** @brief set route inheritance flags
-   *  @param flags a bitwise OR'ed code from ndn::nfd::RouteFlags
-   */
-  Route&
-  setFlags(uint64_t flags)
-  {
-    m_flags = flags;
-    m_wire.reset();
-    return *this;
-  }
-
-  static const time::milliseconds INFINITE_EXPIRATION_PERIOD;
-
-  const time::milliseconds&
-  getExpirationPeriod() const
-  {
-    return m_expirationPeriod;
-  }
-
-  Route&
-  setExpirationPeriod(const time::milliseconds& expirationPeriod)
-  {
-    m_expirationPeriod = expirationPeriod;
-
-    m_hasInfiniteExpirationPeriod = m_expirationPeriod == INFINITE_EXPIRATION_PERIOD;
-
-    m_wire.reset();
-    return *this;
-  }
-
-  bool
-  hasInfiniteExpirationPeriod() const
-  {
-    return m_hasInfiniteExpirationPeriod;
-  }
-
-  template<encoding::Tag TAG>
-  size_t
-  wireEncode(EncodingImpl<TAG>& block) const;
-
-  const Block&
-  wireEncode() const;
-
-  void
-  wireDecode(const Block& wire);
-
-private:
-  uint64_t m_faceId;
-  uint64_t m_origin;
-  uint64_t m_cost;
-  uint64_t m_flags;
-  time::milliseconds m_expirationPeriod;
-  bool m_hasInfiniteExpirationPeriod;
-
-  mutable Block m_wire;
-};
-
-std::ostream&
-operator<<(std::ostream& os, const Route& route);
-
-/**
- * @ingroup management
- *
- * @brief Data abstraction for RIB entry
- *
- * A RIB entry contains one or more routes for the name prefix
- *
- *     RibEntry := RIB-ENTRY-TYPE TLV-LENGTH
- *                Name
- *                Route+
- *
- * @sa http://redmine.named-data.net/projects/nfd/wiki/RibMgmt
- */
-class RibEntry
-{
-public:
-  class Error : public tlv::Error
-  {
-  public:
-    Error(const std::string& what) : tlv::Error(what)
-    {
-    }
-  };
-
-  typedef std::list<Route> RouteList;
-  typedef RouteList::const_iterator iterator;
-
-  RibEntry();
-
-  explicit
-  RibEntry(const Block& block);
-
-  const Name&
-  getName() const
-  {
-    return m_prefix;
-  }
-
-  RibEntry&
-  setName(const Name& prefix)
-  {
-    m_prefix = prefix;
-    m_wire.reset();
-    return *this;
-  }
-
-  const std::list<Route>&
-  getRoutes() const
-  {
-    return m_routes;
-  }
-
-  RibEntry&
-  addRoute(const Route& route)
-  {
-    m_routes.push_back(route);
-    m_wire.reset();
-    return *this;
-  }
-
-  RibEntry&
-  clearRoutes()
-  {
-    m_routes.clear();
-    return *this;
-  }
-
-  template<encoding::Tag TAG>
-  size_t
-  wireEncode(EncodingImpl<TAG>& block) const;
-
-  const Block&
-  wireEncode() const;
-
-  void
-  wireDecode(const Block& wire);
-
-  iterator
-  begin() const;
-
-  iterator
-  end() const;
-
-private:
-  Name m_prefix;
-  RouteList m_routes;
-
-  mutable Block m_wire;
-};
-
-inline RibEntry::iterator
-RibEntry::begin() const
-{
-  return m_routes.begin();
-}
-
-inline RibEntry::iterator
-RibEntry::end() const
-{
-  return m_routes.end();
-}
-
-std::ostream&
-operator<<(std::ostream& os, const RibEntry& entry);
-
-} // namespace nfd
-} // namespace ndn
-
-#endif // NDN_MANAGEMENT_NFD_RIB_ENTRY_HPP
+#include "../mgmt/nfd/rib-entry.hpp"
diff --git a/src/management/nfd-rib-flags.hpp b/src/management/nfd-rib-flags.hpp
index 07e36d1..8a15a34 100644
--- a/src/management/nfd-rib-flags.hpp
+++ b/src/management/nfd-rib-flags.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2013-2014 Regents of the University of California.
+ * Copyright (c) 2013-2016 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -19,39 +19,7 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#ifndef NDN_MANAGEMENT_NFD_RIB_FLAGS_HPP
-#define NDN_MANAGEMENT_NFD_RIB_FLAGS_HPP
-
-#include "../encoding/nfd-constants.hpp"
-
-namespace ndn {
-namespace nfd {
-
-/**
- * \ingroup management
- * \brief implements getters to each RIB flag
- *
- * \tparam T class containing a RibFlags field and implements
- *           `RibFlags getFlags() const` method
+/** \file
+ *  \deprecated Use mgmt/nfd/rib-flags.hpp
  */
-template<typename T>
-class RibFlagsTraits
-{
-public:
-  bool
-  isChildInherit() const
-  {
-    return static_cast<const T*>(this)->getFlags() & ROUTE_FLAG_CHILD_INHERIT;
-  }
-
-  bool
-  isRibCapture() const
-  {
-    return static_cast<const T*>(this)->getFlags() & ROUTE_FLAG_CAPTURE;
-  }
-};
-
-} // namespace nfd
-} // namespace ndn
-
-#endif // NDN_MANAGEMENT_NFD_RIB_FLAGS_HPP
+#include "../mgmt/nfd/rib-flags.hpp"
diff --git a/src/management/nfd-status-dataset.hpp b/src/management/nfd-status-dataset.hpp
index 363186e..0f2d72a 100644
--- a/src/management/nfd-status-dataset.hpp
+++ b/src/management/nfd-status-dataset.hpp
@@ -19,234 +19,7 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#ifndef NDN_MANAGEMENT_NFD_STATUS_DATASET_HPP
-#define NDN_MANAGEMENT_NFD_STATUS_DATASET_HPP
-
-#include "../name.hpp"
-#include "nfd-forwarder-status.hpp"
-#include "nfd-face-status.hpp"
-#include "nfd-face-query-filter.hpp"
-#include "nfd-channel-status.hpp"
-#include "nfd-fib-entry.hpp"
-#include "nfd-strategy-choice.hpp"
-#include "nfd-rib-entry.hpp"
-
-namespace ndn {
-namespace nfd {
-
-/**
- * \ingroup management
- * \brief base class of NFD StatusDataset
- * \sa http://redmine.named-data.net/projects/nfd/wiki/StatusDataset
+/** \file
+ *  \deprecated Use mgmt/nfd/status-dataset.hpp
  */
-class StatusDataset : noncopyable
-{
-public:
-#ifdef DOXYGEN
-  /**
-   * \brief if defined, specifies constructor argument type;
-   *        otherwise, constructor has no argument
-   */
-  typedef int ParamType;
-#endif
-
-  /**
-   * \brief constructs a name prefix for the dataset
-   * \param prefix top-level prefix, such as ndn:/localhost/nfd
-   * \return name prefix without version and segment components
-   */
-  Name
-  getDatasetPrefix(const Name& prefix) const;
-
-#ifdef DOXYGEN
-  /**
-   * \brief provides the result type, usually a vector
-   */
-  typedef std::vector<int> ResultType;
-#endif
-
-  /**
-   * \brief indicates reassembled payload cannot be parsed as ResultType
-   */
-  class ParseResultError : public tlv::Error
-  {
-  public:
-    explicit
-    ParseResultError(const std::string& what)
-      : tlv::Error(what)
-    {
-    }
-  };
-
-#ifdef DOXYGEN
-  /**
-   * \brief parses a result from reassembled payload
-   * \param payload reassembled payload
-   * \throw tlv::Error cannot parse payload
-   */
-  ResultType
-  parseResult(ConstBufferPtr payload) const;
-#endif
-
-protected:
-  /**
-   * \brief constructs a StatusDataset instance with given sub-prefix
-   * \param datasetName dataset name after top-level prefix, such as faces/list
-   */
-  explicit
-  StatusDataset(const PartialName& datasetName);
-
-private:
-  /**
-   * \brief appends parameters to the dataset name prefix
-   * \param[in,out] the dataset name prefix onto which parameter components can be appended
-   */
-  virtual void
-  addParameters(Name& name) const;
-
-private:
-  PartialName m_datasetName;
-};
-
-
-/**
- * \ingroup management
- * \brief represents a status/general dataset
- * \sa http://redmine.named-data.net/projects/nfd/wiki/ForwarderStatus#General-Status-Dataset
- */
-class ForwarderGeneralStatusDataset : public StatusDataset
-{
-public:
-  ForwarderGeneralStatusDataset();
-
-  typedef ForwarderStatus ResultType;
-
-  ResultType
-  parseResult(ConstBufferPtr payload) const;
-};
-
-
-/**
- * \ingroup management
- * \brief provides common functionality among FaceDataset and FaceQueryDataset
- */
-class FaceDatasetBase : public StatusDataset
-{
-public:
-  typedef std::vector<FaceStatus> ResultType;
-
-  ResultType
-  parseResult(ConstBufferPtr payload) const;
-
-protected:
-  explicit
-  FaceDatasetBase(const PartialName& datasetName);
-};
-
-
-/**
- * \ingroup management
- * \brief represents a faces/list dataset
- * \sa http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Face-Dataset
- */
-class FaceDataset : public FaceDatasetBase
-{
-public:
-  FaceDataset();
-};
-
-
-/**
- * \ingroup management
- * \brief represents a faces/query dataset
- * \sa http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Query-Operation
- */
-class FaceQueryDataset : public FaceDatasetBase
-{
-public:
-  typedef FaceQueryFilter ParamType;
-
-  explicit
-  FaceQueryDataset(const FaceQueryFilter& filter);
-
-private:
-  virtual void
-  addParameters(Name& name) const override;
-
-private:
-  FaceQueryFilter m_filter;
-};
-
-
-/**
- * \ingroup management
- * \brief represents a faces/channels dataset
- * \sa https://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Channel-Dataset
- */
-class ChannelDataset : public StatusDataset
-{
-public:
-  ChannelDataset();
-
-  typedef std::vector<ChannelStatus> ResultType;
-
-  ResultType
-  parseResult(ConstBufferPtr payload) const;
-};
-
-
-/**
- * \ingroup management
- * \brief represents a fib/list dataset
- * \sa http://redmine.named-data.net/projects/nfd/wiki/FibMgmt#FIB-Dataset
- */
-class FibDataset : public StatusDataset
-{
-public:
-  FibDataset();
-
-  typedef std::vector<FibEntry> ResultType;
-
-  ResultType
-  parseResult(ConstBufferPtr payload) const;
-};
-
-
-/**
- * \ingroup management
- * \brief represents a strategy-choice/list dataset
- * \sa http://redmine.named-data.net/projects/nfd/wiki/StrategyChoice#Strategy-Choice-Dataset
- */
-class StrategyChoiceDataset : public StatusDataset
-{
-public:
-  StrategyChoiceDataset();
-
-  typedef std::vector<StrategyChoice> ResultType;
-
-  ResultType
-  parseResult(ConstBufferPtr payload) const;
-};
-
-
-/**
- * \ingroup management
- * \brief represents a rib/list dataset
- * \sa http://redmine.named-data.net/projects/nfd/wiki/RibMgmt#RIB-Dataset
- */
-class RibDataset : public StatusDataset
-{
-public:
-  RibDataset();
-
-  typedef std::vector<RibEntry> ResultType;
-
-  ResultType
-  parseResult(ConstBufferPtr payload) const;
-};
-
-
-} // namespace nfd
-} // namespace ndn
-
-#endif // NDN_MANAGEMENT_NFD_STATUS_DATASET_HPP
+#include "../mgmt/nfd/status-dataset.hpp"
diff --git a/src/management/nfd-strategy-choice.hpp b/src/management/nfd-strategy-choice.hpp
index 4d8e781..1b31c0d 100644
--- a/src/management/nfd-strategy-choice.hpp
+++ b/src/management/nfd-strategy-choice.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2013-2015 Regents of the University of California.
+ * Copyright (c) 2013-2016 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -19,75 +19,7 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#ifndef NDN_MANAGEMENT_NFD_STRATEGY_CHOICE_HPP
-#define NDN_MANAGEMENT_NFD_STRATEGY_CHOICE_HPP
-
-#include "../encoding/block.hpp"
-#include "../name.hpp"
-
-namespace ndn {
-namespace nfd {
-
-/**
- * @ingroup management
- * @brief represents NFD StrategyChoice dataset
- * @sa http://redmine.named-data.net/projects/nfd/wiki/StrategyChoice#Strategy-Choice-Dataset
+/** \file
+ *  \deprecated Use mgmt/nfd/strategy-choice.hpp
  */
-class StrategyChoice
-{
-public:
-  class Error : public tlv::Error
-  {
-  public:
-    explicit
-    Error(const std::string& what)
-      : tlv::Error(what)
-    {
-    }
-  };
-
-  StrategyChoice();
-
-  explicit
-  StrategyChoice(const Block& payload);
-
-  template<encoding::Tag TAG>
-  size_t
-  wireEncode(EncodingImpl<TAG>& encoder) const;
-
-  const Block&
-  wireEncode() const;
-
-  void
-  wireDecode(const Block& wire);
-
-public: // getters & setters
-  const Name&
-  getName() const
-  {
-    return m_name;
-  }
-
-  StrategyChoice&
-  setName(const Name& name);
-
-  const Name&
-  getStrategy() const
-  {
-    return m_strategy;
-  }
-
-  StrategyChoice&
-  setStrategy(const Name& strategy);
-
-private:
-  Name m_name; // namespace
-  Name m_strategy; // strategy for the namespace
-
-  mutable Block m_wire;
-};
-
-} // namespace nfd
-} // namespace ndn
-
-#endif // NDN_MANAGEMENT_NFD_STRATEGY_CHOICE_HPP
+#include "../mgmt/nfd/strategy-choice.hpp"
diff --git a/src/management/nfd-channel-status.cpp b/src/mgmt/nfd/channel-status.cpp
similarity index 96%
rename from src/management/nfd-channel-status.cpp
rename to src/mgmt/nfd/channel-status.cpp
index b53d198..bbbfdf4 100644
--- a/src/management/nfd-channel-status.cpp
+++ b/src/mgmt/nfd/channel-status.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2013-2015 Regents of the University of California.
+ * Copyright (c) 2013-2016 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -19,7 +19,7 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#include "nfd-channel-status.hpp"
+#include "channel-status.hpp"
 #include "encoding/tlv-nfd.hpp"
 #include "encoding/block-helpers.hpp"
 #include "util/concepts.hpp"
diff --git a/src/mgmt/nfd/channel-status.hpp b/src/mgmt/nfd/channel-status.hpp
new file mode 100644
index 0000000..5a2aae8
--- /dev/null
+++ b/src/mgmt/nfd/channel-status.hpp
@@ -0,0 +1,82 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2013-2016 Regents of the University of California.
+ *
+ * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-cxx library is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-cxx library 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 Lesser General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ */
+
+#ifndef NDN_MGMT_NFD_CHANNEL_STATUS_HPP
+#define NDN_MGMT_NFD_CHANNEL_STATUS_HPP
+
+#include "../../encoding/block.hpp"
+
+namespace ndn {
+namespace nfd {
+
+/**
+ * @ingroup management
+ * @brief represents NFD Channel Status dataset
+ * @sa http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Channel-Dataset
+ */
+class ChannelStatus
+{
+public:
+  class Error : public tlv::Error
+  {
+  public:
+    explicit
+    Error(const std::string& what)
+      : tlv::Error(what)
+    {
+    }
+  };
+
+  ChannelStatus();
+
+  explicit
+  ChannelStatus(const Block& payload);
+
+  template<encoding::Tag TAG>
+  size_t
+  wireEncode(EncodingImpl<TAG>& encoder) const;
+
+  const Block&
+  wireEncode() const;
+
+  void
+  wireDecode(const Block& wire);
+
+public: // getters & setters
+  const std::string&
+  getLocalUri() const
+  {
+    return m_localUri;
+  }
+
+  ChannelStatus&
+  setLocalUri(const std::string localUri);
+
+private:
+  std::string m_localUri;
+
+  mutable Block m_wire;
+};
+
+} // namespace nfd
+} // namespace ndn
+
+#endif // NDN_MGMT_NFD_CHANNEL_STATUS_HPP
diff --git a/src/management/nfd-command-options.cpp b/src/mgmt/nfd/command-options.cpp
similarity index 96%
rename from src/management/nfd-command-options.cpp
rename to src/mgmt/nfd/command-options.cpp
index 6794483..557cce3 100644
--- a/src/management/nfd-command-options.cpp
+++ b/src/mgmt/nfd/command-options.cpp
@@ -19,11 +19,11 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#include "nfd-command-options.hpp"
+#include "command-options.hpp"
 
 #ifdef NDN_MANAGEMENT_NFD_COMMAND_OPTIONS_KEEP_DEPRECATED_SIGNING_PARAMS
-#include "../security/v1/identity-certificate.hpp"
-#include "../security/signing-helpers.hpp"
+#include "../../security/v1/identity-certificate.hpp"
+#include "../../security/signing-helpers.hpp"
 #endif // NDN_MANAGEMENT_NFD_COMMAND_OPTIONS_KEEP_DEPRECATED_SIGNING_PARAMS
 
 namespace ndn {
diff --git a/src/mgmt/nfd/command-options.hpp b/src/mgmt/nfd/command-options.hpp
new file mode 100644
index 0000000..efde928
--- /dev/null
+++ b/src/mgmt/nfd/command-options.hpp
@@ -0,0 +1,196 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2013-2016 Regents of the University of California.
+ *
+ * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-cxx library is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-cxx library 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 Lesser General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ */
+
+#ifndef NDN_MGMT_NFD_COMMAND_OPTIONS_HPP
+#define NDN_MGMT_NFD_COMMAND_OPTIONS_HPP
+
+#include "../../security/signing-info.hpp"
+
+#define NDN_MGMT_NFD_COMMAND_OPTIONS_KEEP_DEPRECATED_SIGNING_PARAMS
+
+namespace ndn {
+
+namespace security {
+namespace v1 {
+class IdentityCertificate;
+} // namespace v1
+} // namespace security
+
+namespace nfd {
+
+/** \ingroup management
+ *  \brief contains options for ControlCommand execution
+ *  \note This type is intentionally copyable
+ */
+class CommandOptions
+{
+public:
+  /** \brief constructs CommandOptions
+   *  \post getTimeout() == DEFAULT_TIMEOUT
+   *  \post getPrefix() == DEFAULT_PREFIX
+   *  \post getSigningInfo().getSignerType() == SIGNER_TYPE_NULL
+   */
+  CommandOptions();
+
+  /** \return command timeout
+   */
+  const time::milliseconds&
+  getTimeout() const
+  {
+    return m_timeout;
+  }
+
+  /** \brief sets command timeout
+   *  \param timeout the new command timeout, must be positive
+   *  \throw std::out_of_range if timeout is non-positive
+   *  \return self
+   */
+  CommandOptions&
+  setTimeout(const time::milliseconds& timeout);
+
+  /** \return command prefix
+   */
+  const Name&
+  getPrefix() const
+  {
+    return m_prefix;
+  }
+
+  /** \brief sets command prefix
+   *  \return self
+   */
+  CommandOptions&
+  setPrefix(const Name& prefix);
+
+  /** \return signing parameters
+   */
+  const security::SigningInfo&
+  getSigningInfo() const
+  {
+    return m_signingInfo;
+  }
+
+  /** \brief sets signing parameters
+   *  \return self
+   */
+  CommandOptions&
+  setSigningInfo(const security::SigningInfo& signingInfo);
+
+#ifdef NDN_MGMT_NFD_COMMAND_OPTIONS_KEEP_DEPRECATED_SIGNING_PARAMS
+public: // signing parameters
+  /** \deprecated use getSigningInfo and setSigningInfo
+   *  \brief indicates the selection of signing parameters
+   */
+  enum SigningParamsKind {
+    /** \brief picks the default signing identity and certificate
+     */
+    SIGNING_PARAMS_DEFAULT,
+    /** \brief picks the default certificate of a specific identity Name
+     */
+    SIGNING_PARAMS_IDENTITY,
+    /** \brief picks a specific identity certificate
+     */
+    SIGNING_PARAMS_CERTIFICATE
+  };
+
+  /** \deprecated use getSigningInfo and setSigningInfo
+   *  \return selection of signing parameters
+   */
+  DEPRECATED(
+  SigningParamsKind
+  getSigningParamsKind() const);
+
+  /** \deprecated use getSigningInfo and setSigningInfo
+   *  \return identity Name
+   *  \pre getSigningParamsKind() == SIGNING_PARAMS_IDENTITY
+   */
+  DEPRECATED(
+  const Name&
+  getSigningIdentity() const);
+
+  /** \deprecated use getSigningInfo and setSigningInfo
+   *  \return certificate Name
+   *  \pre getSigningParamsKind() == SIGNING_PARAMS_CERTIFICATE
+   */
+  DEPRECATED(
+  const Name&
+  getSigningCertificate() const);
+
+  /** \deprecated use getSigningInfo and setSigningInfo
+   *  \brief chooses to use default identity and certificate
+   *  \post getSigningParamsKind() == SIGNING_PARAMS_DEFAULT
+   *  \return self
+   */
+  DEPRECATED(
+  CommandOptions&
+  setSigningDefault());
+
+  /** \deprecated use getSigningInfo and setSigningInfo
+   *  \brief chooses to use a specific identity and its default certificate
+   *  \post getSigningParamsKind() == SIGNING_PARAMS_IDENTITY
+   *  \post getIdentityName() == identityName
+   *  \return self
+   */
+  DEPRECATED(
+  CommandOptions&
+  setSigningIdentity(const Name& identityName));
+
+  /** \deprecated use getSigningInfo and setSigningInfo
+   *  \brief chooses to use a specific identity certificate
+   *  \param certificateName identity certificate Name
+   *  \throw std::invalid_argument if certificateName is invalid
+   *  \post getSigningParamsKind() == SIGNING_PARAMS_CERTIFICATE
+   *  \post getSigningCertificate() == certificateName
+   *  \return self
+   */
+  DEPRECATED(
+  CommandOptions&
+  setSigningCertificate(const Name& certificateName));
+
+  /** \deprecated use getSigningInfo and setSigningInfo
+   *  \brief chooses to use a specific identity certificate
+   *  \details This is equivalent to .setIdentityCertificate(certificate.getName())
+   */
+  DEPRECATED(
+  CommandOptions&
+  setSigningCertificate(const security::v1::IdentityCertificate& certificate));
+
+#endif // NDN_MGMT_NFD_COMMAND_OPTIONS_KEEP_DEPRECATED_SIGNING_PARAMS
+
+public:
+  /** \brief gives the default command timeout: 10000ms
+   */
+  static const time::milliseconds DEFAULT_TIMEOUT;
+
+  /** \brief gives the default command prefix: ndn:/localhost/nfd
+   */
+  static const Name DEFAULT_PREFIX;
+
+private:
+  time::milliseconds m_timeout;
+  Name m_prefix;
+  security::SigningInfo m_signingInfo;
+};
+
+} // namespace nfd
+} // namespace ndn
+
+#endif // NDN_MGMT_NFD_COMMAND_OPTIONS_HPP
diff --git a/src/management/nfd-control-command.cpp b/src/mgmt/nfd/control-command.cpp
similarity index 98%
rename from src/management/nfd-control-command.cpp
rename to src/mgmt/nfd/control-command.cpp
index 45c2a08..2a6eda7 100644
--- a/src/management/nfd-control-command.cpp
+++ b/src/mgmt/nfd/control-command.cpp
@@ -19,8 +19,8 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#include "nfd-control-command.hpp"
-#include "nfd-command-options.hpp" // only used in deprecated functions
+#include "control-command.hpp"
+#include "command-options.hpp" // only used in deprecated functions
 
 namespace ndn {
 namespace nfd {
diff --git a/src/mgmt/nfd/control-command.hpp b/src/mgmt/nfd/control-command.hpp
new file mode 100644
index 0000000..7544156
--- /dev/null
+++ b/src/mgmt/nfd/control-command.hpp
@@ -0,0 +1,348 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2013-2016 Regents of the University of California.
+ *
+ * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-cxx library is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-cxx library 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 Lesser General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ */
+
+#ifndef NDN_MGMT_NFD_CONTROL_COMMAND_HPP
+#define NDN_MGMT_NFD_CONTROL_COMMAND_HPP
+
+#include "control-parameters.hpp"
+
+namespace ndn {
+namespace nfd {
+
+/**
+ * \ingroup management
+ * \brief base class of NFD ControlCommand
+ * \sa http://redmine.named-data.net/projects/nfd/wiki/ControlCommand
+ */
+class ControlCommand : noncopyable
+{
+public:
+  /** \brief represents an error in ControlParameters
+   */
+  class ArgumentError : public std::invalid_argument
+  {
+  public:
+    explicit
+    ArgumentError(const std::string& what)
+      : std::invalid_argument(what)
+    {
+    }
+  };
+
+  virtual
+  ~ControlCommand();
+
+  /** \brief validate request parameters
+   *  \throw ArgumentError if parameters are invalid
+   */
+  virtual void
+  validateRequest(const ControlParameters& parameters) const;
+
+  /** \brief apply default values to missing fields in request
+   */
+  virtual void
+  applyDefaultsToRequest(ControlParameters& parameters) const;
+
+  /** \brief validate response parameters
+   *  \throw ArgumentError if parameters are invalid
+   */
+  virtual void
+  validateResponse(const ControlParameters& parameters) const;
+
+  /** \brief apply default values to missing fields in response
+   */
+  virtual void
+  applyDefaultsToResponse(ControlParameters& parameters) const;
+
+  /** \brief construct the Name for a request Interest
+   *  \throw ArgumentError if parameters are invalid
+   */
+  Name
+  getRequestName(const Name& commandPrefix, const ControlParameters& parameters) const;
+
+protected:
+  ControlCommand(const std::string& module, const std::string& verb);
+
+  class FieldValidator
+  {
+  public:
+    FieldValidator();
+
+    /** \brief declare a required field
+     */
+    FieldValidator&
+    required(ControlParameterField field)
+    {
+      m_required[field] = true;
+      return *this;
+    }
+
+    /** \brief declare an optional field
+     */
+    FieldValidator&
+    optional(ControlParameterField field)
+    {
+      m_optional[field] = true;
+      return *this;
+    }
+
+    /** \brief verify that all required fields are present,
+     *         and all present fields are either required or optional
+     *  \throw ArgumentError
+     */
+    void
+    validate(const ControlParameters& parameters) const;
+
+  private:
+    std::vector<bool> m_required;
+    std::vector<bool> m_optional;
+  };
+
+protected:
+  /** \brief FieldValidator for request ControlParameters
+   *
+   *  Constructor of subclass should populate this validator.
+   */
+  FieldValidator m_requestValidator;
+  /** \brief FieldValidator for response ControlParameters
+   *
+   *  Constructor of subclass should populate this validator.
+   */
+  FieldValidator m_responseValidator;
+
+private:
+  name::Component m_module;
+  name::Component m_verb;
+};
+
+
+/**
+ * \ingroup management
+ * \brief represents a faces/create command
+ * \sa http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Create-a-face
+ */
+class FaceCreateCommand : public ControlCommand
+{
+public:
+  FaceCreateCommand();
+
+  virtual void
+  applyDefaultsToRequest(ControlParameters& parameters) const override;
+
+  virtual void
+  validateRequest(const ControlParameters& parameters) const override;
+
+  virtual void
+  validateResponse(const ControlParameters& parameters) const override;
+};
+
+
+/**
+ * \ingroup management
+ * \brief represents a faces/update command
+ * \sa http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Update-a-face
+ */
+class FaceUpdateCommand : public ControlCommand
+{
+public:
+  FaceUpdateCommand();
+
+  virtual void
+  applyDefaultsToRequest(ControlParameters& parameters) const override;
+
+  virtual void
+  validateRequest(const ControlParameters& parameters) const override;
+
+  /**
+   * \note This can only validate ControlParameters in a success response.
+   *       Failure responses should be validated with validateRequest.
+   */
+  virtual void
+  validateResponse(const ControlParameters& parameters) const override;
+};
+
+
+/**
+ * \ingroup management
+ * \brief represents a faces/destroy command
+ * \sa http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Destroy-a-face
+ */
+class FaceDestroyCommand : public ControlCommand
+{
+public:
+  FaceDestroyCommand();
+
+  virtual void
+  validateRequest(const ControlParameters& parameters) const override;
+
+  virtual void
+  validateResponse(const ControlParameters& parameters) const override;
+};
+
+
+/**
+ * \ingroup management
+ * \brief Base class for faces/[*]-local-control commands
+ */
+class FaceLocalControlCommand : public ControlCommand
+{
+public:
+  virtual void
+  validateRequest(const ControlParameters& parameters) const override;
+
+  virtual void
+  validateResponse(const ControlParameters& parameters) const override;
+
+protected:
+  explicit
+  FaceLocalControlCommand(const std::string& verb);
+};
+
+
+/**
+ * \ingroup management
+ * \brief represents a faces/enable-local-control command
+ * \sa http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Enable-a-LocalControlHeader-feature
+ */
+class FaceEnableLocalControlCommand : public FaceLocalControlCommand
+{
+public:
+  FaceEnableLocalControlCommand();
+};
+
+
+/**
+ * \ingroup management
+ * \brief represents a faces/disable-local-control command
+ * \sa http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Disable-a-LocalControlHeader-feature
+ */
+class FaceDisableLocalControlCommand : public FaceLocalControlCommand
+{
+public:
+  FaceDisableLocalControlCommand();
+};
+
+
+/**
+ * \ingroup management
+ * \brief represents a fib/add-nexthop command
+ * \sa http://redmine.named-data.net/projects/nfd/wiki/FibMgmt#Add-a-nexthop
+ */
+class FibAddNextHopCommand : public ControlCommand
+{
+public:
+  FibAddNextHopCommand();
+
+  virtual void
+  applyDefaultsToRequest(ControlParameters& parameters) const override;
+
+  virtual void
+  validateResponse(const ControlParameters& parameters) const override;
+};
+
+
+/**
+ * \ingroup management
+ * \brief represents a fib/remove-nexthop command
+ * \sa http://redmine.named-data.net/projects/nfd/wiki/FibMgmt#Remove-a-nexthop
+ */
+class FibRemoveNextHopCommand : public ControlCommand
+{
+public:
+  FibRemoveNextHopCommand();
+
+  virtual void
+  applyDefaultsToRequest(ControlParameters& parameters) const override;
+
+  virtual void
+  validateResponse(const ControlParameters& parameters) const override;
+};
+
+
+/**
+ * \ingroup management
+ * \brief represents a strategy-choice/set command
+ * \sa http://redmine.named-data.net/projects/nfd/wiki/StrategyChoice#Set-the-strategy-for-a-namespace
+ */
+class StrategyChoiceSetCommand : public ControlCommand
+{
+public:
+  StrategyChoiceSetCommand();
+};
+
+
+/**
+ * \ingroup management
+ * \brief represents a strategy-choice/set command
+ * \sa http://redmine.named-data.net/projects/nfd/wiki/StrategyChoice#Unset-the-strategy-for-a-namespace
+ */
+class StrategyChoiceUnsetCommand : public ControlCommand
+{
+public:
+  StrategyChoiceUnsetCommand();
+
+  virtual void
+  validateRequest(const ControlParameters& parameters) const override;
+
+  virtual void
+  validateResponse(const ControlParameters& parameters) const override;
+};
+
+
+/**
+ * \ingroup management
+ * \brief represents a rib/register command
+ * \sa http://redmine.named-data.net/projects/nfd/wiki/RibMgmt#Register-a-route
+ */
+class RibRegisterCommand : public ControlCommand
+{
+public:
+  RibRegisterCommand();
+
+  virtual void
+  applyDefaultsToRequest(ControlParameters& parameters) const override;
+
+  virtual void
+  validateResponse(const ControlParameters& parameters) const override;
+};
+
+
+/**
+ * \ingroup management
+ * \brief represents a rib/unregister command
+ * \sa http://redmine.named-data.net/projects/nfd/wiki/RibMgmt#Unregister-a-route
+ */
+class RibUnregisterCommand : public ControlCommand
+{
+public:
+  RibUnregisterCommand();
+
+  virtual void
+  applyDefaultsToRequest(ControlParameters& parameters) const override;
+
+  virtual void
+  validateResponse(const ControlParameters& parameters) const override;
+};
+
+} // namespace nfd
+} // namespace ndn
+
+#endif // NDN_MGMT_NFD_CONTROL_COMMAND_HPP
diff --git a/src/management/nfd-control-parameters.cpp b/src/mgmt/nfd/control-parameters.cpp
similarity index 99%
rename from src/management/nfd-control-parameters.cpp
rename to src/mgmt/nfd/control-parameters.cpp
index f68ca26..30f8fe9 100644
--- a/src/management/nfd-control-parameters.cpp
+++ b/src/mgmt/nfd/control-parameters.cpp
@@ -19,7 +19,7 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#include "nfd-control-parameters.hpp"
+#include "control-parameters.hpp"
 #include "encoding/tlv-nfd.hpp"
 #include "encoding/block-helpers.hpp"
 #include "util/concepts.hpp"
diff --git a/src/mgmt/nfd/control-parameters.hpp b/src/mgmt/nfd/control-parameters.hpp
new file mode 100644
index 0000000..d57c75d
--- /dev/null
+++ b/src/mgmt/nfd/control-parameters.hpp
@@ -0,0 +1,514 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2013-2016 Regents of the University of California.
+ *
+ * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-cxx library is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-cxx library 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 Lesser General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ */
+
+#ifndef NDN_MGMT_NFD_CONTROL_PARAMETERS_HPP
+#define NDN_MGMT_NFD_CONTROL_PARAMETERS_HPP
+
+#include "../../encoding/nfd-constants.hpp"
+#include "../../name.hpp"
+#include "../../util/time.hpp"
+#include "../control-parameters.hpp"
+
+namespace ndn {
+namespace nfd {
+
+/**
+ * \ingroup management
+ */
+enum ControlParameterField {
+  CONTROL_PARAMETER_NAME,
+  CONTROL_PARAMETER_FACE_ID,
+  CONTROL_PARAMETER_URI,
+  CONTROL_PARAMETER_LOCAL_CONTROL_FEATURE,
+  CONTROL_PARAMETER_ORIGIN,
+  CONTROL_PARAMETER_COST,
+  CONTROL_PARAMETER_FLAGS,
+  CONTROL_PARAMETER_MASK,
+  CONTROL_PARAMETER_STRATEGY,
+  CONTROL_PARAMETER_EXPIRATION_PERIOD,
+  CONTROL_PARAMETER_FACE_PERSISTENCY,
+  CONTROL_PARAMETER_UBOUND
+};
+
+const std::string CONTROL_PARAMETER_FIELD[CONTROL_PARAMETER_UBOUND] = {
+  "Name",
+  "FaceId",
+  "Uri",
+  "LocalControlFeature",
+  "Origin",
+  "Cost",
+  "Flags",
+  "Mask",
+  "Strategy",
+  "ExpirationPeriod",
+  "FacePersistency"
+};
+
+/**
+ * \ingroup management
+ * \deprecated use Flags+Mask fields instead
+ */
+enum LocalControlFeature {
+  LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID = 1,
+  LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID = 2
+};
+
+/**
+ * \ingroup management
+ * \brief represents parameters in a ControlCommand request or response
+ * \sa http://redmine.named-data.net/projects/nfd/wiki/ControlCommand#ControlParameters
+ * \details This type is copyable because it's an abstraction of a TLV type.
+ */
+class ControlParameters : public ndn::mgmt::ControlParameters
+{
+public:
+  class Error : public tlv::Error
+  {
+  public:
+    explicit
+    Error(const std::string& what)
+      : tlv::Error(what)
+    {
+    }
+  };
+
+  ControlParameters();
+
+  explicit
+  ControlParameters(const Block& block);
+
+  template<encoding::Tag TAG>
+  size_t
+  wireEncode(EncodingImpl<TAG>& encoder) const;
+
+  virtual Block
+  wireEncode() const final;
+
+  virtual void
+  wireDecode(const Block& wire) final;
+
+public: // getters & setters
+  bool
+  hasName() const
+  {
+    return m_hasFields[CONTROL_PARAMETER_NAME];
+  }
+
+  const Name&
+  getName() const
+  {
+    BOOST_ASSERT(this->hasName());
+    return m_name;
+  }
+
+  ControlParameters&
+  setName(const Name& name)
+  {
+    m_wire.reset();
+    m_name = name;
+    m_hasFields[CONTROL_PARAMETER_NAME] = true;
+    return *this;
+  }
+
+  ControlParameters&
+  unsetName()
+  {
+    m_wire.reset();
+    m_hasFields[CONTROL_PARAMETER_NAME] = false;
+    return *this;
+  }
+
+  bool
+  hasFaceId() const
+  {
+    return m_hasFields[CONTROL_PARAMETER_FACE_ID];
+  }
+
+  uint64_t
+  getFaceId() const
+  {
+    BOOST_ASSERT(this->hasFaceId());
+    return m_faceId;
+  }
+
+  ControlParameters&
+  setFaceId(uint64_t faceId)
+  {
+    m_wire.reset();
+    m_faceId = faceId;
+    m_hasFields[CONTROL_PARAMETER_FACE_ID] = true;
+    return *this;
+  }
+
+  ControlParameters&
+  unsetFaceId()
+  {
+    m_wire.reset();
+    m_hasFields[CONTROL_PARAMETER_FACE_ID] = false;
+    return *this;
+  }
+
+  bool
+  hasUri() const
+  {
+    return m_hasFields[CONTROL_PARAMETER_URI];
+  }
+
+  const std::string&
+  getUri() const
+  {
+    BOOST_ASSERT(this->hasUri());
+    return m_uri;
+  }
+
+  ControlParameters&
+  setUri(const std::string& uri)
+  {
+    m_wire.reset();
+    m_uri = uri;
+    m_hasFields[CONTROL_PARAMETER_URI] = true;
+    return *this;
+  }
+
+  ControlParameters&
+  unsetUri()
+  {
+    m_wire.reset();
+    m_hasFields[CONTROL_PARAMETER_URI] = false;
+    return *this;
+  }
+
+  /**
+   * \deprecated use Flags+Mask fields instead
+   */
+  bool
+  hasLocalControlFeature() const
+  {
+    return m_hasFields[CONTROL_PARAMETER_LOCAL_CONTROL_FEATURE];
+  }
+
+  /**
+   * \deprecated use Flags+Mask fields instead
+   */
+  LocalControlFeature
+  getLocalControlFeature() const
+  {
+    BOOST_ASSERT(this->hasLocalControlFeature());
+    return m_localControlFeature;
+  }
+
+  /**
+   * \deprecated use Flags+Mask fields instead
+   */
+  ControlParameters&
+  setLocalControlFeature(LocalControlFeature localControlFeature)
+  {
+    m_wire.reset();
+    m_localControlFeature = localControlFeature;
+    m_hasFields[CONTROL_PARAMETER_LOCAL_CONTROL_FEATURE] = true;
+    return *this;
+  }
+
+  /**
+   * \deprecated use Flags+Mask fields instead
+   */
+  ControlParameters&
+  unsetLocalControlFeature()
+  {
+    m_wire.reset();
+    m_hasFields[CONTROL_PARAMETER_LOCAL_CONTROL_FEATURE] = false;
+    return *this;
+  }
+
+  bool
+  hasOrigin() const
+  {
+    return m_hasFields[CONTROL_PARAMETER_ORIGIN];
+  }
+
+  uint64_t
+  getOrigin() const
+  {
+    BOOST_ASSERT(this->hasOrigin());
+    return m_origin;
+  }
+
+  ControlParameters&
+  setOrigin(uint64_t origin)
+  {
+    m_wire.reset();
+    m_origin = origin;
+    m_hasFields[CONTROL_PARAMETER_ORIGIN] = true;
+    return *this;
+  }
+
+  ControlParameters&
+  unsetOrigin()
+  {
+    m_wire.reset();
+    m_hasFields[CONTROL_PARAMETER_ORIGIN] = false;
+    return *this;
+  }
+
+  bool
+  hasCost() const
+  {
+    return m_hasFields[CONTROL_PARAMETER_COST];
+  }
+
+  uint64_t
+  getCost() const
+  {
+    BOOST_ASSERT(this->hasCost());
+    return m_cost;
+  }
+
+  ControlParameters&
+  setCost(uint64_t cost)
+  {
+    m_wire.reset();
+    m_cost = cost;
+    m_hasFields[CONTROL_PARAMETER_COST] = true;
+    return *this;
+  }
+
+  ControlParameters&
+  unsetCost()
+  {
+    m_wire.reset();
+    m_hasFields[CONTROL_PARAMETER_COST] = false;
+    return *this;
+  }
+
+  bool
+  hasFlags() const
+  {
+    return m_hasFields[CONTROL_PARAMETER_FLAGS];
+  }
+
+  uint64_t
+  getFlags() const
+  {
+    BOOST_ASSERT(this->hasFlags());
+    return m_flags;
+  }
+
+  ControlParameters&
+  setFlags(uint64_t flags)
+  {
+    m_wire.reset();
+    m_flags = flags;
+    m_hasFields[CONTROL_PARAMETER_FLAGS] = true;
+    return *this;
+  }
+
+  ControlParameters&
+  unsetFlags()
+  {
+    m_wire.reset();
+    m_hasFields[CONTROL_PARAMETER_FLAGS] = false;
+    return *this;
+  }
+
+  bool
+  hasMask() const
+  {
+    return m_hasFields[CONTROL_PARAMETER_MASK];
+  }
+
+  uint64_t
+  getMask() const
+  {
+    BOOST_ASSERT(this->hasMask());
+    return m_mask;
+  }
+
+  ControlParameters&
+  setMask(uint64_t mask)
+  {
+    m_wire.reset();
+    m_mask = mask;
+    m_hasFields[CONTROL_PARAMETER_MASK] = true;
+    return *this;
+  }
+
+  ControlParameters&
+  unsetMask()
+  {
+    m_wire.reset();
+    m_hasFields[CONTROL_PARAMETER_MASK] = false;
+    return *this;
+  }
+
+  bool
+  hasStrategy() const
+  {
+    return m_hasFields[CONTROL_PARAMETER_STRATEGY];
+  }
+
+  const Name&
+  getStrategy() const
+  {
+    BOOST_ASSERT(this->hasStrategy());
+    return m_strategy;
+  }
+
+  ControlParameters&
+  setStrategy(const Name& strategy)
+  {
+    m_wire.reset();
+    m_strategy = strategy;
+    m_hasFields[CONTROL_PARAMETER_STRATEGY] = true;
+    return *this;
+  }
+
+  ControlParameters&
+  unsetStrategy()
+  {
+    m_wire.reset();
+    m_hasFields[CONTROL_PARAMETER_STRATEGY] = false;
+    return *this;
+  }
+
+  bool
+  hasExpirationPeriod() const
+  {
+    return m_hasFields[CONTROL_PARAMETER_EXPIRATION_PERIOD];
+  }
+
+  const time::milliseconds&
+  getExpirationPeriod() const
+  {
+    BOOST_ASSERT(this->hasExpirationPeriod());
+    return m_expirationPeriod;
+  }
+
+  ControlParameters&
+  setExpirationPeriod(const time::milliseconds& expirationPeriod)
+  {
+    m_wire.reset();
+    m_expirationPeriod = expirationPeriod;
+    m_hasFields[CONTROL_PARAMETER_EXPIRATION_PERIOD] = true;
+    return *this;
+  }
+
+  ControlParameters&
+  unsetExpirationPeriod()
+  {
+    m_wire.reset();
+    m_hasFields[CONTROL_PARAMETER_EXPIRATION_PERIOD] = false;
+    return *this;
+  }
+
+  bool
+  hasFacePersistency() const
+  {
+    return m_hasFields[CONTROL_PARAMETER_FACE_PERSISTENCY];
+  }
+
+  FacePersistency
+  getFacePersistency() const
+  {
+    BOOST_ASSERT(this->hasFacePersistency());
+    return m_facePersistency;
+  }
+
+  ControlParameters&
+  setFacePersistency(FacePersistency persistency)
+  {
+    m_wire.reset();
+    m_facePersistency = persistency;
+    m_hasFields[CONTROL_PARAMETER_FACE_PERSISTENCY] = true;
+    return *this;
+  }
+
+  ControlParameters&
+  unsetFacePersistency()
+  {
+    m_wire.reset();
+    m_hasFields[CONTROL_PARAMETER_FACE_PERSISTENCY] = false;
+    return *this;
+  }
+
+  const std::vector<bool>&
+  getPresentFields() const
+  {
+    return m_hasFields;
+  }
+
+public: // Flags and Mask helpers
+  /**
+   * \return whether bit is enabled in Mask
+   * \param bit bit position within range [0, 64) (least significant bit is 0)
+   */
+  bool
+  hasFlagBit(size_t bit) const;
+
+  /**
+   * \return bit at a position in Flags
+   * \param bit bit position within range [0, 64) (least significant bit is 0)
+   */
+  bool
+  getFlagBit(size_t bit) const;
+
+  /**
+   * \brief set a bit in Flags
+   * \param bit bit position within range [0, 64) (least significant bit is 0)
+   * \param value new value in Flags
+   * \param wantMask if true, enable the bit in Mask
+   */
+  ControlParameters&
+  setFlagBit(size_t bit, bool value, bool wantMask = true);
+
+  /**
+   * \brief disable a bit in Mask
+   * \param bit bit position within range [0, 64) (least significant bit is 0)
+   * \post If all bits are disabled, Flags and Mask fields are deleted.
+   */
+  ControlParameters&
+  unsetFlagBit(size_t bit);
+
+private: // fields
+  std::vector<bool>   m_hasFields;
+
+  Name                m_name;
+  uint64_t            m_faceId;
+  std::string         m_uri;
+  LocalControlFeature m_localControlFeature;
+  uint64_t            m_origin;
+  uint64_t            m_cost;
+  uint64_t            m_flags;
+  uint64_t            m_mask;
+  Name                m_strategy;
+  time::milliseconds  m_expirationPeriod;
+  FacePersistency     m_facePersistency;
+
+private:
+  mutable Block m_wire;
+};
+
+std::ostream&
+operator<<(std::ostream& os, const ControlParameters& parameters);
+
+} // namespace nfd
+} // namespace ndn
+
+#endif // NDN_MGMT_NFD_CONTROL_PARAMETERS_HPP
diff --git a/src/mgmt/nfd/control-response.hpp b/src/mgmt/nfd/control-response.hpp
new file mode 100644
index 0000000..8234e2d
--- /dev/null
+++ b/src/mgmt/nfd/control-response.hpp
@@ -0,0 +1,35 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2013-2016 Regents of the University of California.
+ *
+ * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-cxx library is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-cxx library 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 Lesser General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ */
+
+#ifndef NDN_MANAGEMENT_CONTROL_RESPONSE_HPP
+#define NDN_MANAGEMENT_CONTROL_RESPONSE_HPP
+
+#include "../dispatcher.hpp"
+
+namespace ndn {
+namespace nfd {
+
+typedef ndn::mgmt::ControlResponse ControlResponse;
+
+} // namespace nfd
+} // namespace ndn
+
+#endif // NDN_MANAGEMENT_CONTROL_RESPONSE_HPP
diff --git a/src/management/nfd-controller.cpp b/src/mgmt/nfd/controller.cpp
similarity index 97%
rename from src/management/nfd-controller.cpp
rename to src/mgmt/nfd/controller.cpp
index b395d6b..cfb7956 100644
--- a/src/management/nfd-controller.cpp
+++ b/src/mgmt/nfd/controller.cpp
@@ -19,10 +19,10 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#include "nfd-controller.hpp"
-#include "../face.hpp"
-#include "../security/key-chain.hpp"
-#include "../util/segment-fetcher.hpp"
+#include "controller.hpp"
+#include "../../face.hpp"
+#include "../../security/key-chain.hpp"
+#include "../../util/segment-fetcher.hpp"
 
 namespace ndn {
 namespace nfd {
diff --git a/src/mgmt/nfd/controller.hpp b/src/mgmt/nfd/controller.hpp
new file mode 100644
index 0000000..3d3808c
--- /dev/null
+++ b/src/mgmt/nfd/controller.hpp
@@ -0,0 +1,221 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2013-2016 Regents of the University of California.
+ *
+ * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-cxx library is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-cxx library 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 Lesser General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ */
+
+#ifndef NDN_MGMT_NFD_CONTROLLER_HPP
+#define NDN_MGMT_NFD_CONTROLLER_HPP
+
+#include "control-command.hpp"
+#include "control-response.hpp"
+#include "status-dataset.hpp"
+#include "command-options.hpp"
+#include "../../security/validator-null.hpp"
+
+namespace ndn {
+
+namespace security {
+class KeyChain;
+class Validator;
+} // namespace security
+class Face;
+
+namespace nfd {
+
+/**
+ * \defgroup management Management
+ * \brief Classes and data structures to manage NDN forwarder
+ */
+
+/**
+ * \ingroup management
+ * \brief NFD Management protocol client
+ * \sa https://redmine.named-data.net/projects/nfd/wiki/Management
+ */
+class Controller : noncopyable
+{
+public:
+  /** \brief a callback on command success
+   */
+  typedef function<void(const ControlParameters&)> CommandSucceedCallback;
+
+  /** \brief a callback on command failure
+   */
+  typedef function<void(const ControlResponse&)> CommandFailCallback;
+
+  /** \brief a callback on dataset retrieval failure
+   */
+  typedef function<void(uint32_t code, const std::string& reason)> DatasetFailCallback;
+
+  /** \brief construct a Controller that uses face for transport,
+   *         and uses the passed KeyChain to sign commands
+   */
+  Controller(Face& face, security::KeyChain& keyChain, security::Validator& validator = s_validatorNull);
+
+  /** \brief start command execution
+   */
+  template<typename Command>
+  void
+  start(const ControlParameters& parameters,
+        const CommandSucceedCallback& onSuccess,
+        const CommandFailCallback& onFailure,
+        const CommandOptions& options = CommandOptions())
+  {
+    shared_ptr<ControlCommand> command = make_shared<Command>();
+    this->startCommand(command, parameters, onSuccess, onFailure, options);
+  }
+
+  /** \brief start dataset fetching
+   */
+  template<typename Dataset>
+  typename std::enable_if<std::is_default_constructible<Dataset>::value>::type
+  fetch(const std::function<void(typename Dataset::ResultType)>& onSuccess,
+        const DatasetFailCallback& onFailure,
+        const CommandOptions& options = CommandOptions())
+  {
+    this->fetchDataset(make_shared<Dataset>(), onSuccess, onFailure, options);
+  }
+
+  /** \brief start dataset fetching
+   */
+  template<typename Dataset, typename ParamType = typename Dataset::ParamType>
+  void
+  fetch(const ParamType& param,
+        const std::function<void(typename Dataset::ResultType)>& onSuccess,
+        const DatasetFailCallback& onFailure,
+        const CommandOptions& options = CommandOptions())
+  {
+    this->fetchDataset(make_shared<Dataset>(param), onSuccess, onFailure, options);
+  }
+
+private:
+  void
+  startCommand(const shared_ptr<ControlCommand>& command,
+               const ControlParameters& parameters,
+               const CommandSucceedCallback& onSuccess,
+               const CommandFailCallback& onFailure,
+               const CommandOptions& options);
+
+  void
+  processCommandResponse(const Data& data,
+                         const shared_ptr<ControlCommand>& command,
+                         const CommandSucceedCallback& onSuccess,
+                         const CommandFailCallback& onFailure);
+
+  void
+  processValidatedCommandResponse(const Data& data,
+                                  const shared_ptr<ControlCommand>& command,
+                                  const CommandSucceedCallback& onSuccess,
+                                  const CommandFailCallback& onFailure);
+
+  template<typename Dataset>
+  void
+  fetchDataset(shared_ptr<Dataset> dataset,
+               const std::function<void(typename Dataset::ResultType)>& onSuccess,
+               const DatasetFailCallback& onFailure,
+               const CommandOptions& options);
+
+  void
+  fetchDataset(const Name& prefix,
+               const std::function<void(const ConstBufferPtr&)>& processResponse,
+               const DatasetFailCallback& onFailure,
+               const CommandOptions& options);
+
+  template<typename Dataset>
+  void
+  processDatasetResponse(shared_ptr<Dataset> dataset,
+                         const std::function<void(typename Dataset::ResultType)>& onSuccess,
+                         const DatasetFailCallback& onFailure,
+                         ConstBufferPtr payload);
+
+  void
+  processDatasetFetchError(const DatasetFailCallback& onFailure, uint32_t code, std::string msg);
+
+public:
+  /** \brief error code for timeout
+   */
+  static const uint32_t ERROR_TIMEOUT;
+
+  /** \brief error code for network Nack
+   */
+  static const uint32_t ERROR_NACK;
+
+  /** \brief error code for response validation failure
+   */
+  static const uint32_t ERROR_VALIDATION;
+
+  /** \brief error code for server error
+   */
+  static const uint32_t ERROR_SERVER;
+
+  /** \brief inclusive lower bound of error codes
+   */
+  static const uint32_t ERROR_LBOUND;
+
+protected:
+  Face& m_face;
+  security::KeyChain& m_keyChain;
+  security::Validator& m_validator;
+
+private:
+  static ValidatorNull s_validatorNull;
+};
+
+template<typename Dataset>
+inline void
+Controller::fetchDataset(shared_ptr<Dataset> dataset,
+                         const std::function<void(typename Dataset::ResultType)>& onSuccess1,
+                         const DatasetFailCallback& onFailure1,
+                         const CommandOptions& options)
+{
+  const std::function<void(typename Dataset::ResultType)>& onSuccess = onSuccess1 ?
+    onSuccess1 : [] (const typename Dataset::ResultType&) {};
+  const DatasetFailCallback& onFailure = onFailure1 ?
+    onFailure1 : [] (uint32_t, const std::string&) {};
+
+  Name prefix = dataset->getDatasetPrefix(options.getPrefix());
+  this->fetchDataset(prefix,
+                     bind(&Controller::processDatasetResponse<Dataset>, this, dataset, onSuccess, onFailure, _1),
+                     onFailure,
+                     options);
+}
+
+template<typename Dataset>
+inline void
+Controller::processDatasetResponse(shared_ptr<Dataset> dataset,
+                                   const std::function<void(typename Dataset::ResultType)>& onSuccess,
+                                   const DatasetFailCallback& onFailure,
+                                   ConstBufferPtr payload)
+{
+  typename Dataset::ResultType result;
+  try {
+    result = dataset->parseResult(payload);
+  }
+  catch (const tlv::Error& e) {
+    onFailure(ERROR_SERVER, e.what());
+    return;
+  }
+
+  onSuccess(result);
+}
+
+} // namespace nfd
+} // namespace ndn
+
+#endif // NDN_MGMT_NFD_CONTROLLER_HPP
diff --git a/src/management/nfd-face-event-notification.cpp b/src/mgmt/nfd/face-event-notification.cpp
similarity index 97%
rename from src/management/nfd-face-event-notification.cpp
rename to src/mgmt/nfd/face-event-notification.cpp
index 5f80fe8..3422ee8 100644
--- a/src/management/nfd-face-event-notification.cpp
+++ b/src/mgmt/nfd/face-event-notification.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2013-2015 Regents of the University of California.
+ * Copyright (c) 2013-2016 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -19,7 +19,7 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#include "nfd-face-event-notification.hpp"
+#include "face-event-notification.hpp"
 #include "encoding/tlv-nfd.hpp"
 #include "encoding/block-helpers.hpp"
 #include "util/concepts.hpp"
diff --git a/src/mgmt/nfd/face-event-notification.hpp b/src/mgmt/nfd/face-event-notification.hpp
new file mode 100644
index 0000000..a4d1ea7
--- /dev/null
+++ b/src/mgmt/nfd/face-event-notification.hpp
@@ -0,0 +1,94 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2013-2016 Regents of the University of California.
+ *
+ * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-cxx library is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-cxx library 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 Lesser General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ */
+
+#ifndef NDN_MGMT_NFD_FACE_EVENT_NOTIFICATION_HPP
+#define NDN_MGMT_NFD_FACE_EVENT_NOTIFICATION_HPP
+
+#include "face-traits.hpp"
+#include "../../encoding/block.hpp"
+
+namespace ndn {
+namespace nfd {
+
+/**
+ * \ingroup management
+ */
+enum FaceEventKind {
+  FACE_EVENT_CREATED = 1,
+  FACE_EVENT_DESTROYED = 2
+};
+
+/**
+ * \ingroup management
+ * \brief represents a Face status change notification
+ * \sa http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Face-Status-Change-Notification
+ */
+class FaceEventNotification : public FaceTraits<FaceEventNotification>
+{
+public:
+  FaceEventNotification();
+
+  explicit
+  FaceEventNotification(const Block& block);
+
+  /** \brief prepend FaceEventNotification to the encoder
+   */
+  template<encoding::Tag TAG>
+  size_t
+  wireEncode(EncodingImpl<TAG>& encoder) const;
+
+  /** \brief encode FaceEventNotification
+   */
+  const Block&
+  wireEncode() const;
+
+  /** \brief decode FaceEventNotification
+   */
+  void
+  wireDecode(const Block& wire);
+
+public: // getters & setters
+  FaceEventKind
+  getKind() const
+  {
+    return m_kind;
+  }
+
+  FaceEventNotification&
+  setKind(FaceEventKind kind);
+
+protected:
+  void
+  wireReset() const;
+
+private:
+  FaceEventKind m_kind;
+
+  mutable Block m_wire;
+};
+
+std::ostream&
+operator<<(std::ostream& os, const FaceEventNotification& notification);
+
+} // namespace nfd
+} // namespace ndn
+
+#endif // NDN_MGMT_NFD_FACE_EVENT_NOTIFICATION_HPP
diff --git a/src/mgmt/nfd/face-monitor.hpp b/src/mgmt/nfd/face-monitor.hpp
new file mode 100644
index 0000000..5429ea1
--- /dev/null
+++ b/src/mgmt/nfd/face-monitor.hpp
@@ -0,0 +1,72 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2013-2016 Regents of the University of California.
+ *
+ * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-cxx library is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-cxx library 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 Lesser General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ */
+
+/**
+ * Original copyright notice from NFD:
+ *
+ * Copyright (c) 2014,  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 NDN_MGMT_NFD_FACE_MONITOR_HPP
+#define NDN_MGMT_NFD_FACE_MONITOR_HPP
+
+#include "../../util/notification-subscriber.hpp"
+#include "face-event-notification.hpp"
+
+namespace ndn {
+namespace nfd {
+
+/** \brief A subscriber for Face status change notification stream
+ *  \sa http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Face-Status-Change-Notification
+ */
+class FaceMonitor : public util::NotificationSubscriber<FaceEventNotification>
+{
+public:
+  FaceMonitor(Face& face)
+    : NotificationSubscriber<nfd::FaceEventNotification>(face, "ndn:/localhost/nfd/faces/events")
+  {
+  }
+};
+
+} // namespace nfd
+} // namespace ndn
+
+#endif // NDN_MGMT_NFD_FACE_MONITOR_HPP
diff --git a/src/management/nfd-face-query-filter.cpp b/src/mgmt/nfd/face-query-filter.cpp
similarity index 98%
rename from src/management/nfd-face-query-filter.cpp
rename to src/mgmt/nfd/face-query-filter.cpp
index bd10d2b..ffaae90 100644
--- a/src/management/nfd-face-query-filter.cpp
+++ b/src/mgmt/nfd/face-query-filter.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2013-2015 Regents of the University of California.
+ * Copyright (c) 2013-2016 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -19,7 +19,7 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#include "nfd-face-query-filter.hpp"
+#include "face-query-filter.hpp"
 #include "encoding/tlv-nfd.hpp"
 #include "encoding/block-helpers.hpp"
 #include "util/concepts.hpp"
diff --git a/src/mgmt/nfd/face-query-filter.hpp b/src/mgmt/nfd/face-query-filter.hpp
new file mode 100644
index 0000000..e0bb393
--- /dev/null
+++ b/src/mgmt/nfd/face-query-filter.hpp
@@ -0,0 +1,231 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2013-2016 Regents of the University of California.
+ *
+ * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-cxx library is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-cxx library 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 Lesser General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ */
+
+#ifndef NDN_MGMT_NFD_FACE_QUERY_FILTER_HPP
+#define NDN_MGMT_NFD_FACE_QUERY_FILTER_HPP
+
+#include "../../encoding/block.hpp"
+#include "../../encoding/nfd-constants.hpp"
+
+namespace ndn {
+namespace nfd {
+
+/**
+ * \ingroup management
+ * \brief represents Face Query Filter
+ * \sa http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Query-Operation
+ */
+class FaceQueryFilter
+{
+public:
+  class Error : public tlv::Error
+  {
+  public:
+    explicit
+    Error(const std::string& what)
+      : tlv::Error(what)
+    {
+    }
+  };
+
+  FaceQueryFilter();
+
+  explicit
+  FaceQueryFilter(const Block& block);
+
+  /** \brief prepend FaceQueryFilter to the encoder
+   */
+  template<encoding::Tag TAG>
+  size_t
+  wireEncode(EncodingImpl<TAG>& encoder) const;
+
+  /** \brief encode FaceQueryFilter
+   */
+  const Block&
+  wireEncode() const;
+
+  /** \brief decode FaceQueryFilter
+   */
+  void
+  wireDecode(const Block& wire);
+
+public: // getters & setters
+
+  bool
+  hasFaceId() const
+  {
+    return m_hasFaceId;
+  }
+
+  uint64_t
+  getFaceId() const
+  {
+    BOOST_ASSERT(this->hasFaceId());
+    return m_faceId;
+  }
+
+  FaceQueryFilter&
+  setFaceId(uint64_t faceId);
+
+  FaceQueryFilter&
+  unsetFaceId();
+
+  bool
+  hasUriScheme() const
+  {
+    return m_hasUriScheme;
+  }
+
+  const std::string&
+  getUriScheme() const
+  {
+    BOOST_ASSERT(this->hasUriScheme());
+    return m_uriScheme;
+  }
+
+  FaceQueryFilter&
+  setUriScheme(const std::string& uriScheme);
+
+  FaceQueryFilter&
+  unsetUriScheme();
+
+  bool
+  hasRemoteUri() const
+  {
+    return m_hasRemoteUri;
+  }
+
+  const std::string&
+  getRemoteUri() const
+  {
+    BOOST_ASSERT(this->hasRemoteUri());
+    return m_remoteUri;
+  }
+
+  FaceQueryFilter&
+  setRemoteUri(const std::string& remoteUri);
+
+  FaceQueryFilter&
+  unsetRemoteUri();
+
+  bool
+  hasLocalUri() const
+  {
+    return m_hasLocalUri;
+  }
+
+  const std::string&
+  getLocalUri() const
+  {
+    BOOST_ASSERT(this->hasLocalUri());
+    return m_localUri;
+  }
+
+  FaceQueryFilter&
+  setLocalUri(const std::string& localUri);
+
+  FaceQueryFilter&
+  unsetLocalUri();
+
+  bool
+  hasFaceScope() const
+  {
+    return m_hasFaceScope;
+  }
+
+  FaceScope
+  getFaceScope() const
+  {
+    BOOST_ASSERT(this->hasFaceScope());
+    return m_faceScope;
+  }
+
+  FaceQueryFilter&
+  setFaceScope(FaceScope faceScope);
+
+  FaceQueryFilter&
+  unsetFaceScope();
+
+  bool
+  hasFacePersistency() const
+  {
+    return m_hasFacePersistency;
+  }
+
+  FacePersistency
+  getFacePersistency() const
+  {
+    BOOST_ASSERT(this->hasFacePersistency());
+    return m_facePersistency;
+  }
+
+  FaceQueryFilter&
+  setFacePersistency(FacePersistency facePersistency);
+
+  FaceQueryFilter&
+  unsetFacePersistency();
+
+  bool
+  hasLinkType() const
+  {
+    return m_hasLinkType;
+  }
+
+  LinkType
+  getLinkType() const
+  {
+    BOOST_ASSERT(this->hasLinkType());
+    return m_linkType;
+  }
+
+  FaceQueryFilter&
+  setLinkType(LinkType linkType);
+
+  FaceQueryFilter&
+  unsetLinkType();
+
+private:
+  uint64_t m_faceId;
+  std::string m_uriScheme;
+  std::string m_remoteUri;
+  std::string m_localUri;
+  FaceScope m_faceScope;
+  FacePersistency m_facePersistency;
+  LinkType m_linkType;
+
+  bool m_hasFaceId;
+  bool m_hasUriScheme;
+  bool m_hasRemoteUri;
+  bool m_hasLocalUri;
+  bool m_hasFaceScope;
+  bool m_hasFacePersistency;
+  bool m_hasLinkType;
+
+  mutable Block m_wire;
+};
+
+std::ostream&
+operator<<(std::ostream& os, const FaceQueryFilter& filter);
+
+} // namespace nfd
+} // namespace ndn
+
+#endif // NDN_MGMT_NFD_FACE_QUERY_FILTER_HPP
diff --git a/src/management/nfd-face-status.cpp b/src/mgmt/nfd/face-status.cpp
similarity index 98%
rename from src/management/nfd-face-status.cpp
rename to src/mgmt/nfd/face-status.cpp
index ca24a99..bdc7404 100644
--- a/src/management/nfd-face-status.cpp
+++ b/src/mgmt/nfd/face-status.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2013-2015 Regents of the University of California.
+ * Copyright (c) 2013-2016 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -19,7 +19,7 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#include "nfd-face-status.hpp"
+#include "face-status.hpp"
 #include "encoding/tlv-nfd.hpp"
 #include "encoding/block-helpers.hpp"
 #include "util/concepts.hpp"
diff --git a/src/mgmt/nfd/face-status.hpp b/src/mgmt/nfd/face-status.hpp
new file mode 100644
index 0000000..4f20e53
--- /dev/null
+++ b/src/mgmt/nfd/face-status.hpp
@@ -0,0 +1,175 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2013-2016 Regents of the University of California.
+ *
+ * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-cxx library is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-cxx library 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 Lesser General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ */
+
+#ifndef NDN_MGMT_NFD_FACE_STATUS_HPP
+#define NDN_MGMT_NFD_FACE_STATUS_HPP
+
+#include "face-traits.hpp" // include this first, to ensure it compiles on its own.
+#include "../../encoding/block.hpp"
+#include "../../util/time.hpp"
+
+namespace ndn {
+namespace nfd {
+
+/**
+ * \ingroup management
+ * \brief represents Face status
+ * \sa http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Face-Dataset
+ */
+class FaceStatus : public FaceTraits<FaceStatus>
+{
+public:
+  FaceStatus();
+
+  explicit
+  FaceStatus(const Block& block);
+
+  /** \brief prepend FaceStatus to the encoder
+   */
+  template<encoding::Tag TAG>
+  size_t
+  wireEncode(EncodingImpl<TAG>& encoder) const;
+
+  /** \brief encode FaceStatus
+   */
+  const Block&
+  wireEncode() const;
+
+  /** \brief decode FaceStatus
+   */
+  void
+  wireDecode(const Block& wire);
+
+public: // getters & setters
+  bool
+  hasExpirationPeriod() const
+  {
+    return m_hasExpirationPeriod;
+  }
+
+  const time::milliseconds&
+  getExpirationPeriod() const
+  {
+    BOOST_ASSERT(m_hasExpirationPeriod);
+    return m_expirationPeriod;
+  }
+
+  FaceStatus&
+  setExpirationPeriod(const time::milliseconds& expirationPeriod);
+
+  uint64_t
+  getNInInterests() const
+  {
+    return m_nInInterests;
+  }
+
+  FaceStatus&
+  setNInInterests(uint64_t nInInterests);
+
+  uint64_t
+  getNInDatas() const
+  {
+    return m_nInDatas;
+  }
+
+  FaceStatus&
+  setNInDatas(uint64_t nInDatas);
+
+  uint64_t
+  getNInNacks() const
+  {
+    return m_nInNacks;
+  }
+
+  FaceStatus&
+  setNInNacks(uint64_t nInNacks);
+
+  uint64_t
+  getNOutInterests() const
+  {
+    return m_nOutInterests;
+  }
+
+  FaceStatus&
+  setNOutInterests(uint64_t nOutInterests);
+
+  uint64_t
+  getNOutDatas() const
+  {
+    return m_nOutDatas;
+  }
+
+  FaceStatus&
+  setNOutDatas(uint64_t nOutDatas);
+
+  uint64_t
+  getNOutNacks() const
+  {
+    return m_nOutNacks;
+  }
+
+  FaceStatus&
+  setNOutNacks(uint64_t nOutNacks);
+
+  uint64_t
+  getNInBytes() const
+  {
+    return m_nInBytes;
+  }
+
+  FaceStatus&
+  setNInBytes(uint64_t nInBytes);
+
+  uint64_t
+  getNOutBytes() const
+  {
+    return m_nOutBytes;
+  }
+
+  FaceStatus&
+  setNOutBytes(uint64_t nOutBytes);
+
+protected:
+  void
+  wireReset() const;
+
+private:
+  time::milliseconds m_expirationPeriod;
+  bool m_hasExpirationPeriod;
+  uint64_t m_nInInterests;
+  uint64_t m_nInDatas;
+  uint64_t m_nInNacks;
+  uint64_t m_nOutInterests;
+  uint64_t m_nOutDatas;
+  uint64_t m_nOutNacks;
+  uint64_t m_nInBytes;
+  uint64_t m_nOutBytes;
+
+  mutable Block m_wire;
+};
+
+std::ostream&
+operator<<(std::ostream& os, const FaceStatus& status);
+
+} // namespace nfd
+} // namespace ndn
+
+#endif // NDN_MGMT_NFD_FACE_STATUS_HPP
diff --git a/src/mgmt/nfd/face-traits.hpp b/src/mgmt/nfd/face-traits.hpp
new file mode 100644
index 0000000..d9422c3
--- /dev/null
+++ b/src/mgmt/nfd/face-traits.hpp
@@ -0,0 +1,157 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2013-2016 Regents of the University of California.
+ *
+ * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-cxx library is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-cxx library 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 Lesser General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ */
+
+#ifndef NDN_MGMT_NFD_FACE_TRAITS_HPP
+#define NDN_MGMT_NFD_FACE_TRAITS_HPP
+
+#include "../../encoding/tlv-nfd.hpp"
+
+namespace ndn {
+namespace nfd {
+
+/** \ingroup management
+ *  \brief providers getters and setters of face information fields
+ *  \tparam C the concrete class; it must provide .wireReset() method
+            to clear wire encoding when a field changes
+ */
+template<class C>
+class FaceTraits
+{
+public:
+  class Error : public tlv::Error
+  {
+  public:
+    explicit
+    Error(const std::string& what)
+      : tlv::Error(what)
+    {
+    }
+  };
+
+  FaceTraits()
+    : m_faceId(0)
+    , m_faceScope(FACE_SCOPE_NON_LOCAL)
+    , m_facePersistency(FACE_PERSISTENCY_PERSISTENT)
+    , m_linkType(LINK_TYPE_POINT_TO_POINT)
+  {
+  }
+
+  uint64_t
+  getFaceId() const
+  {
+    return m_faceId;
+  }
+
+  C&
+  setFaceId(uint64_t faceId)
+  {
+    wireReset();
+    m_faceId = faceId;
+    return static_cast<C&>(*this);
+  }
+
+  const std::string&
+  getRemoteUri() const
+  {
+    return m_remoteUri;
+  }
+
+  C&
+  setRemoteUri(const std::string& remoteUri)
+  {
+    wireReset();
+    m_remoteUri = remoteUri;
+    return static_cast<C&>(*this);
+  }
+
+  const std::string&
+  getLocalUri() const
+  {
+    return m_localUri;
+  }
+
+  C&
+  setLocalUri(const std::string& localUri)
+  {
+    wireReset();
+    m_localUri = localUri;
+    return static_cast<C&>(*this);
+  }
+
+  FaceScope
+  getFaceScope() const
+  {
+    return m_faceScope;
+  }
+
+  C&
+  setFaceScope(FaceScope faceScope)
+  {
+    wireReset();
+    m_faceScope = faceScope;
+    return static_cast<C&>(*this);
+  }
+
+  FacePersistency
+  getFacePersistency() const
+  {
+    return m_facePersistency;
+  }
+
+  C&
+  setFacePersistency(FacePersistency facePersistency)
+  {
+    wireReset();
+    m_facePersistency = facePersistency;
+    return static_cast<C&>(*this);
+  }
+
+  LinkType
+  getLinkType() const
+  {
+    return m_linkType;
+  }
+
+  C&
+  setLinkType(LinkType linkType)
+  {
+    wireReset();
+    m_linkType = linkType;
+    return static_cast<C&>(*this);
+  }
+
+protected:
+  virtual void
+  wireReset() const = 0;
+
+protected:
+  uint64_t m_faceId;
+  std::string m_remoteUri;
+  std::string m_localUri;
+  FaceScope m_faceScope;
+  FacePersistency  m_facePersistency;
+  LinkType m_linkType;
+};
+
+} // namespace nfd
+} // namespace ndn
+
+#endif // NDN_MGMT_NFD_FACE_TRAITS_HPP
diff --git a/src/management/nfd-fib-entry.cpp b/src/mgmt/nfd/fib-entry.cpp
similarity index 98%
rename from src/management/nfd-fib-entry.cpp
rename to src/mgmt/nfd/fib-entry.cpp
index fb07329..dd1092f 100644
--- a/src/management/nfd-fib-entry.cpp
+++ b/src/mgmt/nfd/fib-entry.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2013-2015 Regents of the University of California.
+ * Copyright (c) 2013-2016 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -19,7 +19,7 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#include "nfd-fib-entry.hpp"
+#include "fib-entry.hpp"
 #include <sstream>
 #include "encoding/tlv-nfd.hpp"
 #include "encoding/block-helpers.hpp"
diff --git a/src/mgmt/nfd/fib-entry.hpp b/src/mgmt/nfd/fib-entry.hpp
new file mode 100644
index 0000000..6a7304c
--- /dev/null
+++ b/src/mgmt/nfd/fib-entry.hpp
@@ -0,0 +1,155 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2013-2016 Regents of the University of California.
+ *
+ * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-cxx library is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-cxx library 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 Lesser General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ */
+
+#ifndef NDN_MGMT_NFD_FIB_ENTRY_HPP
+#define NDN_MGMT_NFD_FIB_ENTRY_HPP
+
+#include "../../encoding/block.hpp"
+#include "../../name.hpp"
+#include <list>
+
+namespace ndn {
+namespace nfd {
+
+/** @ingroup management
+ */
+class NextHopRecord
+{
+public:
+  class Error : public tlv::Error
+  {
+  public:
+    explicit
+    Error(const std::string& what)
+      : tlv::Error(what)
+    {
+    }
+  };
+
+  NextHopRecord();
+
+  explicit
+  NextHopRecord(const Block& block);
+
+  uint64_t
+  getFaceId() const
+  {
+    return m_faceId;
+  }
+
+  NextHopRecord&
+  setFaceId(uint64_t faceId);
+
+  uint64_t
+  getCost() const
+  {
+    return m_cost;
+  }
+
+  NextHopRecord&
+  setCost(uint64_t cost);
+
+  template<encoding::Tag TAG>
+  size_t
+  wireEncode(EncodingImpl<TAG>& block) const;
+
+  const Block&
+  wireEncode() const;
+
+  void
+  wireDecode(const Block& wire);
+
+private:
+  uint64_t m_faceId;
+  uint64_t m_cost;
+
+  mutable Block m_wire;
+};
+
+/** @ingroup management
+ */
+class FibEntry
+{
+public:
+  class Error : public tlv::Error
+  {
+  public:
+    explicit
+    Error(const std::string& what)
+      : tlv::Error(what)
+    {
+    }
+  };
+
+  FibEntry();
+
+  explicit
+  FibEntry(const Block& block);
+
+  const Name&
+  getPrefix() const
+  {
+    return m_prefix;
+  }
+
+  FibEntry&
+  setPrefix(const Name& prefix);
+
+  const std::list<NextHopRecord>&
+  getNextHopRecords() const
+  {
+    return m_nextHopRecords;
+  }
+
+  FibEntry&
+  addNextHopRecord(const NextHopRecord& nextHopRecord);
+
+  template<typename T>
+  FibEntry&
+  setNextHopRecords(const T& begin, const T& end)
+  {
+    m_nextHopRecords.clear();
+    m_nextHopRecords.assign(begin, end);
+    m_wire.reset();
+    return *this;
+  }
+
+  template<encoding::Tag TAG>
+  size_t
+  wireEncode(EncodingImpl<TAG>& block) const;
+
+  const Block&
+  wireEncode() const;
+
+  void
+  wireDecode(const Block& wire);
+
+private:
+  Name m_prefix;
+  std::list<NextHopRecord> m_nextHopRecords;
+
+  mutable Block m_wire;
+};
+
+} // namespace nfd
+} // namespace ndn
+
+#endif // NDN_MGMT_NFD_FIB_ENTRY_HPP
diff --git a/src/management/nfd-forwarder-status.cpp b/src/mgmt/nfd/forwarder-status.cpp
similarity index 98%
rename from src/management/nfd-forwarder-status.cpp
rename to src/mgmt/nfd/forwarder-status.cpp
index 8292f19..21fee56 100644
--- a/src/management/nfd-forwarder-status.cpp
+++ b/src/mgmt/nfd/forwarder-status.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2013-2015 Regents of the University of California.
+ * Copyright (c) 2013-2016 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -19,7 +19,7 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#include "nfd-forwarder-status.hpp"
+#include "forwarder-status.hpp"
 #include "encoding/tlv-nfd.hpp"
 #include "encoding/block-helpers.hpp"
 #include "util/concepts.hpp"
diff --git a/src/mgmt/nfd/forwarder-status.hpp b/src/mgmt/nfd/forwarder-status.hpp
new file mode 100644
index 0000000..4601610
--- /dev/null
+++ b/src/mgmt/nfd/forwarder-status.hpp
@@ -0,0 +1,225 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2013-2016 Regents of the University of California.
+ *
+ * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-cxx library is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-cxx library 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 Lesser General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ */
+
+#ifndef NDN_MGMT_NFD_FORWARDER_STATUS_HPP
+#define NDN_MGMT_NFD_FORWARDER_STATUS_HPP
+
+#include "../../encoding/block.hpp"
+#include "../../util/time.hpp"
+
+namespace ndn {
+namespace nfd {
+
+/**
+ * \ingroup management
+ * \brief represents NFD Forwarder Status
+ * \sa http://redmine.named-data.net/projects/nfd/wiki/ForwarderStatus
+ */
+class ForwarderStatus
+{
+public:
+  class Error : public tlv::Error
+  {
+  public:
+    explicit
+    Error(const std::string& what)
+      : tlv::Error(what)
+    {
+    }
+  };
+
+  ForwarderStatus();
+
+  explicit
+  ForwarderStatus(const Block& payload);
+
+  /** \brief prepend ForwarderStatus as a Content block to the encoder
+   *
+   *  The outermost Content element isn't part of ForwardStatus structure.
+   */
+  template<encoding::Tag TAG>
+  size_t
+  wireEncode(EncodingImpl<TAG>& encoder) const;
+
+  /** \brief encode ForwarderStatus as a Content block
+   *
+   *  The outermost Content element isn't part of ForwardStatus structure.
+   */
+  const Block&
+  wireEncode() const;
+
+  /** \brief decode ForwarderStatus from a Content block
+   *
+   *  The outermost Content element isn't part of ForwardStatus structure.
+   */
+  void
+  wireDecode(const Block& wire);
+
+public: // getters & setters
+  const std::string&
+  getNfdVersion() const
+  {
+    return m_nfdVersion;
+  }
+
+  ForwarderStatus&
+  setNfdVersion(const std::string& nfdVersion);
+
+  const time::system_clock::TimePoint&
+  getStartTimestamp() const
+  {
+    return m_startTimestamp;
+  }
+
+  ForwarderStatus&
+  setStartTimestamp(const time::system_clock::TimePoint& startTimestamp);
+
+  const time::system_clock::TimePoint&
+  getCurrentTimestamp() const
+  {
+    return m_currentTimestamp;
+  }
+
+  ForwarderStatus&
+  setCurrentTimestamp(const time::system_clock::TimePoint& currentTimestamp);
+
+  size_t
+  getNNameTreeEntries() const
+  {
+    return m_nNameTreeEntries;
+  }
+
+  ForwarderStatus&
+  setNNameTreeEntries(size_t nNameTreeEntries);
+
+  size_t
+  getNFibEntries() const
+  {
+    return m_nFibEntries;
+  }
+
+  ForwarderStatus&
+  setNFibEntries(size_t nFibEntries);
+
+  size_t
+  getNPitEntries() const
+  {
+    return m_nPitEntries;
+  }
+
+  ForwarderStatus&
+  setNPitEntries(size_t nPitEntries);
+
+  size_t
+  getNMeasurementsEntries() const
+  {
+    return m_nMeasurementsEntries;
+  }
+
+  ForwarderStatus&
+  setNMeasurementsEntries(size_t nMeasurementsEntries);
+
+  size_t
+  getNCsEntries() const
+  {
+    return m_nCsEntries;
+  }
+
+  ForwarderStatus&
+  setNCsEntries(size_t nCsEntries);
+
+  uint64_t
+  getNInInterests() const
+  {
+    return m_nInInterests;
+  }
+
+  ForwarderStatus&
+  setNInInterests(uint64_t nInInterests);
+
+  uint64_t
+  getNInDatas() const
+  {
+    return m_nInDatas;
+  }
+
+  ForwarderStatus&
+  setNInDatas(uint64_t nInDatas);
+
+  uint64_t
+  getNInNacks() const
+  {
+    return m_nInNacks;
+  }
+
+  ForwarderStatus&
+  setNInNacks(uint64_t nInNacks);
+
+  uint64_t
+  getNOutInterests() const
+  {
+    return m_nOutInterests;
+  }
+
+  ForwarderStatus&
+  setNOutInterests(uint64_t nOutInterests);
+
+  uint64_t
+  getNOutDatas() const
+  {
+    return m_nOutDatas;
+  }
+
+  ForwarderStatus&
+  setNOutDatas(uint64_t nOutDatas);
+
+  uint64_t
+  getNOutNacks() const
+  {
+    return m_nOutNacks;
+  }
+
+  ForwarderStatus&
+  setNOutNacks(uint64_t nOutNacks);
+
+private:
+  std::string m_nfdVersion;
+  time::system_clock::TimePoint m_startTimestamp;
+  time::system_clock::TimePoint m_currentTimestamp;
+  size_t m_nNameTreeEntries;
+  size_t m_nFibEntries;
+  size_t m_nPitEntries;
+  size_t m_nMeasurementsEntries;
+  size_t m_nCsEntries;
+  uint64_t m_nInInterests;
+  uint64_t m_nInDatas;
+  uint64_t m_nInNacks;
+  uint64_t m_nOutInterests;
+  uint64_t m_nOutDatas;
+  uint64_t m_nOutNacks;
+
+  mutable Block m_wire;
+};
+
+} // namespace nfd
+} // namespace ndn
+
+#endif // NDN_MGMT_NFD_FORWARDER_STATUS_HPP
diff --git a/src/management/nfd-rib-entry.cpp b/src/mgmt/nfd/rib-entry.cpp
similarity index 98%
rename from src/management/nfd-rib-entry.cpp
rename to src/mgmt/nfd/rib-entry.cpp
index 7c056cd..d47d316 100644
--- a/src/management/nfd-rib-entry.cpp
+++ b/src/mgmt/nfd/rib-entry.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2013-2015 Regents of the University of California.
+ * Copyright (c) 2013-2016 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -19,7 +19,7 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#include "nfd-rib-entry.hpp"
+#include "rib-entry.hpp"
 #include "encoding/tlv-nfd.hpp"
 #include "encoding/block-helpers.hpp"
 #include "util/concepts.hpp"
diff --git a/src/mgmt/nfd/rib-entry.hpp b/src/mgmt/nfd/rib-entry.hpp
new file mode 100644
index 0000000..6c1c5a2
--- /dev/null
+++ b/src/mgmt/nfd/rib-entry.hpp
@@ -0,0 +1,287 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2013-2016 Regents of the University of California.
+ *
+ * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-cxx library is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-cxx library 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 Lesser General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ */
+
+#ifndef NDN_MGMT_NFD_RIB_ENTRY_HPP
+#define NDN_MGMT_NFD_RIB_ENTRY_HPP
+
+#include "rib-flags.hpp" // include this first, to ensure it compiles on its own.
+#include "../../name.hpp"
+#include "../../util/time.hpp"
+
+#include <list>
+
+namespace ndn {
+namespace nfd {
+
+/**
+ * @ingroup management
+ *
+ * @brief Data abstraction for Route
+ *
+ * A route indicates the availability of content via a certain face and
+ * provides meta-information about the face.
+ *
+ *     Route := ROUTE-TYPE TLV-LENGTH
+ *                FaceId
+ *                Origin
+ *                Cost
+ *                Flags
+ *                ExpirationPeriod?
+ *
+ * @sa http://redmine.named-data.net/projects/nfd/wiki/RibMgmt
+ */
+class Route : public RibFlagsTraits<Route>
+{
+public:
+  class Error : public tlv::Error
+  {
+  public:
+    explicit
+    Error(const std::string& what) : tlv::Error(what)
+    {
+    }
+  };
+
+  Route();
+
+  explicit
+  Route(const Block& block);
+
+  uint64_t
+  getFaceId() const
+  {
+    return m_faceId;
+  }
+
+  Route&
+  setFaceId(uint64_t faceId)
+  {
+    m_faceId = faceId;
+    m_wire.reset();
+    return *this;
+  }
+
+  uint64_t
+  getOrigin() const
+  {
+    return m_origin;
+  }
+
+  /** @brief set Origin
+   *  @param origin a code defined in ndn::nfd::RouteOrigin
+   */
+  Route&
+  setOrigin(uint64_t origin)
+  {
+    m_origin = origin;
+    m_wire.reset();
+    return *this;
+  }
+
+  uint64_t
+  getCost() const
+  {
+    return m_cost;
+  }
+
+  Route&
+  setCost(uint64_t cost)
+  {
+    m_cost = cost;
+    m_wire.reset();
+    return *this;
+  }
+
+  uint64_t
+  getFlags() const
+  {
+    return m_flags;
+  }
+
+  /** @brief set route inheritance flags
+   *  @param flags a bitwise OR'ed code from ndn::nfd::RouteFlags
+   */
+  Route&
+  setFlags(uint64_t flags)
+  {
+    m_flags = flags;
+    m_wire.reset();
+    return *this;
+  }
+
+  static const time::milliseconds INFINITE_EXPIRATION_PERIOD;
+
+  const time::milliseconds&
+  getExpirationPeriod() const
+  {
+    return m_expirationPeriod;
+  }
+
+  Route&
+  setExpirationPeriod(const time::milliseconds& expirationPeriod)
+  {
+    m_expirationPeriod = expirationPeriod;
+
+    m_hasInfiniteExpirationPeriod = m_expirationPeriod == INFINITE_EXPIRATION_PERIOD;
+
+    m_wire.reset();
+    return *this;
+  }
+
+  bool
+  hasInfiniteExpirationPeriod() const
+  {
+    return m_hasInfiniteExpirationPeriod;
+  }
+
+  template<encoding::Tag TAG>
+  size_t
+  wireEncode(EncodingImpl<TAG>& block) const;
+
+  const Block&
+  wireEncode() const;
+
+  void
+  wireDecode(const Block& wire);
+
+private:
+  uint64_t m_faceId;
+  uint64_t m_origin;
+  uint64_t m_cost;
+  uint64_t m_flags;
+  time::milliseconds m_expirationPeriod;
+  bool m_hasInfiniteExpirationPeriod;
+
+  mutable Block m_wire;
+};
+
+std::ostream&
+operator<<(std::ostream& os, const Route& route);
+
+/**
+ * @ingroup management
+ *
+ * @brief Data abstraction for RIB entry
+ *
+ * A RIB entry contains one or more routes for the name prefix
+ *
+ *     RibEntry := RIB-ENTRY-TYPE TLV-LENGTH
+ *                Name
+ *                Route+
+ *
+ * @sa http://redmine.named-data.net/projects/nfd/wiki/RibMgmt
+ */
+class RibEntry
+{
+public:
+  class Error : public tlv::Error
+  {
+  public:
+    Error(const std::string& what) : tlv::Error(what)
+    {
+    }
+  };
+
+  typedef std::list<Route> RouteList;
+  typedef RouteList::const_iterator iterator;
+
+  RibEntry();
+
+  explicit
+  RibEntry(const Block& block);
+
+  const Name&
+  getName() const
+  {
+    return m_prefix;
+  }
+
+  RibEntry&
+  setName(const Name& prefix)
+  {
+    m_prefix = prefix;
+    m_wire.reset();
+    return *this;
+  }
+
+  const std::list<Route>&
+  getRoutes() const
+  {
+    return m_routes;
+  }
+
+  RibEntry&
+  addRoute(const Route& route)
+  {
+    m_routes.push_back(route);
+    m_wire.reset();
+    return *this;
+  }
+
+  RibEntry&
+  clearRoutes()
+  {
+    m_routes.clear();
+    return *this;
+  }
+
+  template<encoding::Tag TAG>
+  size_t
+  wireEncode(EncodingImpl<TAG>& block) const;
+
+  const Block&
+  wireEncode() const;
+
+  void
+  wireDecode(const Block& wire);
+
+  iterator
+  begin() const;
+
+  iterator
+  end() const;
+
+private:
+  Name m_prefix;
+  RouteList m_routes;
+
+  mutable Block m_wire;
+};
+
+inline RibEntry::iterator
+RibEntry::begin() const
+{
+  return m_routes.begin();
+}
+
+inline RibEntry::iterator
+RibEntry::end() const
+{
+  return m_routes.end();
+}
+
+std::ostream&
+operator<<(std::ostream& os, const RibEntry& entry);
+
+} // namespace nfd
+} // namespace ndn
+
+#endif // NDN_MGMT_NFD_RIB_ENTRY_HPP
diff --git a/src/mgmt/nfd/rib-flags.hpp b/src/mgmt/nfd/rib-flags.hpp
new file mode 100644
index 0000000..158048f
--- /dev/null
+++ b/src/mgmt/nfd/rib-flags.hpp
@@ -0,0 +1,57 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2013-2016 Regents of the University of California.
+ *
+ * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-cxx library is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-cxx library 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 Lesser General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ */
+
+#ifndef NDN_MGMT_NFD_RIB_FLAGS_HPP
+#define NDN_MGMT_NFD_RIB_FLAGS_HPP
+
+#include "../../encoding/nfd-constants.hpp"
+
+namespace ndn {
+namespace nfd {
+
+/**
+ * \ingroup management
+ * \brief implements getters to each RIB flag
+ *
+ * \tparam T class containing a RibFlags field and implements
+ *           `RibFlags getFlags() const` method
+ */
+template<typename T>
+class RibFlagsTraits
+{
+public:
+  bool
+  isChildInherit() const
+  {
+    return static_cast<const T*>(this)->getFlags() & ROUTE_FLAG_CHILD_INHERIT;
+  }
+
+  bool
+  isRibCapture() const
+  {
+    return static_cast<const T*>(this)->getFlags() & ROUTE_FLAG_CAPTURE;
+  }
+};
+
+} // namespace nfd
+} // namespace ndn
+
+#endif // NDN_MGMT_NFD_RIB_FLAGS_HPP
diff --git a/src/management/nfd-status-dataset.cpp b/src/mgmt/nfd/status-dataset.cpp
similarity index 97%
rename from src/management/nfd-status-dataset.cpp
rename to src/mgmt/nfd/status-dataset.cpp
index 9516e85..ca5f5df 100644
--- a/src/management/nfd-status-dataset.cpp
+++ b/src/mgmt/nfd/status-dataset.cpp
@@ -19,8 +19,8 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#include "nfd-status-dataset.hpp"
-#include "../util/concepts.hpp"
+#include "status-dataset.hpp"
+#include "../../util/concepts.hpp"
 
 namespace ndn {
 namespace nfd {
diff --git a/src/mgmt/nfd/status-dataset.hpp b/src/mgmt/nfd/status-dataset.hpp
new file mode 100644
index 0000000..9eb43d4
--- /dev/null
+++ b/src/mgmt/nfd/status-dataset.hpp
@@ -0,0 +1,252 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2013-2016 Regents of the University of California.
+ *
+ * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-cxx library is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-cxx library 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 Lesser General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ */
+
+#ifndef NDN_MGMT_NFD_STATUS_DATASET_HPP
+#define NDN_MGMT_NFD_STATUS_DATASET_HPP
+
+#include "../../name.hpp"
+#include "forwarder-status.hpp"
+#include "face-status.hpp"
+#include "face-query-filter.hpp"
+#include "channel-status.hpp"
+#include "fib-entry.hpp"
+#include "strategy-choice.hpp"
+#include "rib-entry.hpp"
+
+namespace ndn {
+namespace nfd {
+
+/**
+ * \ingroup management
+ * \brief base class of NFD StatusDataset
+ * \sa http://redmine.named-data.net/projects/nfd/wiki/StatusDataset
+ */
+class StatusDataset : noncopyable
+{
+public:
+#ifdef DOXYGEN
+  /**
+   * \brief if defined, specifies constructor argument type;
+   *        otherwise, constructor has no argument
+   */
+  typedef int ParamType;
+#endif
+
+  /**
+   * \brief constructs a name prefix for the dataset
+   * \param prefix top-level prefix, such as ndn:/localhost/nfd
+   * \return name prefix without version and segment components
+   */
+  Name
+  getDatasetPrefix(const Name& prefix) const;
+
+#ifdef DOXYGEN
+  /**
+   * \brief provides the result type, usually a vector
+   */
+  typedef std::vector<int> ResultType;
+#endif
+
+  /**
+   * \brief indicates reassembled payload cannot be parsed as ResultType
+   */
+  class ParseResultError : public tlv::Error
+  {
+  public:
+    explicit
+    ParseResultError(const std::string& what)
+      : tlv::Error(what)
+    {
+    }
+  };
+
+#ifdef DOXYGEN
+  /**
+   * \brief parses a result from reassembled payload
+   * \param payload reassembled payload
+   * \throw tlv::Error cannot parse payload
+   */
+  ResultType
+  parseResult(ConstBufferPtr payload) const;
+#endif
+
+protected:
+  /**
+   * \brief constructs a StatusDataset instance with given sub-prefix
+   * \param datasetName dataset name after top-level prefix, such as faces/list
+   */
+  explicit
+  StatusDataset(const PartialName& datasetName);
+
+private:
+  /**
+   * \brief appends parameters to the dataset name prefix
+   * \param[in,out] the dataset name prefix onto which parameter components can be appended
+   */
+  virtual void
+  addParameters(Name& name) const;
+
+private:
+  PartialName m_datasetName;
+};
+
+
+/**
+ * \ingroup management
+ * \brief represents a status/general dataset
+ * \sa http://redmine.named-data.net/projects/nfd/wiki/ForwarderStatus#General-Status-Dataset
+ */
+class ForwarderGeneralStatusDataset : public StatusDataset
+{
+public:
+  ForwarderGeneralStatusDataset();
+
+  typedef ForwarderStatus ResultType;
+
+  ResultType
+  parseResult(ConstBufferPtr payload) const;
+};
+
+
+/**
+ * \ingroup management
+ * \brief provides common functionality among FaceDataset and FaceQueryDataset
+ */
+class FaceDatasetBase : public StatusDataset
+{
+public:
+  typedef std::vector<FaceStatus> ResultType;
+
+  ResultType
+  parseResult(ConstBufferPtr payload) const;
+
+protected:
+  explicit
+  FaceDatasetBase(const PartialName& datasetName);
+};
+
+
+/**
+ * \ingroup management
+ * \brief represents a faces/list dataset
+ * \sa http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Face-Dataset
+ */
+class FaceDataset : public FaceDatasetBase
+{
+public:
+  FaceDataset();
+};
+
+
+/**
+ * \ingroup management
+ * \brief represents a faces/query dataset
+ * \sa http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Query-Operation
+ */
+class FaceQueryDataset : public FaceDatasetBase
+{
+public:
+  typedef FaceQueryFilter ParamType;
+
+  explicit
+  FaceQueryDataset(const FaceQueryFilter& filter);
+
+private:
+  virtual void
+  addParameters(Name& name) const override;
+
+private:
+  FaceQueryFilter m_filter;
+};
+
+
+/**
+ * \ingroup management
+ * \brief represents a faces/channels dataset
+ * \sa https://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Channel-Dataset
+ */
+class ChannelDataset : public StatusDataset
+{
+public:
+  ChannelDataset();
+
+  typedef std::vector<ChannelStatus> ResultType;
+
+  ResultType
+  parseResult(ConstBufferPtr payload) const;
+};
+
+
+/**
+ * \ingroup management
+ * \brief represents a fib/list dataset
+ * \sa http://redmine.named-data.net/projects/nfd/wiki/FibMgmt#FIB-Dataset
+ */
+class FibDataset : public StatusDataset
+{
+public:
+  FibDataset();
+
+  typedef std::vector<FibEntry> ResultType;
+
+  ResultType
+  parseResult(ConstBufferPtr payload) const;
+};
+
+
+/**
+ * \ingroup management
+ * \brief represents a strategy-choice/list dataset
+ * \sa http://redmine.named-data.net/projects/nfd/wiki/StrategyChoice#Strategy-Choice-Dataset
+ */
+class StrategyChoiceDataset : public StatusDataset
+{
+public:
+  StrategyChoiceDataset();
+
+  typedef std::vector<StrategyChoice> ResultType;
+
+  ResultType
+  parseResult(ConstBufferPtr payload) const;
+};
+
+
+/**
+ * \ingroup management
+ * \brief represents a rib/list dataset
+ * \sa http://redmine.named-data.net/projects/nfd/wiki/RibMgmt#RIB-Dataset
+ */
+class RibDataset : public StatusDataset
+{
+public:
+  RibDataset();
+
+  typedef std::vector<RibEntry> ResultType;
+
+  ResultType
+  parseResult(ConstBufferPtr payload) const;
+};
+
+
+} // namespace nfd
+} // namespace ndn
+
+#endif // NDN_MGMT_NFD_STATUS_DATASET_HPP
diff --git a/src/management/nfd-strategy-choice.cpp b/src/mgmt/nfd/strategy-choice.cpp
similarity index 96%
rename from src/management/nfd-strategy-choice.cpp
rename to src/mgmt/nfd/strategy-choice.cpp
index 659293c..2e294d7 100644
--- a/src/management/nfd-strategy-choice.cpp
+++ b/src/mgmt/nfd/strategy-choice.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2013-2015 Regents of the University of California.
+ * Copyright (c) 2013-2016 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -19,7 +19,7 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#include "nfd-strategy-choice.hpp"
+#include "strategy-choice.hpp"
 #include "encoding/tlv-nfd.hpp"
 #include "encoding/block-helpers.hpp"
 #include "util/concepts.hpp"
diff --git a/src/mgmt/nfd/strategy-choice.hpp b/src/mgmt/nfd/strategy-choice.hpp
new file mode 100644
index 0000000..8cdaa59
--- /dev/null
+++ b/src/mgmt/nfd/strategy-choice.hpp
@@ -0,0 +1,93 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2013-2016 Regents of the University of California.
+ *
+ * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-cxx library is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-cxx library 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 Lesser General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ */
+
+#ifndef NDN_MGMT_NFD_STRATEGY_CHOICE_HPP
+#define NDN_MGMT_NFD_STRATEGY_CHOICE_HPP
+
+#include "../../encoding/block.hpp"
+#include "../../name.hpp"
+
+namespace ndn {
+namespace nfd {
+
+/**
+ * @ingroup management
+ * @brief represents NFD StrategyChoice dataset
+ * @sa http://redmine.named-data.net/projects/nfd/wiki/StrategyChoice#Strategy-Choice-Dataset
+ */
+class StrategyChoice
+{
+public:
+  class Error : public tlv::Error
+  {
+  public:
+    explicit
+    Error(const std::string& what)
+      : tlv::Error(what)
+    {
+    }
+  };
+
+  StrategyChoice();
+
+  explicit
+  StrategyChoice(const Block& payload);
+
+  template<encoding::Tag TAG>
+  size_t
+  wireEncode(EncodingImpl<TAG>& encoder) const;
+
+  const Block&
+  wireEncode() const;
+
+  void
+  wireDecode(const Block& wire);
+
+public: // getters & setters
+  const Name&
+  getName() const
+  {
+    return m_name;
+  }
+
+  StrategyChoice&
+  setName(const Name& name);
+
+  const Name&
+  getStrategy() const
+  {
+    return m_strategy;
+  }
+
+  StrategyChoice&
+  setStrategy(const Name& strategy);
+
+private:
+  Name m_name; // namespace
+  Name m_strategy; // strategy for the namespace
+
+  mutable Block m_wire;
+};
+
+} // namespace nfd
+} // namespace ndn
+
+#endif // NDN_MGMT_NFD_STRATEGY_CHOICE_HPP
diff --git a/src/util/dummy-client-face.cpp b/src/util/dummy-client-face.cpp
index 13327c6..fb454cb 100644
--- a/src/util/dummy-client-face.cpp
+++ b/src/util/dummy-client-face.cpp
@@ -20,9 +20,10 @@
  */
 
 #include "dummy-client-face.hpp"
+#include "../lp/tags.hpp"
+#include "../mgmt/nfd/controller.hpp"
+#include "../mgmt/nfd/control-response.hpp"
 #include "../transport/transport.hpp"
-#include "../management/nfd-controller.hpp"
-#include "../management/nfd-control-response.hpp"
 
 #include <boost/asio/io_service.hpp>
 
