diff --git a/tests/daemon/face/ethernet.cpp b/tests/daemon/face/ethernet.cpp
index b5c0cc4..2f872f1 100644
--- a/tests/daemon/face/ethernet.cpp
+++ b/tests/daemon/face/ethernet.cpp
@@ -37,7 +37,7 @@
 {
   EthernetFactory factory;
 
-  std::list<shared_ptr<const Channel> > channels = factory.getChannels();
+  auto channels = factory.getChannels();
   BOOST_CHECK_EQUAL(channels.empty(), true);
 }
 
@@ -48,27 +48,22 @@
   {
     EthernetFactory factory;
 
-    std::list< shared_ptr<NetworkInterfaceInfo> > ifs = listNetworkInterfaces();
-    for (std::list< shared_ptr<NetworkInterfaceInfo> >::const_iterator i = ifs.begin();
-         i != ifs.end();
-         ++i)
-      {
-        if (!(*i)->isLoopback() && (*i)->isUp())
-          {
-            try {
-              factory.createMulticastFace(*i, ethernet::getBroadcastAddress());
-            }
-            catch (Face::Error&) {
-              continue;
-            }
+    for (const auto& netif : listNetworkInterfaces()) {
+      if (!netif.isLoopback() && netif.isUp()) {
+        try {
+          factory.createMulticastFace(netif, ethernet::getBroadcastAddress());
+        }
+        catch (Face::Error&) {
+          continue;
+        }
 
-            m_interfaces.push_back(*i);
-          }
+        m_interfaces.push_back(netif);
       }
+    }
   }
 
 protected:
-  std::list< shared_ptr<NetworkInterfaceInfo> > m_interfaces;
+  std::vector<NetworkInterfaceInfo> m_interfaces;
 };
 
 
@@ -88,17 +83,15 @@
                                                                   ethernet::getBroadcastAddress());
   BOOST_CHECK_EQUAL(face1, face1bis);
 
-  if (m_interfaces.size() > 1)
-    {
-      shared_ptr<EthernetFace> face2 = factory.createMulticastFace(m_interfaces.back(),
-                                                                   ethernet::getBroadcastAddress());
-      BOOST_CHECK_NE(face1, face2);
-    }
-  else
-    {
-      BOOST_WARN_MESSAGE(false, "Cannot test second EthernetFace creation, "
-                         "only one interface available");
-    }
+  if (m_interfaces.size() > 1) {
+    shared_ptr<EthernetFace> face2 = factory.createMulticastFace(m_interfaces.back(),
+                                                                 ethernet::getBroadcastAddress());
+    BOOST_CHECK_NE(face1, face2);
+  }
+  else {
+    BOOST_WARN_MESSAGE(false, "Cannot test second EthernetFace creation, "
+                       "only one interface available");
+  }
 
   shared_ptr<EthernetFace> face3 = factory.createMulticastFace(m_interfaces.front(),
                                      ethernet::getDefaultMulticastAddress());
@@ -117,15 +110,14 @@
 
   shared_ptr<EthernetFace> face = factory.createMulticastFace(m_interfaces.front(),
                                     ethernet::getDefaultMulticastAddress());
-
   BOOST_REQUIRE(static_cast<bool>(face));
 
   BOOST_CHECK(!face->isOnDemand());
   BOOST_CHECK_EQUAL(face->isLocal(), false);
   BOOST_CHECK_EQUAL(face->getRemoteUri().toString(),
-                    "ether://[" + ethernet::getDefaultMulticastAddress().toString()+"]");
+                    "ether://[" + ethernet::getDefaultMulticastAddress().toString() + "]");
   BOOST_CHECK_EQUAL(face->getLocalUri().toString(),
-                    "dev://" + m_interfaces.front()->name);
+                    "dev://" + m_interfaces.front().name);
 
   shared_ptr<Interest> interest1 = makeInterest("ndn:/TpnzGvW9R");
   shared_ptr<Data>     data1     = makeData("ndn:/KfczhUqVix");
