diff --git a/.clang-format b/.clang-format
index 5f0cb09..82c0e2c 100644
--- a/.clang-format
+++ b/.clang-format
@@ -79,6 +79,7 @@
 IndentWidth:     4
 IndentWrappedFunctionNames: true
 KeepEmptyLinesAtTheStartOfBlocks: false
+LambdaBodyIndentation: OuterScope
 MacroBlockBegin: ''
 MacroBlockEnd:   ''
 MaxEmptyLinesToKeep: 1
diff --git a/src/associations.cpp b/src/associations.cpp
index 346cebd..6042d4d 100644
--- a/src/associations.cpp
+++ b/src/associations.cpp
@@ -321,12 +321,11 @@
         // Already waiting on this path for another association,
         // so just add this endpoint and owner.
         auto& endpoints = p->second;
-        auto e =
-            std::find_if(endpoints.begin(), endpoints.end(),
-                         [&assoc, &owner](const auto& endpoint) {
-                             return (std::get<ownerPos>(endpoint) == owner) &&
-                                    (std::get<assocPos>(endpoint) == assoc);
-                         });
+        auto e = std::find_if(endpoints.begin(), endpoints.end(),
+                              [&assoc, &owner](const auto& endpoint) {
+            return (std::get<ownerPos>(endpoint) == owner) &&
+                   (std::get<assocPos>(endpoint) == assoc);
+        });
         if (e == endpoints.end())
         {
             endpoints.emplace_back(owner, std::move(assoc));
@@ -509,14 +508,14 @@
                     auto a = std::find_if(
                         assocs.begin(), assocs.end(),
                         [&endpointPath, &otherPath](const auto& ap) {
-                            const auto& endpoints = ap.second;
-                            auto endpoint = std::find(
-                                endpoints.begin(), endpoints.end(), otherPath);
-                            if (endpoint != endpoints.end())
-                            {
-                                return ap.first.starts_with(endpointPath + '/');
-                            }
-                            return false;
+                        const auto& endpoints = ap.second;
+                        auto endpoint = std::find(endpoints.begin(),
+                                                  endpoints.end(), otherPath);
+                        if (endpoint != endpoints.end())
+                        {
+                            return ap.first.starts_with(endpointPath + '/');
+                        }
+                        return false;
                         });
 
                     if (a != assocs.end())
diff --git a/src/handler.cpp b/src/handler.cpp
index a1efb84..a4401bf 100644
--- a/src/handler.cpp
+++ b/src/handler.cpp
@@ -19,9 +19,10 @@
     // If an entry for the object path already exists, just add the
     // service name and interfaces to that entry, otherwise create
     // a new entry.
-    auto entry = std::find_if(
-        objectMap.begin(), objectMap.end(),
-        [&objectPath](const auto& i) { return objectPath == i.first; });
+    auto entry = std::find_if(objectMap.begin(), objectMap.end(),
+                              [&objectPath](const auto& i) {
+        return objectPath == i.first;
+    });
 
     if (entry != objectMap.end())
     {
diff --git a/src/main.cpp b/src/main.cpp
index 568f460..242903b 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -34,13 +34,13 @@
     conn->async_method_call(
         [&, newObject](const boost::system::error_code ec,
                        const std::string& nameOwner) {
-            if (ec)
-            {
-                std::cerr << "Error getting owner of " << newObject << " : "
-                          << ec << "\n";
-                return;
-            }
-            owners[nameOwner] = newObject;
+        if (ec)
+        {
+            std::cerr << "Error getting owner of " << newObject << " : " << ec
+                      << "\n";
+            return;
+        }
+        owners[nameOwner] = newObject;
         },
         "org.freedesktop.DBus", "/", "org.freedesktop.DBus", "GetNameOwner",
         newObject);
@@ -142,21 +142,21 @@
          timeoutRetries](
             const boost::system::error_code ec,
             const std::variant<std::vector<Association>>& variantAssociations) {
-            if (ec)
+        if (ec)
+        {
+            if (ec.value() == boost::system::errc::timed_out &&
+                timeoutRetries < maxTimeoutRetries)
             {
-                if (ec.value() == boost::system::errc::timed_out &&
-                    timeoutRetries < maxTimeoutRetries)
-                {
-                    doAssociations(io, systemBus, interfaceMap, objectServer,
-                                   processName, path, timeoutRetries + 1);
-                    return;
-                }
-                std::cerr << "Error getting associations from " << path << "\n";
+                doAssociations(io, systemBus, interfaceMap, objectServer,
+                               processName, path, timeoutRetries + 1);
+                return;
             }
-            std::vector<Association> associations =
-                std::get<std::vector<Association>>(variantAssociations);
-            associationChanged(io, objectServer, associations, path,
-                               processName, interfaceMap, associationMaps);
+            std::cerr << "Error getting associations from " << path << "\n";
+        }
+        std::vector<Association> associations =
+            std::get<std::vector<Association>>(variantAssociations);
+        associationChanged(io, objectServer, associations, path, processName,
+                           interfaceMap, associationMaps);
         },
         processName, path, "org.freedesktop.DBus.Properties", "Get",
         assocDefsInterface, assocDefsProperty);
