diff --git a/src/management/nfd-controller.cpp b/src/management/nfd-controller.cpp
index 735c927..723c984 100644
--- a/src/management/nfd-controller.cpp
+++ b/src/management/nfd-controller.cpp
@@ -17,7 +17,6 @@
 
 Controller::Controller(Face& face)
   : m_face(face)
-  , m_faceId(0)
 {
 }
 
@@ -26,49 +25,39 @@
                                const SuccessCallback& onSuccess,
                                const FailCallback&    onFail)
 {
-  // two stage process:
-  // 1. insert FIB entry
-  // 2. add-nexthop <self> to the FIB entry
-
-  // Step 1.
-  startFibCommand("insert",
-                  FibManagementOptions()
-                    .setName(prefixToRegister),
-                  bind(&Controller::selfRegisterPrefixAddNextop, this, _1, onSuccess, onFail),
-                  onFail);
+  fibAddNextHop(prefixToRegister, 0, 0, onSuccess, onFail);
 }
 
 void
-Controller::selfRegisterPrefixAddNextop(const FibManagementOptions& entry,
-                                        const SuccessCallback& onSuccess,
-                                        const FailCallback&    onFail)
-{
-  // Step 2.
-  startFibCommand("add-nexthop",
-                  FibManagementOptions(entry) // prefixToRegister should be inside the entry
-                    .setFaceId(0) // self-registration
-                    .setCost(0),
-                  bind(&Controller::recordSelfRegisteredFaceId, this, _1, onSuccess),
-                  onFail);
-}
-
-
-void
-Controller::selfDeregisterPrefix(const Name& prefixToRegister,
+Controller::selfDeregisterPrefix(const Name& prefixToDeRegister,
                                  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;
-    }
+  fibRemoveNextHop(prefixToDeRegister, 0, onSuccess, onFail);
+}
 
+void
+Controller::fibAddNextHop(const Name& prefix, uint64_t faceId, int cost,
+                          const SuccessCallback& onSuccess,
+                          const FailCallback&    onFail)
+{
+  startFibCommand("add-nexthop",
+                  FibManagementOptions()
+                    .setName(prefix)
+                    .setFaceId(faceId)
+                    .setCost(cost),
+                  bind(onSuccess), onFail);
+}
+
+void
+Controller::fibRemoveNextHop(const Name& prefix, uint64_t faceId,
+                             const SuccessCallback& onSuccess,
+                             const FailCallback&    onFail)
+{
   startFibCommand("remove-nexthop",
                   FibManagementOptions()
-                    .setName(prefixToRegister)
-                    .setFaceId(m_faceId),
+                    .setName(prefix)
+                    .setFaceId(faceId),
                   bind(onSuccess), onFail);
 }
 
@@ -84,7 +73,7 @@
     .append(options.wireEncode());
 
   Interest fibCommandInterest(fibCommandInterestName);
-  // m_keyChain.sign(fibCommandInterest);
+  m_commandInterestGenerator.generate(fibCommandInterest);
 
   m_face.expressInterest(fibCommandInterest,
                          bind(&Controller::processFibCommandResponse, this, _2,
@@ -93,14 +82,6 @@
 }
 
 void
-Controller::recordSelfRegisteredFaceId(const FibManagementOptions& entry,
-                                       const SuccessCallback& onSuccess)
-{
-  m_faceId = entry.getFaceId();
-  onSuccess();
-}
-
-void
 Controller::processFibCommandResponse(Data& data,
                                       const FibCommandSucceedCallback& onSuccess,
                                       const FailCallback& onFail)
@@ -133,7 +114,7 @@
     .append(options.wireEncode());
 
   Interest faceCommandInterest(faceCommandInterestName);
-  // m_keyChain.sign(fibCommandInterest);
+  m_commandInterestGenerator.generate(faceCommandInterest);
 
   m_face.expressInterest(faceCommandInterest,
                          bind(&Controller::processFaceCommandResponse, this, _2,
@@ -161,5 +142,6 @@
         return onFail(e.what());
     }
 }
+
 } // namespace nfd
 } // namespace ndn
diff --git a/src/management/nfd-controller.hpp b/src/management/nfd-controller.hpp
index 968f232..aa85656 100644
--- a/src/management/nfd-controller.hpp
+++ b/src/management/nfd-controller.hpp
@@ -8,7 +8,7 @@
 #define NDN_MANAGEMENT_NFD_CONTROL_HPP
 
 #include "controller.hpp"
-#include "../security/key-chain.hpp"
+#include "../util/command-interest-generator.hpp"
 
 namespace ndn {
 
@@ -34,10 +34,47 @@
                      const FailCallback&    onFail);
 
   virtual void
-  selfDeregisterPrefix(const Name& prefixToRegister,
+  selfDeregisterPrefix(const Name& prefixToDeRegister,
                        const SuccessCallback& onSuccess,
                        const FailCallback&    onFail);
 
+  /**
+   * \brief Adds a nexthop to an existing or new FIB entry
+   *
+   * If FIB entry for the specified prefix does not exist, it will be automatically created.
+   *
+   * \param prefix    Prefix of the FIB entry
+   * \param faceId    ID of the face which should be added as a next hop for prefix FIB entry.
+   *                  If a nexthop of same FaceId exists on the FIB entry, its cost is updated.
+   *                  If FaceId is set to zero, it is implied as the face of the entity sending
+   *                  this command.
+   * \param cost      Cost that should be associated with the next hop
+   * \param onSuccess Callback that will be called when operation succeeds
+   * \param onFail    Callback that will be called when operation fails
+   */
+  void
+  fibAddNextHop(const Name& prefix, uint64_t faceId, int cost,
+                const SuccessCallback& onSuccess,
+                const FailCallback&    onFail);
+
+  /**
+   * \brief Remove a nexthop from FIB entry
+   *
+   * If after removal of the nexthop FIB entry has zero next hops, this FIB entry will
+   * be automatically deleted.
+   *
+   * \param prefix    Prefix of the FIB entry
+   * \param faceId    ID of the face which should be removed FIB entry.
+   *                  If FaceId is set to zero, it is implied as the face of the entity sending
+   *                  this command.
+   * \param onSuccess Callback that will be called when operation succeeds
+   * \param onFail    Callback that will be called when operation fails
+   */
+  void
+  fibRemoveNextHop(const Name& prefix, uint64_t faceId,
+                   const SuccessCallback& onSuccess,
+                   const FailCallback&    onFail);
+
 protected:
   void
   startFibCommand(const std::string& command,
@@ -53,15 +90,6 @@
 
 private:
   void
-  selfRegisterPrefixAddNextop(const FibManagementOptions& entry,
-                              const SuccessCallback& onSuccess,
-                              const FailCallback&    onFail);
-
-  void
-  recordSelfRegisteredFaceId(const FibManagementOptions& entry,
-                             const SuccessCallback& onSuccess);
-
-  void
   processFibCommandResponse(Data& data,
                             const FibCommandSucceedCallback& onSuccess,
                             const FailCallback& onFail);
@@ -73,8 +101,7 @@
 
 protected:
   Face& m_face;
-  KeyChain m_keyChain;
-  uint64_t m_faceId; // internal face ID (needed for prefix de-registration)
+  CommandInterestGenerator m_commandInterestGenerator;
 };
 
 } // namespace nfd