diff --git a/tests/daemon/face/tcp.cpp b/tests/daemon/face/tcp.cpp
index a391edc..99c2d5b 100644
--- a/tests/daemon/face/tcp.cpp
+++ b/tests/daemon/face/tcp.cpp
@@ -60,22 +60,16 @@
   TcpFactory factory;
   BOOST_REQUIRE_EQUAL(factory.getChannels().empty(), true);
 
-  std::vector<shared_ptr<const Channel> > expectedChannels;
+  std::vector<shared_ptr<const Channel>> expectedChannels;
   expectedChannels.push_back(factory.createChannel("127.0.0.1", "20070"));
   expectedChannels.push_back(factory.createChannel("127.0.0.1", "20071"));
   expectedChannels.push_back(factory.createChannel("::1", "20071"));
 
-  std::list<shared_ptr<const Channel> > channels = factory.getChannels();
-  for (std::list<shared_ptr<const Channel> >::const_iterator i = channels.begin();
-       i != channels.end(); ++i)
-    {
-      std::vector<shared_ptr<const Channel> >::iterator pos =
-        std::find(expectedChannels.begin(), expectedChannels.end(), *i);
-
-      BOOST_REQUIRE(pos != expectedChannels.end());
-      expectedChannels.erase(pos);
-    }
-
+  for (const auto& ch : factory.getChannels()) {
+    auto pos = std::find(expectedChannels.begin(), expectedChannels.end(), ch);
+    BOOST_REQUIRE(pos != expectedChannels.end());
+    expectedChannels.erase(pos);
+  }
   BOOST_CHECK_EQUAL(expectedChannels.size(), 0);
 }
 
@@ -115,7 +109,6 @@
   factory.createFace(FaceUri("tcp4://127.0.0.1/path"),
                      bind(&FaceCreateFixture::ignore, this),
                      bind(&FaceCreateFixture::checkError, this, _1, "Invalid URI"));
-
 }
 
 class EndToEndFixture : protected BaseFixture
@@ -254,7 +247,7 @@
   std::vector<Interest> face2_receivedInterests;
   std::vector<Data> face2_receivedDatas;
 
-  std::list< shared_ptr<Face> > faces;
+  std::list<shared_ptr<Face>> faces;
 };
 
 BOOST_FIXTURE_TEST_CASE(EndToEnd4, EndToEndFixture)
@@ -493,8 +486,6 @@
 }
 
 
-
-
 class SimpleEndToEndFixture : protected BaseFixture
 {
 public:
@@ -580,23 +571,17 @@
 {
   // tests with non-local Face
   std::string someIpv4Address;
-  std::list< shared_ptr<NetworkInterfaceInfo> > ifs = listNetworkInterfaces();
-  for (std::list< shared_ptr<NetworkInterfaceInfo> >::const_iterator i = ifs.begin();
-       i != ifs.end();
-       ++i)
-    {
-      if (!(*i)->isLoopback() && (*i)->isUp() && !(*i)->ipv4Addresses.empty())
-        {
-          someIpv4Address = (*i)->ipv4Addresses[0].to_string();
-          break;
-        }
+  for (const auto& netif : listNetworkInterfaces()) {
+    if (!netif.isLoopback() && netif.isUp() && !netif.ipv4Addresses.empty()) {
+      someIpv4Address = netif.ipv4Addresses[0].to_string();
+      break;
     }
-  if (someIpv4Address.empty())
-    {
-      BOOST_TEST_MESSAGE("Test with non-local Face cannot be run "
-                         "(no non-local interface with IPv4 address available)");
-      return;
-    }
+  }
+  if (someIpv4Address.empty()) {
+    BOOST_TEST_MESSAGE("Test with non-local Face cannot be run "
+                       "(no non-local interface with IPv4 address available)");
+    return;
+  }
 
   TcpFactory factory;
 
@@ -605,7 +590,6 @@
                   bind(&SimpleEndToEndFixture::onConnectFailed, this, _1));
   BOOST_REQUIRE_EQUAL(channel->isListening(), true);
 
-
   DummyStreamSender<boost::asio::ip::tcp, Dataset> sender;
   sender.start(Resolver<boost::asio::ip::tcp>::syncResolve(someIpv4Address, "20070"));
 
