diff --git a/src/management/nfd-controller.cpp b/src/management/nfd-controller.cpp
index 723c984..7a99693 100644
--- a/src/management/nfd-controller.cpp
+++ b/src/management/nfd-controller.cpp
@@ -25,7 +25,7 @@
                                const SuccessCallback& onSuccess,
                                const FailCallback&    onFail)
 {
-  fibAddNextHop(prefixToRegister, 0, 0, onSuccess, onFail);
+  fibAddNextHop(prefixToRegister, 0, 0, bind(onSuccess), onFail);
 }
 
 void
@@ -33,32 +33,32 @@
                                  const SuccessCallback& onSuccess,
                                  const FailCallback&    onFail)
 {
-  fibRemoveNextHop(prefixToDeRegister, 0, onSuccess, onFail);
+  fibRemoveNextHop(prefixToDeRegister, 0, bind(onSuccess), onFail);
 }
 
 void
 Controller::fibAddNextHop(const Name& prefix, uint64_t faceId, int cost,
-                          const SuccessCallback& onSuccess,
-                          const FailCallback&    onFail)
+                          const FibCommandSucceedCallback& onSuccess,
+                          const FailCallback& onFail)
 {
   startFibCommand("add-nexthop",
                   FibManagementOptions()
                     .setName(prefix)
                     .setFaceId(faceId)
                     .setCost(cost),
-                  bind(onSuccess), onFail);
+                  onSuccess, onFail);
 }
 
 void
 Controller::fibRemoveNextHop(const Name& prefix, uint64_t faceId,
-                             const SuccessCallback& onSuccess,
-                             const FailCallback&    onFail)
+                             const FibCommandSucceedCallback& onSuccess,
+                             const FailCallback& onFail)
 {
   startFibCommand("remove-nexthop",
                   FibManagementOptions()
                     .setName(prefix)
                     .setFaceId(faceId),
-                  bind(onSuccess), onFail);
+                  onSuccess, onFail);
 }
 
 void
@@ -86,6 +86,8 @@
                                       const FibCommandSucceedCallback& onSuccess,
                                       const FailCallback& onFail)
 {
+  /// \todo Add validation of incoming Data
+
   try
     {
       ControlResponse response(data.getContent().blockFromValue());
@@ -127,6 +129,8 @@
                                        const FaceCommandSucceedCallback& onSuccess,
                                        const FailCallback& onFail)
 {
+  /// \todo Add validation of incoming Data
+
   try
     {
       ControlResponse response(data.getContent().blockFromValue());
diff --git a/src/management/nfd-controller.hpp b/src/management/nfd-controller.hpp
index aa85656..a864db3 100644
--- a/src/management/nfd-controller.hpp
+++ b/src/management/nfd-controller.hpp
@@ -54,8 +54,8 @@
    */
   void
   fibAddNextHop(const Name& prefix, uint64_t faceId, int cost,
-                const SuccessCallback& onSuccess,
-                const FailCallback&    onFail);
+                const FibCommandSucceedCallback& onSuccess,
+                const FailCallback& onFail);
 
   /**
    * \brief Remove a nexthop from FIB entry
@@ -72,8 +72,8 @@
    */
   void
   fibRemoveNextHop(const Name& prefix, uint64_t faceId,
-                   const SuccessCallback& onSuccess,
-                   const FailCallback&    onFail);
+                   const FibCommandSucceedCallback& onSuccess,
+                   const FailCallback& onFail);
 
 protected:
   void
diff --git a/src/management/nrd-controller.cpp b/src/management/nrd-controller.cpp
index 2d5557f..1d0e7a1 100644
--- a/src/management/nrd-controller.cpp
+++ b/src/management/nrd-controller.cpp
@@ -19,7 +19,6 @@
 
 Controller::Controller(Face& face)
   : m_face(face)
-  , m_faceId(0)
 {
 }
 
@@ -33,8 +32,7 @@
                  .setName(prefixToRegister)
                  .setFaceId(0) // self-registration
                  .setCost(0),
-               bind(&Controller::recordSelfRegisteredFaceId, this, _1, onSuccess),
-               onFail);
+               bind(onSuccess), onFail);
 }
 
 void
@@ -42,21 +40,46 @@
                                  const SuccessCallback& onSuccess,
                                  const FailCallback&    onFail)
 {
-  if (m_faceId == 0)
-    {
-      if (static_cast<bool>(onFail))
-        onFail("Face ID is not set, should have been set after a successful prefix registration command");
-      return;
-    }
-
   startCommand("unregister",
                PrefixRegOptions()
                  .setName(prefixToRegister)
-                 .setFaceId(m_faceId),
+                 .setFaceId(0), // self-registration
                bind(onSuccess), onFail);
 }
 
 void
