diff --git a/src/util/detail/network-monitor-impl-osx.cpp b/src/util/detail/network-monitor-impl-osx.cpp
new file mode 100644
index 0000000..bfa3877
--- /dev/null
+++ b/src/util/detail/network-monitor-impl-osx.cpp
@@ -0,0 +1,125 @@
+/* -*- 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.
+ *
+ *
+ * Parts of this implementation is based on daemondo command of MacPorts
+ * (https://www.macports.org/):
+ *
+ *    Copyright (c) 2005-2007 James Berry <jberry@macports.org>
+ *   All rights reserved.
+ *
+ *   Redistribution and use in source and binary forms, with or without
+ *   modification, are permitted provided that the following conditions
+ *   are met:
+ *   1. Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ *   2. Redistributions in binary form must reproduce the above copyright
+ *      notice, this list of conditions and the following disclaimer in the
+ *      documentation and/or other materials provided with the distribution.
+ *   3. Neither the name of The MacPorts Project nor the names of its contributors
+ *      may be used to endorse or promote products derived from this software
+ *      without specific prior written permission.
+ *
+ *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ *   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ *   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ *   ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ *   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ *   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ *   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ *   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ *   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ *   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ *   POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "ndn-cxx-config.hpp"
+
+#ifdef NDN_CXX_HAVE_COREFOUNDATION_COREFOUNDATION_H
+
+#include "network-monitor-impl-osx.hpp"
+
+namespace ndn {
+namespace util {
+
+NetworkMonitor::Impl::Impl(NetworkMonitor& nm, boost::asio::io_service& io)
+  : m_nm(nm)
+  , m_scheduler(io)
+  , m_cfLoopEvent(m_scheduler)
+{
+  scheduleCfLoop();
+
+  // Potentially useful System Configuration regex patterns:
+  //
+  // State:/Network/Interface/.*/Link
+  // State:/Network/Interface/.*/IPv4
+  // State:/Network/Interface/.*/IPv6
+  //
+  // State:/Network/Global/DNS
+  // State:/Network/Global/IPv4
+  //
+  // Potentially useful notifications from Darwin Notify Center:
+  //
+  // com.apple.system.config.network_change
+  //
+  CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(),
+                                  static_cast<void*>(this),
+                                  &Impl::afterNotificationCenterEvent,
+                                  CFSTR("com.apple.system.config.network_change"),
+                                  nullptr, // object to observe
+                                  CFNotificationSuspensionBehaviorDeliverImmediately);
+}
+
+NetworkMonitor::Impl::~Impl()
+{
+  CFNotificationCenterRemoveEveryObserver(CFNotificationCenterGetDarwinNotifyCenter(),
+                                          static_cast<void*>(this));
+}
+
+void
+NetworkMonitor::Impl::afterNotificationCenterEvent(CFNotificationCenterRef center,
+                                                   void *observer,
+                                                   CFStringRef name,
+                                                   const void *object,
+                                                   CFDictionaryRef userInfo)
+{
+  static_cast<Impl*>(observer)->m_nm.onNetworkStateChanged();
+}
+
+void
+NetworkMonitor::Impl::scheduleCfLoop()
+{
+  // poll each second for new events
+  m_cfLoopEvent = m_scheduler.scheduleEvent(time::seconds(1), bind(&Impl::pollCfLoop, this));
+}
+
+void
+NetworkMonitor::Impl::pollCfLoop()
+{
+  // this should dispatch ready events and exit
+  CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, true);
+
+  scheduleCfLoop();
+}
+
+} // namespace util
+} // namespace ndn
+
+#endif // NDN_CXX_HAVE_COREFOUNDATION_COREFOUNDATION_H
diff --git a/src/util/detail/network-monitor-impl-osx.hpp b/src/util/detail/network-monitor-impl-osx.hpp
new file mode 100644
index 0000000..4015a78
--- /dev/null
+++ b/src/util/detail/network-monitor-impl-osx.hpp
@@ -0,0 +1,67 @@
+/* -*- 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_UTIL_NETWORK_MONITOR_IMPL_OSX_HPP
+#define NDN_UTIL_NETWORK_MONITOR_IMPL_OSX_HPP
+
+#include "../network-monitor.hpp"
+
+#include "../scheduler.hpp"
+#include "../scheduler-scoped-event-id.hpp"
+
+#include <CoreFoundation/CoreFoundation.h>
+#include <SystemConfiguration/SystemConfiguration.h>
+
+namespace ndn {
+namespace util {
+
+class NetworkMonitor::Impl
+{
+public:
+  Impl(NetworkMonitor& nm, boost::asio::io_service& io);
+
+  ~Impl();
+
+  static void
+  afterNotificationCenterEvent(CFNotificationCenterRef center,
+                               void *observer,
+                               CFStringRef name,
+                               const void *object,
+                               CFDictionaryRef userInfo);
+
+private:
+  void
+  scheduleCfLoop();
+
+  void
+  pollCfLoop();
+
+private:
+  NetworkMonitor& m_nm;
+
+  Scheduler m_scheduler;
+  scheduler::ScopedEventId m_cfLoopEvent;
+};
+
+} // namespace util
+} // namespace ndn
+
+#endif // NDN_UTIL_NETWORK_MONITOR_IMPL_OSX_HPP
diff --git a/src/util/detail/network-monitor-impl-rtnl.cpp b/src/util/detail/network-monitor-impl-rtnl.cpp
new file mode 100644
index 0000000..36c9190
--- /dev/null
+++ b/src/util/detail/network-monitor-impl-rtnl.cpp
@@ -0,0 +1,90 @@
+/* -*- 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.
+ */
+
+#include "ndn-cxx-config.hpp"
+
+#ifdef NDN_CXX_HAVE_RTNETLINK
+
+#include "network-monitor-impl-rtnl.hpp"
+
+#include <netinet/in.h>
+#include <linux/netlink.h>
+#include <linux/rtnetlink.h>
+#include <net/if.h>
+
+#include <cerrno>
+#include <cstring>
+
+namespace ndn {
+namespace util {
+
+NetworkMonitor::Impl::Impl(NetworkMonitor& nm, boost::asio::io_service& io)
+  : m_nm(nm)
+  , m_socket(io)
+{
+  int fd = ::socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
+  if (fd < 0)
+    BOOST_THROW_EXCEPTION(Error(std::string("Cannot create netlink socket (") +
+                                std::strerror(errno) + ")"));
+
+  sockaddr_nl addr{};
+  addr.nl_family = AF_NETLINK;
+  addr.nl_groups = RTMGRP_LINK |
+                   RTMGRP_IPV4_IFADDR | RTMGRP_IPV4_ROUTE |
+                   RTMGRP_IPV6_IFADDR | RTMGRP_IPV6_ROUTE;
+
+  if (::bind(fd, reinterpret_cast<sockaddr*>(&addr), sizeof(addr)) == -1) {
+    BOOST_THROW_EXCEPTION(Error(std::string("Cannot bind on netlink socket (") +
+                                std::strerror(errno) + ")"));
+  }
+
+  m_socket.assign(fd);
+
+  m_socket.async_read_some(boost::asio::buffer(m_buffer, NETLINK_BUFFER_SIZE),
+                           bind(&Impl::onReceiveRtNetlink, this, _1, _2));
+}
+
+void
+NetworkMonitor::Impl::onReceiveRtNetlink(const boost::system::error_code& error, size_t nBytesReceived)
+{
+  if (error) {
+    return;
+  }
+
+  const nlmsghdr* nlh = reinterpret_cast<const nlmsghdr*>(m_buffer);
+  while ((NLMSG_OK(nlh, nBytesReceived)) && (nlh->nlmsg_type != NLMSG_DONE)) {
+    if (nlh->nlmsg_type == RTM_NEWADDR || nlh->nlmsg_type == RTM_DELADDR ||
+        nlh->nlmsg_type == RTM_NEWLINK || nlh->nlmsg_type == RTM_DELLINK ||
+        nlh->nlmsg_type == RTM_NEWROUTE || nlh->nlmsg_type == RTM_DELROUTE) {
+      m_nm.onNetworkStateChanged();
+      break;
+    }
+    nlh = NLMSG_NEXT(nlh, nBytesReceived);
+  }
+
+  m_socket.async_read_some(boost::asio::buffer(m_buffer, NETLINK_BUFFER_SIZE),
+                           bind(&Impl::onReceiveRtNetlink, this, _1, _2));
+}
+
+} // namespace util
+} // namespace ndn
+
+#endif // NDN_CXX_HAVE_RTNETLINK
diff --git a/src/util/detail/network-monitor-impl-rtnl.hpp b/src/util/detail/network-monitor-impl-rtnl.hpp
new file mode 100644
index 0000000..141554d
--- /dev/null
+++ b/src/util/detail/network-monitor-impl-rtnl.hpp
@@ -0,0 +1,53 @@
+/* -*- 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_UTIL_NETWORK_MONITOR_IMPL_RTNL_HPP
+#define NDN_UTIL_NETWORK_MONITOR_IMPL_RTNL_HPP
+
+#include "../network-monitor.hpp"
+
+#include <boost/asio/posix/stream_descriptor.hpp>
+
+namespace ndn {
+namespace util {
+
+const size_t NETLINK_BUFFER_SIZE = 4096;
+
+class NetworkMonitor::Impl
+{
+public:
+  Impl(NetworkMonitor& nm, boost::asio::io_service& io);
+
+private:
+  void
+  onReceiveRtNetlink(const boost::system::error_code& error, size_t nBytesReceived);
+
+private:
+  NetworkMonitor& m_nm;
+
+  uint8_t m_buffer[NETLINK_BUFFER_SIZE];
+  boost::asio::posix::stream_descriptor m_socket;
+};
+
+} // namespace util
+} // namespace ndn
+
+#endif // NDN_UTIL_NETWORK_MONITOR_IMPL_RTNL_HPP
diff --git a/src/util/network-monitor.cpp b/src/util/network-monitor.cpp
index 8f7b1f9..a12e373 100644
--- a/src/util/network-monitor.cpp
+++ b/src/util/network-monitor.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).
  *
@@ -17,238 +17,44 @@
  * <http://www.gnu.org/licenses/>.
  *
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
- *
- *
- * Parts of this implementation is based on daemondo command of MacPorts
- * (https://www.macports.org/):
- *
- *    Copyright (c) 2005-2007 James Berry <jberry@macports.org>
- *   All rights reserved.
- *
- *   Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions
- *   are met:
- *   1. Redistributions of source code must retain the above copyright
- *      notice, this list of conditions and the following disclaimer.
- *   2. Redistributions in binary form must reproduce the above copyright
- *      notice, this list of conditions and the following disclaimer in the
- *      documentation and/or other materials provided with the distribution.
- *   3. Neither the name of The MacPorts Project nor the names of its contributors
- *      may be used to endorse or promote products derived from this software
- *      without specific prior written permission.
- *
- *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- *   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- *   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- *   ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- *   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- *   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- *   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- *   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- *   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- *   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- *   POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include "network-monitor.hpp"
+
 #include "ndn-cxx-config.hpp"
 
-#include "network-monitor.hpp"
-#include "scheduler.hpp"
-#include "scheduler-scoped-event-id.hpp"
-
 #if defined(NDN_CXX_HAVE_COREFOUNDATION_COREFOUNDATION_H)
-
-#include <CoreFoundation/CoreFoundation.h>
-#include <SystemConfiguration/SystemConfiguration.h>
-
-namespace ndn {
-namespace util {
-
-class NetworkMonitor::Impl
-{
-public:
-  Impl(boost::asio::io_service& io)
-    : scheduler(io)
-    , cfLoopEvent(scheduler)
-  {
-  }
-
-  void
-  scheduleCfLoop()
-  {
-    // poll each second for new events
-    cfLoopEvent = scheduler.scheduleEvent(time::seconds(1), bind(&Impl::pollCfLoop, this));
-  }
-
-  static void
-  afterNotificationCenterEvent(CFNotificationCenterRef center, void *observer, CFStringRef name,
-                               const void *object, CFDictionaryRef userInfo)
-  {
-    static_cast<NetworkMonitor*>(observer)->onNetworkStateChanged();
-  }
-
-private:
-
-  void
-  pollCfLoop()
-  {
-    // this should dispatch ready events and exit
-    CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, true);
-    scheduleCfLoop();
-  }
-
-private:
-  Scheduler scheduler;
-  scheduler::ScopedEventId cfLoopEvent;
-};
-
-NetworkMonitor::NetworkMonitor(boost::asio::io_service& io)
-  : m_impl(new Impl(io))
-{
-  m_impl->scheduleCfLoop();
-
-  // Potentially useful System Configuration regex patterns:
-  //
-  // State:/Network/Interface/.*/Link
-  // State:/Network/Interface/.*/IPv4
-  // State:/Network/Interface/.*/IPv6
-  //
-  // State:/Network/Global/DNS
-  // State:/Network/Global/IPv4
-  //
-  // Potentially useful notifications from Darwin Notify Center:
-  //
-  // com.apple.system.config.network_change
-
-  // network change observations
-  CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(),
-                                  static_cast<void*>(this),
-                                  &NetworkMonitor::Impl::afterNotificationCenterEvent,
-                                  CFSTR("com.apple.system.config.network_change"),
-                                  nullptr, // object to observe
-                                  CFNotificationSuspensionBehaviorDeliverImmediately);
-}
-
-NetworkMonitor::~NetworkMonitor()
-{
-  CFNotificationCenterRemoveEveryObserver(CFNotificationCenterGetDarwinNotifyCenter(),
-                                          static_cast<void*>(this));
-}
-
-} // namespace util
-} // namespace ndn
-
-// done with defined(NDN_CXX_HAVE_COREFOUNDATION_COREFOUNDATION_H)
+#include "detail/network-monitor-impl-osx.hpp"
 #elif defined(NDN_CXX_HAVE_RTNETLINK)