@@ -174,81 +174,80 @@
         [&io, &interfaceMap, &objectServer, transaction, path, systemBus,
          timeoutRetries](const boost::system::error_code ec,
                          const std::string& introspectXml) {
-            if (ec)
+        if (ec)
+        {
+            if (ec.value() == boost::system::errc::timed_out &&
+                timeoutRetries < maxTimeoutRetries)
             {
-                if (ec.value() == boost::system::errc::timed_out &&
-                    timeoutRetries < maxTimeoutRetries)
-                {
-                    doIntrospect(io, systemBus, transaction, interfaceMap,
-                                 objectServer, path, timeoutRetries + 1);
-                    return;
-                }
-                std::cerr << "Introspect call failed with error: " << ec << ", "
-                          << ec.message()
-                          << " on process: " << transaction->processName
-                          << " path: " << path << "\n";
+                doIntrospect(io, systemBus, transaction, interfaceMap,
+                             objectServer, path, timeoutRetries + 1);
                 return;
             }
+            std::cerr << "Introspect call failed with error: " << ec << ", "
+                      << ec.message()
+                      << " on process: " << transaction->processName
+                      << " path: " << path << "\n";
+            return;
+        }
 
-            tinyxml2::XMLDocument doc;
+        tinyxml2::XMLDocument doc;
 
-            tinyxml2::XMLError e = doc.Parse(introspectXml.c_str());
-            if (e != tinyxml2::XMLError::XML_SUCCESS)
+        tinyxml2::XMLError e = doc.Parse(introspectXml.c_str());
+        if (e != tinyxml2::XMLError::XML_SUCCESS)
+        {
+            std::cerr << "XML parsing failed\n";
+            return;
+        }
+
+        tinyxml2::XMLNode* pRoot = doc.FirstChildElement("node");
+        if (pRoot == nullptr)
+        {
+            std::cerr << "XML document did not contain any data\n";
+            return;
+        }
+        auto& thisPathMap = interfaceMap[path];
+        tinyxml2::XMLElement* pElement = pRoot->FirstChildElement("interface");
+        while (pElement != nullptr)
+        {
+            const char* ifaceName = pElement->Attribute("name");
+            if (ifaceName == nullptr)
             {
-                std::cerr << "XML parsing failed\n";
-                return;
+                continue;
             }
 
-            tinyxml2::XMLNode* pRoot = doc.FirstChildElement("node");
-            if (pRoot == nullptr)
+            thisPathMap[transaction->processName].emplace(ifaceName);
+
+            if (std::strcmp(ifaceName, assocDefsInterface) == 0)
             {
-                std::cerr << "XML document did not contain any data\n";
-                return;
+                doAssociations(io, systemBus, interfaceMap, objectServer,
+                               transaction->processName, path);
             }
-            auto& thisPathMap = interfaceMap[path];
-            tinyxml2::XMLElement* pElement =
-                pRoot->FirstChildElement("interface");
-            while (pElement != nullptr)
+
+            pElement = pElement->NextSiblingElement("interface");
+        }
+
+        // Check if this new path has a pending association that can
+        // now be completed.
+        checkIfPendingAssociation(io, path, interfaceMap,
+                                  transaction->assocMaps, objectServer);
+
+        pElement = pRoot->FirstChildElement("node");
+        while (pElement != nullptr)
+        {
+            const char* childPath = pElement->Attribute("name");
+            if (childPath != nullptr)
             {
-                const char* ifaceName = pElement->Attribute("name");
-                if (ifaceName == nullptr)
+                std::string parentPath(path);
+                if (parentPath == "/")
                 {
-                    continue;
+                    parentPath.clear();
                 }
 
-                thisPathMap[transaction->processName].emplace(ifaceName);
-
-                if (std::strcmp(ifaceName, assocDefsInterface) == 0)
-                {
-                    doAssociations(io, systemBus, interfaceMap, objectServer,
-                                   transaction->processName, path);
-                }
-
-                pElement = pElement->NextSiblingElement("interface");
+                doIntrospect(io, systemBus, transaction, interfaceMap,
+                             objectServer, parentPath + "/" + childPath);
             }
-
-            // Check if this new path has a pending association that can
-            // now be completed.
-            checkIfPendingAssociation(io, path, interfaceMap,
-                                      transaction->assocMaps, objectServer);
-
-            pElement = pRoot->FirstChildElement("node");
-            while (pElement != nullptr)
-            {
-                const char* childPath = pElement->Attribute("name");
-                if (childPath != nullptr)
-                {
-                    std::string parentPath(path);
-                    if (parentPath == "/")
-                    {
-                        parentPath.clear();
-                    }
-
-                    doIntrospect(io, systemBus, transaction, interfaceMap,
-                                 objectServer, parentPath + "/" + childPath);
-                }
-                pElement = pElement->NextSiblingElement("node");
-            }
+            pElement = pElement->NextSiblingElement("node");
+        }
         },
         transaction->processName, path, "org.freedesktop.DBus.Introspectable",
         "Introspect");
