diff --git a/.clang-format b/.clang-format
index d43e884..28e3328 100644
--- a/.clang-format
+++ b/.clang-format
@@ -87,7 +87,7 @@
 IndentWrappedFunctionNames: true
 InsertNewlineAtEOF: true
 KeepEmptyLinesAtTheStartOfBlocks: false
-LambdaBodyIndentation: OuterScope
+LambdaBodyIndentation: Signature
 LineEnding: LF
 MacroBlockBegin: ''
 MacroBlockEnd:   ''
@@ -98,13 +98,14 @@
 ObjCSpaceBeforeProtocolList: true
 PackConstructorInitializers: BinPack
 PenaltyBreakAssignment: 25
-PenaltyBreakBeforeFirstCallParameter: 19
+PenaltyBreakBeforeFirstCallParameter: 50
 PenaltyBreakComment: 300
 PenaltyBreakFirstLessLess: 120
 PenaltyBreakString: 1000
+PenaltyBreakTemplateDeclaration: 10
 PenaltyExcessCharacter: 1000000
 PenaltyReturnTypeOnItsOwnLine: 60
-PenaltyIndentedWhitespace: 0
+PenaltyIndentedWhitespace: 1
 PointerAlignment: Left
 QualifierAlignment: Left
 ReferenceAlignment: Left