-
-#include <boost/asio.hpp>
-
-#include <netinet/in.h>
-#include <linux/netlink.h>
-#include <linux/rtnetlink.h>
-#include <net/if.h>
-
-#include <cerrno>
-#include <cstring>
+#include "detail/network-monitor-impl-rtnl.hpp"
+#else
 
 namespace ndn {
 namespace util {
 
-const size_t NETLINK_BUFFER_SIZE = 4096;
-
 class NetworkMonitor::Impl
 {
 public:
   Impl(NetworkMonitor& nm, boost::asio::io_service& io)
-    : m_nm(nm)
-    , m_socket(io)
   {
-    int fd = ::socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
-    if (fd < 0)
-      BOOST_THROW_EXCEPTION(Error(std::string("Cannot create netlink socket (") +
-                                  std::strerror(errno) + ")"));
-
-    sockaddr_nl addr{};
-    addr.nl_family = AF_NETLINK;
-    addr.nl_groups = RTMGRP_LINK |
-      RTMGRP_IPV4_IFADDR | RTMGRP_IPV4_ROUTE |
-      RTMGRP_IPV6_IFADDR | RTMGRP_IPV6_ROUTE;
-
-    if (::bind(fd, reinterpret_cast<sockaddr*>(&addr), sizeof(addr)) == -1) {
-      BOOST_THROW_EXCEPTION(Error(std::string("Cannot bind on netlink socket (") +
-                                  std::strerror(errno) + ")"));
-    }
-
-    m_socket.assign(fd);
-
-    m_socket.async_read_some(boost::asio::buffer(m_buffer, NETLINK_BUFFER_SIZE),
-                             bind(&Impl::onReceiveRtNetlink, this, _1, _2));
+    BOOST_THROW_EXCEPTION(Error("Network monitoring is not supported on this platform"));
   }
-
-private:
-  void
-  onReceiveRtNetlink(const boost::system::error_code& error, size_t nBytesReceived)
-  {
-    if (error) {
-      return;
-    }
-
-    const nlmsghdr* nlh = reinterpret_cast<const nlmsghdr*>(m_buffer);
-    while ((NLMSG_OK(nlh, nBytesReceived)) && (nlh->nlmsg_type != NLMSG_DONE)) {
-      if (nlh->nlmsg_type == RTM_NEWADDR || nlh->nlmsg_type == RTM_DELADDR ||
-          nlh->nlmsg_type == RTM_NEWLINK || nlh->nlmsg_type == RTM_DELLINK ||
-          nlh->nlmsg_type == RTM_NEWROUTE || nlh->nlmsg_type == RTM_DELROUTE) {
-        m_nm.onNetworkStateChanged();
-        break;
-      }
-      nlh = NLMSG_NEXT(nlh, nBytesReceived);
-    }
-
-    m_socket.async_read_some(boost::asio::buffer(m_buffer, NETLINK_BUFFER_SIZE),
-                             bind(&Impl::onReceiveRtNetlink, this, _1, _2));
-  }
-
-private:
-  NetworkMonitor& m_nm;
-  uint8_t m_buffer[NETLINK_BUFFER_SIZE];
-
-  boost::asio::posix::stream_descriptor m_socket;
 };
 
+} // namespace util
+} // namespace ndn
 
