diff --git a/daemon/face/protocol-factory.hpp b/daemon/face/protocol-factory.hpp
index f3d7807..a3cb625 100644
--- a/daemon/face/protocol-factory.hpp
+++ b/daemon/face/protocol-factory.hpp
@@ -62,7 +62,7 @@
   using CtorParams = ProtocolFactoryCtorParams;
 
   /** \brief Register a protocol factory type
-   *  \tparam S subclass of ProtocolFactory
+   *  \tparam PF subclass of ProtocolFactory
    *  \param id factory identifier
    */
   template<typename PF>
@@ -71,16 +71,16 @@
   {
     Registry& registry = getRegistry();
     BOOST_ASSERT(registry.count(id) == 0);
-    registry[id] = &make_unique<PF, const CtorParams&>;
+    registry[id] = [] (const CtorParams& p) { return make_unique<PF>(p); };
   }
 
   /** \brief Create a protocol factory instance
-   *  \retval nullptr if factory with \p id is not registered
+   *  \retval nullptr if a factory with the given \p id is not registered
    */
   static unique_ptr<ProtocolFactory>
   create(const std::string& id, const CtorParams& params);
 
-  /** \brief Get registered protocol factory ids
+  /** \brief Get all registered protocol factory ids
    */
   static std::set<std::string>
   listRegistered();
@@ -91,44 +91,40 @@
   class Error : public std::runtime_error
   {
   public:
-    explicit
-    Error(const std::string& what)
-      : std::runtime_error(what)
-    {
-    }
+    using std::runtime_error::runtime_error;
   };
 
+  explicit
+  ProtocolFactory(const CtorParams& params);
+
   virtual
-  ~ProtocolFactory() = default;
+  ~ProtocolFactory() = 0;
 
 #ifdef DOXYGEN
-  /** \brief Get id for this ProtocolFactory
+  /** \brief Get id for this protocol factory
    *
    *  face_system.factory-id config section is processed by the protocol factory.
    */
   static const std::string&
-  getId();
+  getId() noexcept;
 #endif
 
-  /** \brief Process face_system subsection that corresponds to this ProtocolFactory type
-   *  \param configSection the configuration section or boost::null to indicate it is omitted
-   *  \param context provides access to data structures and contextual information
-   *  \throw ConfigFile::Error invalid configuration
-   *
-   *  This function updates \p providedSchemes
-   */
-  virtual void
-  processConfig(OptionalConfigSection configSection,
-                FaceSystem::ConfigContext& context) = 0;
-
-  /** \brief Get FaceUri schemes accepted by this ProtocolFactory
+  /** \brief Get FaceUri schemes accepted by this protocol factory
    */
   const std::set<std::string>&
-  getProvidedSchemes()
+  getProvidedSchemes() const
   {
     return providedSchemes;
   }
 
+  /** \brief Process face_system subsection that corresponds to this protocol factory id
+   *  \param configSection the configuration section or boost::none to indicate it is omitted
+   *  \param context provides access to data structures and contextual information
+   *  \throw ConfigFile::Error invalid configuration
+   */
+  void
+  processConfig(OptionalConfigSection configSection, FaceSystem::ConfigContext& context);
+
   /** \brief Encapsulates a face creation request and all its parameters
    *
    *  Parameters are passed as a struct rather than individually, so that a future change in the list
@@ -141,20 +137,16 @@
     FaceParams params;
   };
 
-  /** \brief Try to create a unicast face using the supplied parameters
-   *
-   * \param req request object containing the face creation parameters
-   * \param onCreated callback if face creation succeeds or face already exists; the settings
-   *                  of an existing face are not updated if they differ from the request
-   * \param onFailure callback if face creation fails
+  /** \brief Create a unicast face
+   *  \param req request object containing the face creation parameters
+   *  \param onCreated callback if face creation succeeds or face already exists; the settings
+   *                   of an existing face are not updated if they differ from the request
+   *  \param onFailure callback if face creation fails
    */