@@ -290,33 +289,33 @@
         [&io, &interfaceMap, &nameOwners, &objectServer, systemBus,
          &assocMaps](const boost::system::error_code ec,
                      std::vector<std::string> processNames) {
-            if (ec)
-            {
-                std::cerr << "Error getting names: " << ec << "\n";
-                std::exit(EXIT_FAILURE);
-                return;
-            }
-            // Try to make startup consistent
-            std::sort(processNames.begin(), processNames.end());
+        if (ec)
+        {
+            std::cerr << "Error getting names: " << ec << "\n";
+            std::exit(EXIT_FAILURE);
+            return;
+        }
+        // Try to make startup consistent
+        std::sort(processNames.begin(), processNames.end());
 #ifdef MAPPER_ENABLE_DEBUG
-            std::shared_ptr<std::chrono::time_point<std::chrono::steady_clock>>
-                globalStartTime = std::make_shared<
-                    std::chrono::time_point<std::chrono::steady_clock>>(
-                    std::chrono::steady_clock::now());
+        std::shared_ptr<std::chrono::time_point<std::chrono::steady_clock>>
+            globalStartTime = std::make_shared<
+                std::chrono::time_point<std::chrono::steady_clock>>(
+                std::chrono::steady_clock::now());
 #endif
-            for (const std::string& processName : processNames)
+        for (const std::string& processName : processNames)
+        {
+            if (needToIntrospect(processName))
             {
-                if (needToIntrospect(processName))
-                {
-                    startNewIntrospect(systemBus, io, interfaceMap, processName,
-                                       assocMaps,
+                startNewIntrospect(systemBus, io, interfaceMap, processName,
+                                   assocMaps,
 #ifdef MAPPER_ENABLE_DEBUG
-                                       globalStartTime,
+                                   globalStartTime,
 #endif
-                                       objectServer);
-                    updateOwners(systemBus, nameOwners, processName);
-                }
+                                   objectServer);
+                updateOwners(systemBus, nameOwners, processName);
             }
+        }
         },
         "org.freedesktop.DBus", "/org/freedesktop/DBus", "org.freedesktop.DBus",
         "ListNames");