+Controller::registerPrefix(const PrefixRegOptions& options,
+                           const CommandSucceedCallback& onSuccess,
+                           const FailCallback& onFail)
+{
+  startCommand("register", options, onSuccess, onFail);
+}
+
+void
+Controller::unregisterPrefix(const PrefixRegOptions& options,
+                             const CommandSucceedCallback& onSuccess,
+                             const FailCallback& onFail)
+{
+  startCommand("unregister", options, onSuccess, onFail);
+}
+
+void
+Controller::advertisePrefix(const PrefixRegOptions& options,
+                            const CommandSucceedCallback& onSuccess,
+                            const FailCallback& onFail)
+{
+  startCommand("advertise", options, onSuccess, onFail);
+}
+
+void
+Controller::withdrawPrefix(const PrefixRegOptions& options,
+                            const CommandSucceedCallback& onSuccess,
+                            const FailCallback& onFail)
+{
+  startCommand("withdraw", options, onSuccess, onFail);
+}
+
+void
 Controller::startCommand(const std::string& command,
                          const PrefixRegOptions& options,
                          const CommandSucceedCallback& onSuccess,
@@ -68,7 +91,7 @@
     .append(options.wireEncode());
 
   Interest commandInterest(commandInterestName);
-  // m_keyChain.sign(commandInterest);
+  m_commandInterestGenerator.generate(commandInterest);
 
   m_face.expressInterest(commandInterest,
                          bind(&Controller::processCommandResponse, this, _2,
@@ -77,18 +100,12 @@
 }
 
 void
-Controller::recordSelfRegisteredFaceId(const PrefixRegOptions& entry,
-                                       const SuccessCallback& onSuccess)
-{
-  m_faceId = entry.getFaceId();
-  onSuccess();
-}
-
-void
 Controller::processCommandResponse(Data& data,
                                    const CommandSucceedCallback& onSuccess,
                                    const FailCallback& onFail)
 {
+  /// \todo Add validation of incoming Data
+
   try
     {
       nfd::ControlResponse response(data.getContent().blockFromValue());
diff --git a/src/management/nrd-controller.hpp b/src/management/nrd-controller.hpp
index c5bd7bf..6de9f5b 100644
--- a/src/management/nrd-controller.hpp
+++ b/src/management/nrd-controller.hpp
@@ -8,7 +8,7 @@
 #define NDN_MANAGEMENT_NFD_CONTROLLER_HPP
 
 #include "controller.hpp"
-#include "../security/key-chain.hpp"
+#include "../util/command-interest-generator.hpp"
 
 namespace ndn {
 namespace nrd {
@@ -35,6 +35,26 @@
                        const SuccessCallback& onSuccess,
                        const FailCallback&    onFail);
 
+  void
+  registerPrefix(const PrefixRegOptions& options,
+                 const CommandSucceedCallback& onSuccess,
+                 const FailCallback& onFail);
+
+  void
+  unregisterPrefix(const PrefixRegOptions& options,
+                 const CommandSucceedCallback& onSuccess,
+                 const FailCallback&    onFail);
+
+  void
+  advertisePrefix(const PrefixRegOptions& options,
+                  const CommandSucceedCallback& onSuccess,
+                  const FailCallback& onFail);
+
+  void
+  withdrawPrefix(const PrefixRegOptions& options,
+                 const CommandSucceedCallback& onSuccess,
+                 const FailCallback& onFail);
+
 protected:
   void
   startCommand(const std::string& command,
@@ -44,18 +64,13 @@
 
 private:
   void
-  recordSelfRegisteredFaceId(const PrefixRegOptions& entry,
-                             const SuccessCallback& onSuccess);
-
-  void
   processCommandResponse(Data& data,
                          const CommandSucceedCallback& onSuccess,
                          const FailCallback& onFail);
 
 protected:
   Face& m_face;
-  KeyChain m_keyChain;
-  uint64_t m_faceId; // internal face ID (needed for prefix de-registration)
+  CommandInterestGenerator m_commandInterestGenerator;
 };
 
 } // namespace nrd
diff --git a/src/management/nrd-prefix-reg-options.hpp b/src/management/nrd-prefix-reg-options.hpp
index 12136e8..412194b 100644
--- a/src/management/nrd-prefix-reg-options.hpp
+++ b/src/management/nrd-prefix-reg-options.hpp
@@ -44,21 +44,21 @@
   template<bool T>
   size_t
   wireEncode(EncodingImpl<T>& block) const;
-  
+
   const Block&
   wireEncode() const;
-  
-  void 
+
+  void
   wireDecode(const Block& wire);
-  
+
   ////////////////////////////////////////////////////////
-  
-  const Name& 
+
+  const Name&
   getName() const
   {
     return m_name;
   }
-  
+
   PrefixRegOptions&
   setName(const Name& name)
   {
@@ -68,7 +68,7 @@
   }
 
   //
-  
+
   uint64_t
   getFaceId() const
   {
@@ -84,8 +84,8 @@
   }
 
   //
-  
-  uint64_t 
+
+  uint64_t
   getFlags() const
   {
     return m_flags;
@@ -100,8 +100,8 @@
   }
 
   //
-  
-  uint64_t 
+
+  uint64_t
   getCost() const
   {
     return m_cost;
@@ -116,7 +116,7 @@
   }
 
   //
-  
+
   Milliseconds
   getExpirationPeriod() const
   {
@@ -132,24 +132,8 @@
   }
 
   //
-  
-  const Name& 
-  getStrategy() const
-  {
-    return m_strategy;
-  }
 
-  PrefixRegOptions&
-  setStrategy(const Name& strategy)
-  {
-    m_strategy = strategy;
-    m_wire.reset();
-    return *this;
-  }
-
-  //
-
-  const std::string& 
+  const std::string&
   getProtocol() const
   {
     return m_protocol;
@@ -162,16 +146,15 @@
     m_wire.reset();
     return *this;
   }
-  
+
 private:
   Name m_name;
   uint64_t m_faceId;
   uint64_t m_flags;
   uint64_t m_cost;
   Milliseconds m_expirationPeriod;
-  Name m_strategy;
   std::string m_protocol;
-  
+
   mutable Block m_wire;
 };
 
@@ -185,9 +168,8 @@
   //                        Name
   //                        FaceId?
   //                        Flags?
-  //                        Cost?    
+  //                        Cost?
   //                        ExpirationPeriod?
-  //                        StrategyName?
   //                        Protocol?
 
   // (reverse encoding)
@@ -201,12 +183,6 @@
                                          m_protocol.size());
     }
 
-  // StrategyName
-  if (!m_strategy.empty())
-    {
-      total_len += prependNestedBlock(block, tlv::nrd::StrategyName, m_strategy);
-    }
-
   // ExpirationPeriod
   if (m_expirationPeriod > 0)
     {
@@ -248,24 +224,23 @@
 
   EncodingEstimator estimator;
   size_t estimatedSize = wireEncode(estimator);
-  
+
   EncodingBuffer buffer(estimatedSize, 0);
   wireEncode(buffer);
 
   m_wire = buffer.block();
   return m_wire;
 }
-  
-inline void 
+
+inline void
 PrefixRegOptions::wireDecode(const Block& wire)
 {
   // PrefixRegOptions ::= PREFIX-REG-OPTIONS-TYPE TLV-LENGTH
   //                        Name
   //                        FaceId?
   //                        Flags?
-  //                        Cost?    
+  //                        Cost?
   //                        ExpirationPeriod?
-  //                        StrategyName?
   //                        Protocol?
 
   m_name.clear();
@@ -273,14 +248,13 @@
   m_flags = DEFAULT_FLAGS;
   m_cost = DEFAULT_COST;
   m_expirationPeriod = -1;
-  m_strategy.clear();
   m_protocol.clear();
 
   m_wire = wire;
 
   if (m_wire.type() != tlv::nrd::PrefixRegOptions)
     throw Error("Requested decoding of PrefixRegOptions, but Block is of different type");
-  
+
   m_wire.parse ();
 
   // Name
@@ -296,7 +270,7 @@
     {
       m_faceId = readNonNegativeInteger(*val);
     }
-  
+
   // Flags
   val = m_wire.find(tlv::nrd::Flags);
   if (val != m_wire.elements_end())
@@ -318,15 +292,6 @@
       m_expirationPeriod = readNonNegativeInteger(*val);
     }
 
-  // StrategyName
-  val = m_wire.find(tlv::nrd::StrategyName);
-  if (val != m_wire.elements_end())
-    {
-      val->parse();
-      if (!val->elements().empty())
-        m_strategy.wireDecode(*val->elements_begin());
-    }
-
   // Protocol
   val = m_wire.find(tlv::nrd::Protocol);
   if (val != m_wire.elements_end())
@@ -336,26 +301,32 @@
     }
 }
 
