diff --git a/daemon/face/ethernet-face.cpp b/daemon/face/ethernet-face.cpp
index 2fc24ab..ea9e522 100644
--- a/daemon/face/ethernet-face.cpp
+++ b/daemon/face/ethernet-face.cpp
@@ -49,12 +49,12 @@
 NFD_LOG_INIT("EthernetFace");
 
 EthernetFace::EthernetFace(const shared_ptr<boost::asio::posix::stream_descriptor>& socket,
-                           const shared_ptr<NetworkInterfaceInfo>& interface,
+                           const NetworkInterfaceInfo& interface,
                            const ethernet::Address& address)
-  : Face(FaceUri(address), FaceUri::fromDev(interface->name))
+  : Face(FaceUri(address), FaceUri::fromDev(interface.name))
   , m_socket(socket)
-  , m_interfaceName(interface->name)
-  , m_srcAddress(interface->etherAddress)
+  , m_interfaceName(interface.name)
+  , m_srcAddress(interface.etherAddress)
   , m_destAddress(address)
 {
   NFD_LOG_INFO("Creating ethernet face on " << m_interfaceName << ": "
diff --git a/daemon/face/ethernet-face.hpp b/daemon/face/ethernet-face.hpp
index 8f44eab..4383246 100644
--- a/daemon/face/ethernet-face.hpp
+++ b/daemon/face/ethernet-face.hpp
@@ -56,7 +56,7 @@
   };
 
   EthernetFace(const shared_ptr<boost::asio::posix::stream_descriptor>& socket,
-               const shared_ptr<NetworkInterfaceInfo>& interface,
+               const NetworkInterfaceInfo& interface,
                const ethernet::Address& address);
 
   virtual
diff --git a/daemon/face/ethernet-factory.cpp b/daemon/face/ethernet-factory.cpp
index b96a0b4..314614e 100644
--- a/daemon/face/ethernet-factory.cpp
+++ b/daemon/face/ethernet-factory.cpp
@@ -35,14 +35,13 @@
 NFD_LOG_INIT("EthernetFactory");
 
 shared_ptr<EthernetFace>
-EthernetFactory::createMulticastFace(const shared_ptr<NetworkInterfaceInfo> &interface,
+EthernetFactory::createMulticastFace(const NetworkInterfaceInfo& interface,
                                      const ethernet::Address &address)
 {
   if (!address.isMulticast())
     throw Error(address.toString() + " is not a multicast address");
 
-  const std::string& name = interface->name;
-  shared_ptr<EthernetFace> face = findMulticastFace(name, address);
+  shared_ptr<EthernetFace> face = findMulticastFace(interface.name, address);
   if (face)
     return face;
 
@@ -51,8 +50,8 @@
 
   face = make_shared<EthernetFace>(socket, interface, address);
   face->onFail += bind(&EthernetFactory::afterFaceFailed,
-                       this, name, address);
-  m_multicastFaces[std::make_pair(name, address)] = face;
+                       this, interface.name, address);
+  m_multicastFaces[std::make_pair(interface.name, address)] = face;
 
   return face;
 }
diff --git a/daemon/face/ethernet-factory.hpp b/daemon/face/ethernet-factory.hpp
index f7f6588..b7d5ec0 100644
--- a/daemon/face/ethernet-factory.hpp
+++ b/daemon/face/ethernet-factory.hpp
@@ -72,7 +72,7 @@
    * \throws EthernetFactory::Error or EthernetFace::Error
    */
   shared_ptr<EthernetFace>
-  createMulticastFace(const shared_ptr<NetworkInterfaceInfo>& interface,
+  createMulticastFace(const NetworkInterfaceInfo& interface,
                       const ethernet::Address& address);
 
   /**
diff --git a/daemon/face/tcp-factory.cpp b/daemon/face/tcp-factory.cpp
index 792068b..bdc8c24 100644
--- a/daemon/face/tcp-factory.cpp
+++ b/daemon/face/tcp-factory.cpp
@@ -35,7 +35,6 @@
 TcpFactory::TcpFactory(const std::string& defaultPort/* = "6363"*/)
   : m_defaultPort(defaultPort)
 {
-
 }
 
 void
@@ -68,22 +67,11 @@
 {
   using namespace boost::asio::ip;
 
-  const std::list<shared_ptr<NetworkInterfaceInfo> > nicList(listNetworkInterfaces());
-
-  for (std::list<shared_ptr<NetworkInterfaceInfo> >::const_iterator i = nicList.begin();
-       i != nicList.end();
-       ++i)
-    {
-      const shared_ptr<NetworkInterfaceInfo>& nic = *i;
-      const std::vector<address_v4>& ipv4Addresses = nic->ipv4Addresses;
-
-      for (std::vector<address_v4>::const_iterator j = ipv4Addresses.begin();
-           j != ipv4Addresses.end();
-           ++j)
-        {
-          prohibitEndpoint(tcp::Endpoint(*j, port));
-        }
+  for (const NetworkInterfaceInfo& nic : listNetworkInterfaces()) {
+    for (const address_v4& addr : nic.ipv4Addresses) {
+      prohibitEndpoint(tcp::Endpoint(addr, port));
     }
+  }
 }
 
 void
@@ -91,29 +79,18 @@
 {
   using namespace boost::asio::ip;
 
-  const std::list<shared_ptr<NetworkInterfaceInfo> > nicList(listNetworkInterfaces());
-
-  for (std::list<shared_ptr<NetworkInterfaceInfo> >::const_iterator i = nicList.begin();
-       i != nicList.end();
-       ++i)
-    {
-      const shared_ptr<NetworkInterfaceInfo>& nic = *i;
-      const std::vector<address_v6>& ipv6Addresses = nic->ipv6Addresses;
-
-      for (std::vector<address_v6>::const_iterator j = ipv6Addresses.begin();
-           j != ipv6Addresses.end();
-           ++j)
-        {
-          prohibitEndpoint(tcp::Endpoint(*j, port));
-        }
+  for (const NetworkInterfaceInfo& nic : listNetworkInterfaces()) {
+    for (const address_v6& addr : nic.ipv6Addresses) {
+      prohibitEndpoint(tcp::Endpoint(addr, port));
     }
+  }
 }
 
 shared_ptr<TcpChannel>
 TcpFactory::createChannel(const tcp::Endpoint& endpoint)
 {
   shared_ptr<TcpChannel> channel = findChannel(endpoint);
-  if(static_cast<bool>(channel))
+  if (static_cast<bool>(channel))
     return channel;
 
   channel = make_shared<TcpChannel>(endpoint);
diff --git a/daemon/face/udp-factory.cpp b/daemon/face/udp-factory.cpp
index d6954af..dcb819d 100644
--- a/daemon/face/udp-factory.cpp
+++ b/daemon/face/udp-factory.cpp
@@ -43,8 +43,6 @@
 {
 }
 
-
-
 void
 UdpFactory::prohibitEndpoint(const udp::Endpoint& endpoint)
 {
@@ -77,29 +75,18 @@
 
   static const address_v4 INVALID_BROADCAST(address_v4::from_string("0.0.0.0"));
 
-  const std::list<shared_ptr<NetworkInterfaceInfo> > nicList(listNetworkInterfaces());
-
-  for (std::list<shared_ptr<NetworkInterfaceInfo> >::const_iterator i = nicList.begin();
-       i != nicList.end();
-       ++i)
-    {
-      const shared_ptr<NetworkInterfaceInfo>& nic = *i;
-      const std::vector<address_v4>& ipv4Addresses = nic->ipv4Addresses;
-
-      for (std::vector<address_v4>::const_iterator j = ipv4Addresses.begin();
-           j != ipv4Addresses.end();
-           ++j)
-        {
-          prohibitEndpoint(udp::Endpoint(*j, port));
-        }
-
-      if (nic->isBroadcastCapable() && nic->broadcastAddress != INVALID_BROADCAST)
-        {
-          NFD_LOG_TRACE("prohibiting broadcast address: " << nic->broadcastAddress.to_string());
-          prohibitEndpoint(udp::Endpoint(nic->broadcastAddress, port));
-        }
+  for (const NetworkInterfaceInfo& nic : listNetworkInterfaces()) {
+    for (const address_v4& addr : nic.ipv4Addresses) {
+      prohibitEndpoint(udp::Endpoint(addr, port));
     }
 
+    if (nic.isBroadcastCapable() && nic.broadcastAddress != INVALID_BROADCAST)
+    {
+      NFD_LOG_TRACE("prohibiting broadcast address: " << nic.broadcastAddress.to_string());
+      prohibitEndpoint(udp::Endpoint(nic.broadcastAddress, port));
+    }
+  }
+
   prohibitEndpoint(udp::Endpoint(address::from_string("255.255.255.255"), port));
 }
 
@@ -108,35 +95,23 @@
 {
   using namespace boost::asio::ip;
 
-  const std::list<shared_ptr<NetworkInterfaceInfo> > nicList(listNetworkInterfaces());
-
-  for (std::list<shared_ptr<NetworkInterfaceInfo> >::const_iterator i = nicList.begin();
-       i != nicList.end();
-       ++i)
-    {
-      const shared_ptr<NetworkInterfaceInfo>& nic = *i;
-      const std::vector<address_v6>& ipv6Addresses = nic->ipv6Addresses;
-
-      for (std::vector<address_v6>::const_iterator j = ipv6Addresses.begin();
-           j != ipv6Addresses.end();
-           ++j)
-        {
-          prohibitEndpoint(udp::Endpoint(*j, port));
-        }
+  for (const NetworkInterfaceInfo& nic : listNetworkInterfaces()) {
+    for (const address_v6& addr : nic.ipv6Addresses) {
+      prohibitEndpoint(udp::Endpoint(addr, port));
     }
+  }
 }
 
 shared_ptr<UdpChannel>
 UdpFactory::createChannel(const udp::Endpoint& endpoint,
                           const time::seconds& timeout)
 {
-  NFD_LOG_DEBUG("Creating unicast " << endpoint);
+  NFD_LOG_DEBUG("Creating unicast channel " << endpoint);
 
   shared_ptr<UdpChannel> channel = findChannel(endpoint);
   if (static_cast<bool>(channel))
     return channel;
 
-
   //checking if the endpoint is already in use for multicast face
   shared_ptr<MulticastUdpFace> multicast = findMulticastFace(endpoint);
   if (static_cast<bool>(multicast))
@@ -161,8 +136,7 @@
                           const std::string& localPort,
                           const time::seconds& timeout)
 {
-  return createChannel(UdpResolver::syncResolve(localHost, localPort),
-                       timeout);
+  return createChannel(UdpResolver::syncResolve(localHost, localPort), timeout);
 }
 
 shared_ptr<MulticastUdpFace>