-  virtual void
+  void
   createFace(const CreateFaceRequest& req,
              const FaceCreatedCallback& onCreated,
-             const FaceCreationFailedCallback& onFailure) = 0;
-
-  virtual std::vector<shared_ptr<const Channel>>
-  getChannels() const = 0;
+             const FaceCreationFailedCallback& onFailure);
 
   /** \brief Create a netdev-bound face
    *  \param remote remote FaceUri, must be canonical
@@ -168,10 +160,12 @@
   createNetdevBoundFace(const FaceUri& remote,
                         const shared_ptr<const ndn::net::NetworkInterface>& netdev);
 
-protected:
-  explicit
-  ProtocolFactory(const CtorParams& params);
+  /** \brief Get list of open channels (listening + non-listening)
+   */
+  std::vector<shared_ptr<const Channel>>
+  getChannels() const;
 
+protected:
   template<typename ChannelMap>
   static std::vector<shared_ptr<const Channel>>
   getChannelsFromMap(const ChannelMap& channelMap)
@@ -182,10 +176,34 @@
   }
 
 private:
+  /** \brief Process face_system subsection that corresponds to this protocol factory id
+   *  \sa processConfig
+   *
+   *  A subclass should override this method if it supports configuration options in the config
+   *  file, and do all the required processing here. The subclass should throw ConfigFile::Error
+   *  if it encounters unrecognized options or invalid values. It should also update
+   *  \p providedSchemes as needed.
+   *
+   *  The base class implementation does nothing.
+   */
+  virtual void
+  doProcessConfig(OptionalConfigSection configSection, FaceSystem::ConfigContext& context);
+
+  /** \brief Create a unicast face
+   *  \sa createFace
+   *
+   *  The base class implementation always invokes the failure callback with error code 406,
+   *  indicating unicast face creation is not supported.
+   */
+  virtual void
+  doCreateFace(const CreateFaceRequest& req,
+               const FaceCreatedCallback& onCreated,
+               const FaceCreationFailedCallback& onFailure);
+
   /** \brief Create a netdev-bound face
    *  \sa createNetdevBoundFace
    *
-   *  The base class implementation always throws Error indicating netdev-bound faces are not
+   *  The base class implementation always throws Error, indicating netdev-bound faces are not
    *  supported.
    *
    *  A subclass that offers netdev-bound faces should override this method, and also expose
@@ -201,6 +219,14 @@
   doCreateNetdevBoundFace(const FaceUri& remote,
                           const shared_ptr<const ndn::net::NetworkInterface>& netif);
 
+  /** \brief Get list of open channels (listening + non-listening)
+   *  \sa getChannels
+   *
+   *  The base class implementation returns an empty list.
+   */
+  virtual std::vector<shared_ptr<const Channel>>
+  doGetChannels() const;
+
 private: // registry
   using CreateFunc = std::function<unique_ptr<ProtocolFactory>(const CtorParams&)>;
   using Registry = std::map<std::string, CreateFunc>; // indexed by factory id
@@ -209,7 +235,7 @@
   getRegistry();
 
 protected:
-  std::set<std::string> providedSchemes; ///< FaceUri schemes provided by this ProtocolFactory
+  std::set<std::string> providedSchemes; ///< FaceUri schemes provided by this protocol factory
   FaceCreatedCallback addFace; ///< callback when a new face is created
 
   /** \brief NetworkMonitor for listing available network interfaces and monitoring their changes
@@ -223,9 +249,9 @@
 } // namespace face
 } // namespace nfd
 
-/** \brief registers a protocol factory
+/** \brief Registers a protocol factory
  *
- *  This macro should appear once in .cpp of each protocol factory.
+ *  This macro should appear once in the .cpp file of each protocol factory.
  */
 #define NFD_REGISTER_PROTOCOL_FACTORY(PF)                      \
 static class NfdAuto ## PF ## ProtocolFactoryRegistrationClass \