diff --git a/fail-monitor/monitor.cpp b/fail-monitor/monitor.cpp
index 2c3b31d..2c4beb7 100644
--- a/fail-monitor/monitor.cpp
+++ b/fail-monitor/monitor.cpp
@@ -93,8 +93,8 @@
 void Monitor::runTargetAction()
 {
     // Start or stop the target unit
-    const auto* methodCall = (action == Action::start) ? startMethod
-                                                       : stopMethod;
+    const auto* methodCall =
+        (action == Action::start) ? startMethod : stopMethod;
 
     log<level::INFO>("The source unit is in failed state, "
                      "running target action",
diff --git a/fail-monitor/monitor.hpp b/fail-monitor/monitor.hpp
index 9c98fdf..65bb810 100644
--- a/fail-monitor/monitor.hpp
+++ b/fail-monitor/monitor.hpp
@@ -49,8 +49,8 @@
      */
     Monitor(const std::string& sourceUnit, const std::string& targetUnit,
             Action action) :
-        bus(sdbusplus::bus::new_default()),
-        source(sourceUnit), target(targetUnit), action(action)
+        bus(sdbusplus::bus::new_default()), source(sourceUnit),
+        target(targetUnit), action(action)
     {}
 
     /**
diff --git a/src/associations.cpp b/src/associations.cpp
index 927eec1..1899826 100644
--- a/src/associations.cpp
+++ b/src/associations.cpp
@@ -39,10 +39,9 @@
     }
 }
 
-void scheduleUpdateEndpointsOnDbus(boost::asio::io_context& io,
-                                   sdbusplus::asio::object_server& objectServer,
-                                   const std::string& assocPath,
-                                   AssociationMaps& assocMaps)
+void scheduleUpdateEndpointsOnDbus(
+    boost::asio::io_context& io, sdbusplus::asio::object_server& objectServer,
+    const std::string& assocPath, AssociationMaps& assocMaps)
 {
     static std::set<std::string> delayedUpdatePaths;
 
@@ -192,8 +191,8 @@
             for (const auto& originalEndpoint : originalEndpoints)
             {
                 if (std::find(newEndpoints->second.begin(),
-                              newEndpoints->second.end(),
-                              originalEndpoint) == newEndpoints->second.end())
+                              newEndpoints->second.end(), originalEndpoint) ==
+                    newEndpoints->second.end())
                 {
                     toRemove.emplace(originalEndpoint);
                 }
@@ -227,12 +226,11 @@
     scheduleUpdateEndpointsOnDbus(io, objectServer, assocPath, assocMaps);
 }
 
-void associationChanged(boost::asio::io_context& io,
-                        sdbusplus::asio::object_server& objectServer,
-                        const std::vector<Association>& associations,
-                        const std::string& path, const std::string& owner,
-                        const InterfaceMapType& interfaceMap,
-                        AssociationMaps& assocMaps)
+void associationChanged(
+    boost::asio::io_context& io, sdbusplus::asio::object_server& objectServer,
+    const std::vector<Association>& associations, const std::string& path,
+    const std::string& owner, const InterfaceMapType& interfaceMap,
+    AssociationMaps& assocMaps)
 {
     AssociationPaths objects;
 
@@ -301,11 +299,10 @@
     }
 }
 
-void addPendingAssociation(const std::string& objectPath,
-                           const std::string& type,
-                           const std::string& endpointPath,
-                           const std::string& endpointType,
-                           const std::string& owner, AssociationMaps& assocMaps)
+void addPendingAssociation(
+    const std::string& objectPath, const std::string& type,
+    const std::string& endpointPath, const std::string& endpointType,
+    const std::string& owner, AssociationMaps& assocMaps)
 {
     Association assoc{type, endpointType, endpointPath};
 
@@ -321,11 +318,12 @@
         // 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));
@@ -362,12 +360,11 @@
     }
 }
 
-void addSingleAssociation(boost::asio::io_context& io,
-                          sdbusplus::asio::object_server& server,
-                          const std::string& assocPath,
-                          const std::string& endpoint, const std::string& owner,
-                          const std::string& ownerPath,
-                          AssociationMaps& assocMaps)
+void addSingleAssociation(
+    boost::asio::io_context& io, sdbusplus::asio::object_server& server,
+    const std::string& assocPath, const std::string& endpoint,
+    const std::string& owner, const std::string& ownerPath,
+    AssociationMaps& assocMaps)
 {
     boost::container::flat_set<std::string> endpoints{endpoint};
 
@@ -406,11 +403,10 @@
     }
 }
 
-void checkIfPendingAssociation(boost::asio::io_context& io,
-                               const std::string& objectPath,
-                               const InterfaceMapType& interfaceMap,
-                               AssociationMaps& assocMaps,
-                               sdbusplus::asio::object_server& server)
+void checkIfPendingAssociation(
+    boost::asio::io_context& io, const std::string& objectPath,
+    const InterfaceMapType& interfaceMap, AssociationMaps& assocMaps,
+    sdbusplus::asio::object_server& server)
 {
     auto pending = assocMaps.pending.find(objectPath);
     if (pending == assocMaps.pending.end())
@@ -508,15 +504,15 @@
                     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())
                     {
@@ -545,11 +541,10 @@
  * @param[in,out] assocMaps - the association maps
  * @param[in,out] server    - sdbus system object
  */
-void removeAssociationIfacesEntry(boost::asio::io_context& io,
-                                  const std::string& assocPath,
-                                  const std::string& endpointPath,
-                                  AssociationMaps& assocMaps,
-                                  sdbusplus::asio::object_server& server)
+void removeAssociationIfacesEntry(
+    boost::asio::io_context& io, const std::string& assocPath,
+    const std::string& endpointPath, AssociationMaps& assocMaps,
+    sdbusplus::asio::object_server& server)
 {
     auto assoc = assocMaps.ifaces.find(assocPath);
     if (assoc != assocMaps.ifaces.end())
@@ -576,10 +571,9 @@
  * @param[in] owner         - the owner of the association
  * @param[in,out] assocMaps - the association maps
  */
-void removeAssociationOwnersEntry(const std::string& assocPath,
-                                  const std::string& endpointPath,
-                                  const std::string& owner,
-                                  AssociationMaps& assocMaps)
+void removeAssociationOwnersEntry(
+    const std::string& assocPath, const std::string& endpointPath,
+    const std::string& owner, AssociationMaps& assocMaps)
 {
     auto sources = assocMaps.owners.begin();
     while (sources != assocMaps.owners.end())
@@ -617,10 +611,9 @@
     }
 }
 
-void moveAssociationToPending(boost::asio::io_context& io,
-                              const std::string& endpointPath,
-                              AssociationMaps& assocMaps,
-                              sdbusplus::asio::object_server& server)
+void moveAssociationToPending(
+    boost::asio::io_context& io, const std::string& endpointPath,
+    AssociationMaps& assocMaps, sdbusplus::asio::object_server& server)
 {
     FindAssocResults associationData;
 
diff --git a/src/associations.hpp b/src/associations.hpp
index 1d7b778..1ea5c2d 100644
--- a/src/associations.hpp
+++ b/src/associations.hpp
@@ -87,12 +87,11 @@
  *
  * @return Void, objectServer and assocMaps updated if needed
  */
-void associationChanged(boost::asio::io_context& io,
-                        sdbusplus::asio::object_server& objectServer,
-                        const std::vector<Association>& associations,
-                        const std::string& path, const std::string& owner,
-                        const InterfaceMapType& interfaceMap,
-                        AssociationMaps& assocMaps);
+void associationChanged(
+    boost::asio::io_context& io, sdbusplus::asio::object_server& objectServer,
+    const std::vector<Association>& associations, const std::string& path,
+    const std::string& owner, const InterfaceMapType& interfaceMap,
+    AssociationMaps& assocMaps);
 
 /** @brief Add a pending associations entry
  *
@@ -114,12 +113,10 @@
  * @param[in] owner         - The service name that owns the association.
  * @param[in,out] assocMaps - The association maps
  */
-void addPendingAssociation(const std::string& objectPath,
-                           const std::string& type,
-                           const std::string& endpointPath,
-                           const std::string& endpointType,
-                           const std::string& owner,
-                           AssociationMaps& assocMaps);
+void addPendingAssociation(
+    const std::string& objectPath, const std::string& type,
+    const std::string& endpointPath, const std::string& endpointType,
+    const std::string& owner, AssociationMaps& assocMaps);
 
 /** @brief Removes an endpoint from the pending associations map
  *
@@ -141,12 +138,11 @@
  * @param[in] ownerPath     - The D-Bus path hosting the Associations property
  * @param[in,out] assocMaps - The association maps
  */
-void addSingleAssociation(boost::asio::io_context& io,
-                          sdbusplus::asio::object_server& server,
-                          const std::string& assocPath,
-                          const std::string& endpoint, const std::string& owner,
-                          const std::string& ownerPath,
-                          AssociationMaps& assocMaps);
+void addSingleAssociation(
+    boost::asio::io_context& io, sdbusplus::asio::object_server& server,
+    const std::string& assocPath, const std::string& endpoint,
+    const std::string& owner, const std::string& ownerPath,
+    AssociationMaps& assocMaps);
 
 /** @brief Create a real association out of a pending association
  *         if there is one for this path.
@@ -161,11 +157,10 @@
  * @param[in,out] assocMaps - The association maps
  * @param[in,out] server    - sdbus system object
  */
-void checkIfPendingAssociation(boost::asio::io_context& io,
-                               const std::string& objectPath,
-                               const InterfaceMapType& interfaceMap,
-                               AssociationMaps& assocMaps,
-                               sdbusplus::asio::object_server& server);
+void checkIfPendingAssociation(
+    boost::asio::io_context& io, const std::string& objectPath,
+    const InterfaceMapType& interfaceMap, AssociationMaps& assocMaps,
+    sdbusplus::asio::object_server& server);
 
 /** @brief Find all associations in the association owners map with the
  *         specified endpoint path.
@@ -191,7 +186,6 @@
  * @param[in,out] assocMaps - The association maps
  * @param[in,out] server    - sdbus system object
  */
-void moveAssociationToPending(boost::asio::io_context& io,
-                              const std::string& endpointPath,
-                              AssociationMaps& assocMaps,
-                              sdbusplus::asio::object_server& server);
+void moveAssociationToPending(
+    boost::asio::io_context& io, const std::string& endpointPath,
+    AssociationMaps& assocMaps, sdbusplus::asio::object_server& server);
diff --git a/src/handler.cpp b/src/handler.cpp
index 67dc541..30b7ba3 100644
--- a/src/handler.cpp
+++ b/src/handler.cpp
@@ -77,11 +77,11 @@
                         interfaces.size(), interfaceMap.second.size()));
                     // Return iterator points at the first output elemtn,
                     // meaning that there are no intersections.
-                    if (std::set_intersection(interfaces.begin(),
-                                              interfaces.end(),
-                                              interfaceMap.second.begin(),
-                                              interfaceMap.second.end(),
-                                              output.begin()) != output.begin())
+                    if (std::set_intersection(
+                            interfaces.begin(), interfaces.end(),
+                            interfaceMap.second.begin(),
+                            interfaceMap.second.end(), output.begin()) !=
+                        output.begin())
                     {
                         addObjectMapResult(ret, thisPath, interfaceMap);
                     }
@@ -119,8 +119,8 @@
         // meaning that there are no intersections.
         if (std::set_intersection(interfaces.begin(), interfaces.end(),
                                   interfaceMap.second.begin(),
-                                  interfaceMap.second.end(),
-                                  output.begin()) != output.begin())
+                                  interfaceMap.second.end(), output.begin()) !=
+            output.begin())
         {
             results.emplace(interfaceMap.first, interfaceMap.second);
         }