+#endif
+
+namespace ndn {
+namespace util {
 
 NetworkMonitor::NetworkMonitor(boost::asio::io_service& io)
   : m_impl(new Impl(*this, io))
 {
 }
 
-NetworkMonitor::~NetworkMonitor()
-{
-}
+NetworkMonitor::~NetworkMonitor() = default;
 
 } // namespace util
 } // namespace ndn
-
-// done with defined(NDN_CXX_HAVE_RTNETLINK)
-#else // do not support network monitoring operations
-
-namespace ndn {
-namespace util {
-
-class NetworkMonitor::Impl
-{
-};
-
-NetworkMonitor::NetworkMonitor(boost::asio::io_service&)
-{
-  BOOST_THROW_EXCEPTION(Error("Network monitoring is not supported on this platform"));
-}
-
-NetworkMonitor::~NetworkMonitor()
-{
-}
-
-} // namespace util
-} // namespace ndn
-
-#endif // do not support network monitoring operations
diff --git a/wscript b/wscript
index ab8b921..faf7be6 100644
--- a/wscript
+++ b/wscript
@@ -65,10 +65,9 @@
     if not conf.options.enable_shared and not conf.options.enable_static:
         conf.fatal("Either static library or shared library must be enabled")
 
-    conf.load(['compiler_cxx', 'gnu_dirs', 'c_osx',
-               'default-compiler-flags', 'osx-security', 'pch',
-               'boost', 'cryptopp', 'sqlite3',
-               'doxygen', 'sphinx_build', 'type_traits', 'compiler-features'])
+    conf.load(['compiler_cxx', 'gnu_dirs', 'c_osx', 'default-compiler-flags',
+               'osx-security', 'pch', 'boost', 'cryptopp', 'sqlite3',
+               'type_traits', 'compiler-features', 'doxygen', 'sphinx_build'])
 
     conf.env['WITH_TESTS'] = conf.options.with_tests
     conf.env['WITH_TOOLS'] = conf.options.with_tools