@@ -362,12 +361,11 @@
         auto childPath = parent + '/';
 
         // Remove this parent if there isn't a remaining child on this owner
-        auto child = std::find_if(
-            interfaceMap.begin(), interfaceMap.end(),
-            [&owner, &childPath](const auto& entry) {
-                return entry.first.starts_with(childPath) &&
-                       (entry.second.find(owner) != entry.second.end());
-            });
+        auto child = std::find_if(interfaceMap.begin(), interfaceMap.end(),
+                                  [&owner, &childPath](const auto& entry) {
+            return entry.first.starts_with(childPath) &&
+                   (entry.second.find(owner) != entry.second.end());
+        });
 
         if (child == interfaceMap.end())
         {
@@ -593,7 +591,7 @@
         "GetSubTreePaths",
         [&interfaceMap](std::string& reqPath, int32_t depth,
                         std::vector<std::string>& interfaces) {
-            return getSubTreePaths(interfaceMap, reqPath, depth, interfaces);
+        return getSubTreePaths(interfaceMap, reqPath, depth, interfaces);
         });
 
     iface->register_method(
@@ -601,9 +599,9 @@
         [&interfaceMap](const sdbusplus::message::object_path& associationPath,
                         const sdbusplus::message::object_path& reqPath,
                         int32_t depth, std::vector<std::string>& interfaces) {
-            return getAssociatedSubTree(interfaceMap, associationMaps,
-                                        associationPath, reqPath, depth,
-                                        interfaces);
+        return getAssociatedSubTree(interfaceMap, associationMaps,
+                                    associationPath, reqPath, depth,
+                                    interfaces);
         });
 
     iface->register_method(
@@ -611,9 +609,9 @@
         [&interfaceMap](const sdbusplus::message::object_path& associationPath,
                         const sdbusplus::message::object_path& reqPath,
                         int32_t depth, std::vector<std::string>& interfaces) {
-            return getAssociatedSubTreePaths(interfaceMap, associationMaps,
-                                             associationPath, reqPath, depth,
-                                             interfaces);
+        return getAssociatedSubTreePaths(interfaceMap, associationMaps,
+                                         associationPath, reqPath, depth,
+                                         interfaces);
         });
 
     iface->initialize();
diff --git a/src/processing.cpp b/src/processing.cpp
index 4298541..9b6e636 100644
--- a/src/processing.cpp
+++ b/src/processing.cpp
@@ -34,8 +34,8 @@
 
     auto inSkipList = std::find_if(skipNamespaces.begin(), skipNamespaces.end(),
                                    [&processName](auto prefix) {
-                                       return processName.starts_with(prefix);
-                                   }) != skipNamespaces.end();
+        return processName.starts_with(prefix);
+                      }) != skipNamespaces.end();
     return !(inSkipList || processName.empty());
 }
 
