diff --git a/src/main.cpp b/src/main.cpp
index abe2b05..a2b9924 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2018,  The University of Memphis,
+/*
+ * Copyright (c) 2014-2019,  The University of Memphis,
  *                           Regents of the University of California,
  *                           Arizona Board of Regents.
  *
@@ -26,7 +26,7 @@
 #include <sstream>
 
 template<typename E>
-std::string
+static std::string
 getExtendedErrorMessage(const E& exception)
 {
   std::ostringstream errorMessage;
@@ -46,41 +46,55 @@
   return errorMessage.str();
 }
 
-int
-main(int32_t argc, char** argv)
+static void
+printUsage(std::ostream& os, const std::string& programName)
 {
-  using namespace nlsr;
+  os << "Usage: " << programName << " [OPTIONS...]\n"
+     << "\n"
+     << "Options:\n"
+     << "    -f <FILE>   Path to configuration file\n"
+     << "    -h          Display this help message\n"
+     << "    -V          Display version information\n"
+     << std::endl;
+}
 
+int
+main(int argc, char** argv)
+{
   std::string programName(argv[0]);
+  std::string configFileName("nlsr.conf");
 
-  std::string configFileName = "nlsr.conf";
-
-  int32_t opt;
-  while ((opt = getopt(argc, argv, "df:hV")) != -1) {
+  int opt;
+  while ((opt = getopt(argc, argv, "hf:V")) != -1) {
     switch (opt) {
-      case 'f':
-        configFileName = optarg;
-        break;
-      case 'V':
-        std::cout << NLSR_VERSION_BUILD_STRING << std::endl;
-        return EXIT_SUCCESS;
-        break;
-      case 'h':
-      default:
-        NlsrRunner::printUsage(programName);
-        return EXIT_FAILURE;
+    case 'h':
+      printUsage(std::cout, programName);
+      return 0;
+    case 'f':
+      configFileName = optarg;
+      break;
+    case 'V':
+      std::cout << NLSR_VERSION_BUILD_STRING << std::endl;
+      return 0;
+    default:
+      printUsage(std::cerr, programName);
+      return 2;
     }
   }
 
-  NlsrRunner runner(configFileName);
+  nlsr::NlsrRunner runner(configFileName);
 
   try {
     runner.run();
   }
+  catch (const nlsr::NlsrRunner::ConfFileError& e) {
+    std::cerr << e.what() << std::endl;
+    return 2;
+  }
   catch (const std::exception& e) {
-    std::cerr << getExtendedErrorMessage(e) << std::endl;
-    return EXIT_FAILURE;
+    std::cerr << "FATAL: " << getExtendedErrorMessage(e) << std::endl;
+    return 1;
   }
 
-  return EXIT_SUCCESS;
+  return 0;
 }
diff --git a/src/nlsr-runner.cpp b/src/nlsr-runner.cpp
index 7f27f45..57066e9 100644
--- a/src/nlsr-runner.cpp
+++ b/src/nlsr-runner.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2018,  The University of Memphis,
+/*
+ * Copyright (c) 2014-2019,  The University of Memphis,
  *                           Regents of the University of California,
  *                           Arizona Board of Regents.
  *
@@ -21,13 +21,10 @@
 
 #include "nlsr-runner.hpp"
 #include "conf-file-processor.hpp"
-#include "logger.hpp"
 
 namespace nlsr {
 
-INIT_LOGGER(NlsrRunner);
-
-NlsrRunner::NlsrRunner(std::string& configFileName)
+NlsrRunner::NlsrRunner(const std::string& configFileName)
   : m_scheduler(m_ioService)
   , m_face(m_ioService)
   , m_nlsr(m_ioService, m_scheduler, m_face, m_keyChain)
@@ -41,41 +38,26 @@
   ConfFileProcessor configProcessor(m_nlsr, m_nlsr.getConfFileName());
 
   if (!configProcessor.processConfFile()) {
-    BOOST_THROW_EXCEPTION(Error("Error in configuration file processing! Exiting from NLSR"));
+    BOOST_THROW_EXCEPTION(ConfFileError("Error in configuration file processing"));
   }
 
-  /** Because URI canonization needs to occur before initialization,
-      we have to pass initialize as the finally() in neighbor
-      canonization.
-  */
+  // Because URI canonization needs to occur before initialization,
+  // we have to pass initialize as the finally() in neighbor canonization.
   m_nlsr.canonizeNeighborUris(m_nlsr.getAdjacencyList().getAdjList().begin(),
                               [this] (std::list<Adjacent>::iterator iterator) {
-                                m_nlsr.canonizeContinuation(iterator, [this] {
-                                    m_nlsr.initialize();
-                                  });
+                                m_nlsr.canonizeContinuation(iterator, [this] { m_nlsr.initialize(); });
                               },
                               [this] {
                                 m_nlsr.initialize();
                               });
+
   try {
     m_nlsr.startEventLoop();
   }
-  catch (const std::exception& e) {
-    NLSR_LOG_FATAL("ERROR: " << e.what());
-    std::cerr << "ERROR: " << e.what() << std::endl;
-
+  catch (...) {
     m_nlsr.getFib().clean();
+    throw;
   }
 }
 
-void
-NlsrRunner::printUsage(const std::string& programName)
-{
-  std::cout << "Usage: " << programName << " [OPTIONS...]" << std::endl;
-  std::cout << "   NDN routing...." << std::endl;
-  std::cout << "       -f <FILE>   Specify configuration file name" << std::endl;
-  std::cout << "       -V          Display version information" << std::endl;
-  std::cout << "       -h          Display this help message" << std::endl;
-}
-
 } // namespace nlsr
diff --git a/src/nlsr-runner.hpp b/src/nlsr-runner.hpp
index 76d0456..af32e1e 100644
--- a/src/nlsr-runner.hpp
+++ b/src/nlsr-runner.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2018,  The University of Memphis,
+/*
+ * Copyright (c) 2014-2019,  The University of Memphis,
  *                           Regents of the University of California,
  *                           Arizona Board of Regents.
  *
@@ -28,7 +28,7 @@
 #include <ndn-cxx/util/scheduler.hpp>
 
 // boost needs to be included after ndn-cxx, otherwise there will be conflict with _1, _2, ...
-#include <boost/asio.hpp>
+#include <boost/asio/io_service.hpp>
 
 namespace nlsr {
 
@@ -40,22 +40,17 @@
  * This class only exists to provide this functionality, and there is
  * no special reliance of NLSR on this class.
  */
-
 class NlsrRunner
 {
 public:
-  class Error : public std::runtime_error
+  class ConfFileError : public std::invalid_argument
   {
   public:
-    explicit
-    Error(const std::string& what)
-      : std::runtime_error(what)
-    {
-    }
+    using std::invalid_argument::invalid_argument;
   };
 
   explicit
-  NlsrRunner(std::string& configFileName);
+  NlsrRunner(const std::string& configFileName);
 
   /*! \brief Instantiate, configure, and start the NLSR process.
    *
@@ -64,17 +59,13 @@
    * relationship. If one wants to create multiple NLSR classes,
    * multiple NLSR runners need to be created, too.
    *
-   * \throws Error If the configuration file cannot be processed. NLSR
-   * is not started.
-   *
+   * \throws ConfFileError The configuration file cannot be processed.
+   *                       NLSR is not started.
    * \sa Nlsr::canonizeNeighborUris
    */
   void
   run();
 
-  static void
-  printUsage(const std::string& programName);
-
 private:
   boost::asio::io_service m_ioService;
   ndn::Scheduler m_scheduler;