@@ -155,7 +154,8 @@
         target="ndn-cxx",
         name="ndn-cxx",
         source=bld.path.ant_glob('src/**/*.cpp',
-                                 excl=['src/**/*-osx.cpp', 'src/**/*-sqlite3.cpp']),
+                                 excl=['src/security/**/*-osx.cpp',
+                                       'src/**/*-sqlite3.cpp']),
         headers='src/common-pch.hpp',
         use='version BOOST CRYPTOPP SQLITE3 RT PTHREAD',
         includes=". src",
@@ -164,7 +164,7 @@
         )
 
     if bld.env['HAVE_OSX_SECURITY']:
-        libndn_cxx['source'] += bld.path.ant_glob('src/**/*-osx.cpp')
+        libndn_cxx['source'] += bld.path.ant_glob('src/security/**/*-osx.cpp')
         libndn_cxx['mac_app'] = True
         libndn_cxx['use'] += " OSX_COREFOUNDATION OSX_SECURITY"
 
@@ -233,10 +233,12 @@
     if bld.env['WITH_EXAMPLES']:
         bld.recurse("examples")
 
-    headers = bld.path.ant_glob(['src/**/*.hpp'],
-                                 excl=['src/**/*-osx.hpp', 'src/detail/**/*'])
+    headers = bld.path.ant_glob('src/**/*.hpp',
+                                excl=['src/security/**/*-osx.hpp',
+                                      'src/detail/**/*',
+                                      'src/util/detail/**/*'])
     if bld.env['HAVE_OSX_SECURITY']:
-        headers += bld.path.ant_glob('src/**/*-osx.hpp')
+        headers += bld.path.ant_glob('src/security/**/*-osx.hpp')
 
     bld.install_files("%s/ndn-cxx" % bld.env['INCLUDEDIR'], headers,
                       relative_trick=True, cwd=bld.path.find_node('src'))