diff --git a/src/test/associations.cpp b/src/test/associations.cpp
index 62aefab..fca0ee1 100644
--- a/src/test/associations.cpp
+++ b/src/test/associations.cpp
@@ -499,9 +499,10 @@
     ASSERT_EQ(associationData.size(), 2);
 
     {
-        auto ad = std::find_if(
-            associationData.begin(), associationData.end(),
-            [](const auto& ad) { return std::get<0>(ad) == "ownerA"; });
+        auto ad = std::find_if(associationData.begin(), associationData.end(),
+                               [](const auto& ad) {
+            return std::get<0>(ad) == "ownerA";
+        });
         ASSERT_NE(ad, associationData.end());
 
         auto& a = std::get<1>(*ad);
@@ -510,9 +511,10 @@
         ASSERT_EQ(std::get<2>(a), "pathA");
     }
     {
-        auto ad = std::find_if(
-            associationData.begin(), associationData.end(),
-            [](const auto& ad) { return std::get<0>(ad) == "ownerB"; });
+        auto ad = std::find_if(associationData.begin(), associationData.end(),
+                               [](const auto& ad) {
+            return std::get<0>(ad) == "ownerB";
+        });
         ASSERT_NE(ad, associationData.end());
 
         auto& a = std::get<1>(*ad);
diff --git a/src/test/handler.cpp b/src/test/handler.cpp
index b7dfbb3..aad6c8a 100644
--- a/src/test/handler.cpp
+++ b/src/test/handler.cpp
@@ -80,9 +80,10 @@
                                                        }));
     ASSERT_EQ(interfaceMaps.size(), 1);
 
-    auto entry = std::find_if(
-        interfaceMaps.begin(), interfaceMaps.end(),
-        [](const auto& i) { return "test_object_path" == i.first; });
+    auto entry = std::find_if(interfaceMaps.begin(), interfaceMaps.end(),
+                              [](const auto& i) {
+        return "test_object_path" == i.first;
+    });
     ASSERT_NE(entry, interfaceMap.end());
     for (const auto& [_, interfaces] : entry->second)
     {
@@ -97,9 +98,10 @@
     addObjectMapResult(interfaceMaps, "test_object_path",
                        std::pair<std::string, InterfaceNames>(
                            "test_object_connection_1", {"test_interface_2"}));
-    entry = std::find_if(
-        interfaceMaps.begin(), interfaceMaps.end(),
-        [](const auto& i) { return "test_object_path" == i.first; });
+    entry = std::find_if(interfaceMaps.begin(), interfaceMaps.end(),
+                         [](const auto& i) {
+        return "test_object_path" == i.first;
+    });
     ASSERT_NE(entry, interfaceMaps.end());
     for (const auto& [_, interfaces] : entry->second)
     {
@@ -246,8 +248,8 @@
 {
     std::string path = "/test/object_path_0";
     std::vector<std::string> interfaces = {"bad_interface"};
-    std::vector<std::string> subtreePath =
-        getSubTreePaths(interfaceMap, path, 0, interfaces);
+    std::vector<std::string> subtreePath = getSubTreePaths(interfaceMap, path,
+                                                           0, interfaces);
     ASSERT_TRUE(subtreePath.empty());
 
     path = "/invalid_path";
@@ -263,8 +265,8 @@
     std::vector<std::string> interfaces = {"test_interface_1",
                                            "test_interface_3"};
     // Root
-    std::vector<std::string> subtreePath =
-        getSubTreePaths(interfaceMap, "/", 0, interfaces);
+    std::vector<std::string> subtreePath = getSubTreePaths(interfaceMap, "/", 0,
+                                                           interfaces);
     ASSERT_THAT(subtreePath,
                 ElementsAre("/test/object_path_0/child",
                             "/test/object_path_0/child/grandchild/dog"));
@@ -405,9 +407,9 @@
     ASSERT_THAT(subtreePath, ElementsAre("/test/object_path_0/child"));
 
     // Path1
-    subtreePath =
-        getAssociatedSubTreePaths(interfaceMap, associationMap,
-                                  path1 / "descendent", path1, 0, interfaces);
+    subtreePath = getAssociatedSubTreePaths(interfaceMap, associationMap,
+                                            path1 / "descendent", path1, 0,
+                                            interfaces);
     ASSERT_THAT(subtreePath,
                 ElementsAre("/test/object_path_0/child/grandchild"));
 }