@@ -203,9 +203,9 @@
     return ret;
 }
 
-std::vector<std::string> getSubTreePaths(const InterfaceMapType& interfaceMap,
-                                         std::string reqPath, int32_t depth,
-                                         std::vector<std::string>& interfaces)
+std::vector<std::string>
+    getSubTreePaths(const InterfaceMapType& interfaceMap, std::string reqPath,
+                    int32_t depth, std::vector<std::string>& interfaces)
 {
     if (depth <= 0)
     {
@@ -255,11 +255,11 @@
                         interfaces.size(), interfaceMap.second.size()));
                     // Return iterator points at the first output elemtn,
                     // meaning that there are no intersections.
-                    if (std::set_intersection(interfaces.begin(),
-                                              interfaces.end(),
-                                              interfaceMap.second.begin(),
-                                              interfaceMap.second.end(),
-                                              output.begin()) != output.begin())
+                    if (std::set_intersection(
+                            interfaces.begin(), interfaces.end(),
+                            interfaceMap.second.begin(),
+                            interfaceMap.second.end(), output.begin()) !=
+                        output.begin())
                     {
                         add = true;
                         break;
@@ -277,12 +277,12 @@
     return ret;
 }
 
-std::vector<InterfaceMapType::value_type>
-    getAssociatedSubTree(const InterfaceMapType& interfaceMap,
-                         const AssociationMaps& associationMaps,
-                         const sdbusplus::message::object_path& associationPath,
-                         const sdbusplus::message::object_path& reqPath,
-                         int32_t depth, std::vector<std::string>& interfaces)
+std::vector<InterfaceMapType::value_type> getAssociatedSubTree(
+    const InterfaceMapType& interfaceMap,
+    const AssociationMaps& associationMaps,
+    const sdbusplus::message::object_path& associationPath,
+    const sdbusplus::message::object_path& reqPath, int32_t depth,
+    std::vector<std::string>& interfaces)
 {
     auto findEndpoint = associationMaps.ifaces.find(associationPath.str);
     if (findEndpoint == associationMaps.ifaces.end())
diff --git a/src/handler.hpp b/src/handler.hpp
index 9e692e5..515c937 100644
--- a/src/handler.hpp
+++ b/src/handler.hpp
@@ -21,9 +21,9 @@
     getSubTree(const InterfaceMapType& interfaceMap, std::string reqPath,
                int32_t depth, std::vector<std::string>& interfaces);
 
-std::vector<std::string> getSubTreePaths(const InterfaceMapType& interfaceMap,
-                                         std::string reqPath, int32_t depth,
-                                         std::vector<std::string>& interfaces);
+std::vector<std::string>
+    getSubTreePaths(const InterfaceMapType& interfaceMap, std::string reqPath,
+                    int32_t depth, std::vector<std::string>& interfaces);
 
 /**
  * @brief Get the Associated Sub Tree object
@@ -40,12 +40,12 @@
  *
  * @return std::vector<InterfaceMapType::value_type>
  */
-std::vector<InterfaceMapType::value_type>
-    getAssociatedSubTree(const InterfaceMapType& interfaceMap,
-                         const AssociationMaps& associationMaps,
-                         const sdbusplus::message::object_path& associationPath,
-                         const sdbusplus::message::object_path& reqPath,
-                         int32_t depth, std::vector<std::string>& interfaces);
+std::vector<InterfaceMapType::value_type> getAssociatedSubTree(
+    const InterfaceMapType& interfaceMap,
+    const AssociationMaps& associationMaps,
+    const sdbusplus::message::object_path& associationPath,
+    const sdbusplus::message::object_path& reqPath, int32_t depth,
+    std::vector<std::string>& interfaces);
 
 /**
  * @brief Get the Associated Sub Tree Paths object
diff --git a/src/main.cpp b/src/main.cpp
index 85f0a92..694acd1 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -34,14 +34,14 @@
     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);
 }
@@ -75,8 +75,7 @@
             globalStartTime
 #endif
         ) :
-        systemBus(systemBus),
-        io(io), processName(processName), assocMaps(am)
+        systemBus(systemBus), io(io), processName(processName), assocMaps(am)
 #ifdef MAPPER_ENABLE_DEBUG
         ,
         globalStartTime(std::move(globalStartTime)),
@@ -142,22 +141,22 @@
          timeoutRetries](
             const boost::system::error_code ec,
             const std::variant<std::vector<Association>>& variantAssociations) {
-        if (ec)
-        {
-            if (ec.value() == boost::system::errc::timed_out &&
-                timeoutRetries < maxTimeoutRetries)
+            if (ec)
             {
-                doAssociations(io, systemBus, interfaceMap, objectServer,
-                               processName, path, timeoutRetries + 1);
-                return;
+                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";
             }
-            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);
-    },
+            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 +173,82 @@
         [&io, &interfaceMap, &objectServer, transaction, path, systemBus,
          timeoutRetries](const boost::system::error_code ec,
                          const std::string& introspectXml) {
-        if (ec)
-        {
-            if (ec.value() == boost::system::errc::timed_out &&
-                timeoutRetries < maxTimeoutRetries)
+            if (ec)
             {
-                doIntrospect(io, systemBus, transaction, interfaceMap,
-                             objectServer, path, timeoutRetries + 1);
+                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";
                 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)
-        {
-            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)
+            tinyxml2::XMLError e = doc.Parse(introspectXml.c_str());
+            if (e != tinyxml2::XMLError::XML_SUCCESS)
             {
-                continue;
+                std::cerr << "XML parsing failed\n";
+                return;
             }
 
-            thisPathMap[transaction->processName].emplace(ifaceName);
-
-            if (std::strcmp(ifaceName, assocDefsInterface) == 0)
+            tinyxml2::XMLNode* pRoot = doc.FirstChildElement("node");
+            if (pRoot == nullptr)
             {
-                doAssociations(io, systemBus, interfaceMap, objectServer,
-                               transaction->processName, path);
+                std::cerr << "XML document did not contain any data\n";
+                return;
             }
-
-            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)
+            auto& thisPathMap = interfaceMap[path];
+            tinyxml2::XMLElement* pElement =
+                pRoot->FirstChildElement("interface");
+            while (pElement != nullptr)
             {
-                std::string parentPath(path);
-                if (parentPath == "/")
+                const char* ifaceName = pElement->Attribute("name");
+                if (ifaceName == nullptr)
                 {
-                    parentPath.clear();
+                    continue;
                 }
 
-                doIntrospect(io, systemBus, transaction, interfaceMap,
-                             objectServer, parentPath + "/" + childPath);
+                thisPathMap[transaction->processName].emplace(ifaceName);
+
+                if (std::strcmp(ifaceName, assocDefsInterface) == 0)
+                {
+                    doAssociations(io, systemBus, interfaceMap, objectServer,
+                                   transaction->processName, path);
+                }
+
+                pElement = pElement->NextSiblingElement("interface");
             }
-            pElement = pElement->NextSiblingElement("node");
-        }
-    },
+
+            // 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");
+            }
+        },
         transaction->processName, path, "org.freedesktop.DBus.Introspectable",
         "Introspect");
 }
@@ -266,11 +266,11 @@
     if (needToIntrospect(processName))
     {
         std::shared_ptr<InProgressIntrospect> transaction =
-            std::make_shared<InProgressIntrospect>(systemBus, io, processName,
-                                                   assocMaps
+            std::make_shared<InProgressIntrospect>(
+                systemBus, io, processName, assocMaps
 #ifdef MAPPER_ENABLE_DEBUG
-                                                   ,
-                                                   globalStartTime
+                ,
+                globalStartTime
 #endif
             );
 
@@ -289,34 +289,34 @@
         [&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());
-#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());
-#endif
-        for (const std::string& processName : processNames)
-        {
-            if (needToIntrospect(processName))
+            if (ec)
             {
-                startNewIntrospect(systemBus, io, interfaceMap, processName,
-                                   assocMaps,
-#ifdef MAPPER_ENABLE_DEBUG
-                                   globalStartTime,
-#endif
-                                   objectServer);
-                updateOwners(systemBus, nameOwners, processName);
+                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());
+#endif
+            for (const std::string& processName : processNames)
+            {
+                if (needToIntrospect(processName))
+                {
+                    startNewIntrospect(systemBus, io, interfaceMap, processName,
+                                       assocMaps,
+#ifdef MAPPER_ENABLE_DEBUG
+                                       globalStartTime,
+#endif
+                                       objectServer);
+                    updateOwners(systemBus, nameOwners, processName);
+                }
+            }
+        },
         "org.freedesktop.DBus", "/org/freedesktop/DBus", "org.freedesktop.DBus",
         "ListNames");
 }
@@ -361,11 +361,12 @@
         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())
         {
@@ -392,8 +393,9 @@
 
     // Construct a signal set registered for process termination.
     boost::asio::signal_set signals(io, SIGINT, SIGTERM);
-    signals.async_wait(
-        [&io](const boost::system::error_code&, int) { io.stop(); });
+    signals.async_wait([&io](const boost::system::error_code&, int) {
+        io.stop();
+    });
 
     InterfaceMapType interfaceMap;
     boost::container::flat_map<std::string, std::string> nameOwners;
@@ -572,47 +574,47 @@
     iface->register_method(
         "GetAncestors", [&interfaceMap](std::string& reqPath,
                                         std::vector<std::string>& interfaces) {
-        return getAncestors(interfaceMap, reqPath, interfaces);
-    });
+            return getAncestors(interfaceMap, reqPath, interfaces);
+        });
 
     iface->register_method(
         "GetObject", [&interfaceMap](const std::string& path,
                                      std::vector<std::string>& interfaces) {
-        return getObject(interfaceMap, path, interfaces);
-    });
+            return getObject(interfaceMap, path, interfaces);
+        });
 
     iface->register_method(
         "GetSubTree", [&interfaceMap](std::string& reqPath, int32_t depth,
                                       std::vector<std::string>& interfaces) {
-        return getSubTree(interfaceMap, reqPath, depth, interfaces);
-    });
+            return getSubTree(interfaceMap, reqPath, depth, interfaces);
+        });
 
     iface->register_method(
         "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(
         "GetAssociatedSubTree",
         [&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(
         "GetAssociatedSubTreePaths",
         [&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 f0fcd94..79d79ba 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());
 }
 
@@ -97,13 +97,11 @@
     }
 }
 
-void processInterfaceAdded(boost::asio::io_context& io,
-                           InterfaceMapType& interfaceMap,
-                           const sdbusplus::message::object_path& objPath,
-                           const InterfacesAdded& intfAdded,
-                           const std::string& wellKnown,
-                           AssociationMaps& assocMaps,
-                           sdbusplus::asio::object_server& server)
+void processInterfaceAdded(
+    boost::asio::io_context& io, InterfaceMapType& interfaceMap,
+    const sdbusplus::message::object_path& objPath,
+    const InterfacesAdded& intfAdded, const std::string& wellKnown,
+    AssociationMaps& assocMaps, sdbusplus::asio::object_server& server)
 {
     auto& ifaceList = interfaceMap[objPath.str];
 
diff --git a/src/processing.hpp b/src/processing.hpp
index d33f15f..15577ec 100644
--- a/src/processing.hpp
+++ b/src/processing.hpp
@@ -79,10 +79,8 @@
  * @param[in,out] server          - sdbus system object
  *
  */
-void processInterfaceAdded(boost::asio::io_context& io,
-                           InterfaceMapType& interfaceMap,
-                           const sdbusplus::message::object_path& objPath,
-                           const InterfacesAdded& intfAdded,
-                           const std::string& wellKnown,
-                           AssociationMaps& assocMaps,
-                           sdbusplus::asio::object_server& server);
+void processInterfaceAdded(
+    boost::asio::io_context& io, InterfaceMapType& interfaceMap,
+    const sdbusplus::message::object_path& objPath,
+    const InterfacesAdded& intfAdded, const std::string& wellKnown,
+    AssociationMaps& assocMaps, sdbusplus::asio::object_server& server);
diff --git a/src/test/handler.cpp b/src/test/handler.cpp
index 3671977..aac2d0f 100644
--- a/src/test/handler.cpp
+++ b/src/test/handler.cpp
@@ -246,8 +246,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 +263,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"));
@@ -293,10 +293,10 @@
     std::vector<std::string> validInterfaces = {"test_interface_1",
                                                 "test_interface_2"};
     // Associated path, but invalid interface
-    ASSERT_TRUE(getAssociatedSubTree(interfaceMap, associationMap,
-                                     validAssociatedPath, path, 0,
-                                     invalidInterfaces)
-                    .empty());
+    ASSERT_TRUE(
+        getAssociatedSubTree(interfaceMap, associationMap, validAssociatedPath,
+                             path, 0, invalidInterfaces)
+            .empty());
 
     // Valid interface, not associated
     ASSERT_TRUE(getAssociatedSubTree(interfaceMap, associationMap, path / "dog",
@@ -316,10 +316,10 @@
     sdbusplus::message::object_path path0("/test/object_path_0");
     sdbusplus::message::object_path path1("/test/object_path_0/child");
     sdbusplus::message::object_path associatedPath = path0 / "descendent";
-    std::vector<std::string> interfaces = {"test_interface_1",
-                                           "test_interface_2",
-                                           // Not associated to path
-                                           "test_interface_3"};
+    std::vector<std::string> interfaces = {
+        "test_interface_1", "test_interface_2",
+        // Not associated to path
+        "test_interface_3"};
 
     // Path0
     std::vector<InterfaceMapType::value_type> subtree = getAssociatedSubTree(
@@ -368,10 +368,10 @@
                     .empty());
 
     // Valid interface, not associated
-    ASSERT_TRUE(getAssociatedSubTreePaths(interfaceMap, associationMap,
-                                          path / "dog", path, 0,
-                                          validInterfaces)
-                    .empty());
+    ASSERT_TRUE(
+        getAssociatedSubTreePaths(interfaceMap, associationMap, path / "dog",
+                                  path, 0, validInterfaces)
+            .empty());
 
     // Invalid path, with valid association
     path = sdbusplus::message::object_path("/invalid_path");
@@ -387,10 +387,10 @@
     sdbusplus::message::object_path path0("/test/object_path_0");
     sdbusplus::message::object_path path1("/test/object_path_0/child");
     sdbusplus::message::object_path associatedPath = path0 / "descendent";
-    std::vector<std::string> interfaces = {"test_interface_1",
-                                           "test_interface_2",
-                                           // Not associated to path
-                                           "test_interface_3"};
+    std::vector<std::string> interfaces = {
+        "test_interface_1", "test_interface_2",
+        // Not associated to path
+        "test_interface_3"};
 
     // Path0
     std::vector<std::string> subtreePath = getAssociatedSubTreePaths(
@@ -405,9 +405,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"));
 }
diff --git a/src/test/interfaces_added.cpp b/src/test/interfaces_added.cpp
index 4446e23..63a6a26 100644
--- a/src/test/interfaces_added.cpp
+++ b/src/test/interfaces_added.cpp
@@ -34,8 +34,8 @@
     auto interfaceMap = createDefaultInterfaceMap();
     AssociationMaps assocMaps;
 
-    auto intfAdded = createInterfacesAdded(assocDefsInterface,
-                                           assocDefsProperty);
+    auto intfAdded =
+        createInterfacesAdded(assocDefsInterface, assocDefsProperty);
 
     boost::asio::io_context io;
 