-// inline std::ostream&
-// operator << (std::ostream &os, const PrefixRegOptions &option)
-// {
-//   os << "ForwardingEntry(";
-  
-//   // Name
-//   os << "Prefix: " << option.getName() << ", ";
+inline std::ostream&
+operator << (std::ostream &os, const PrefixRegOptions &option)
+{
+  os << "PrefixRegOptions(";
 
-//   // FaceID
-//   os << "FaceID: " << option.getFaceId() << ", ";
+  // Name
+  os << "Prefix: " << option.getName() << ", ";
 
-//   // Cost
-//   os << "Cost: " << option.getCost() << ", ";
+  // FaceID
+  os << "FaceID: " << option.getFaceId() << ", ";
 
-//   // Strategy
-//   os << "Strategy: " << option.getStrategy() << ", ";
-  
-//   os << ")";
-//   return os;
-// }
+  // Flags
+  os << "Flags: " << option.getFlags() << ", ";
+
+  // Cost
+  os << "Cost: " << option.getCost() << ", ";
+
+  // ExpirationPeriod
+  os << "ExpirationPeriod: " << option.getExpirationPeriod() << ", ";
+
+  // Protocol
+  os << "Protocol: " << option.getProtocol();
+
+  os << ")";
+  return os;
+}
 
 } // namespace nrd
 } // namespace ndn
