diff --git a/redfish-core/include/utils/collection.hpp b/redfish-core/include/utils/collection.hpp
index 0801cd5..7d28c0f 100644
--- a/redfish-core/include/utils/collection.hpp
+++ b/redfish-core/include/utils/collection.hpp
@@ -20,6 +20,51 @@
 namespace collection_util
 {
 
+inline void handleCollectionMembers(
+    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+    const boost::urls::url& collectionPath, const boost::system::error_code& ec,
+    const dbus::utility::MapperGetSubTreePathsResponse& objects)
+{
+    if (ec == boost::system::errc::io_error)
+    {
+        asyncResp->res.jsonValue["Members"] = nlohmann::json::array();
+        asyncResp->res.jsonValue["Members@odata.count"] = 0;
+        return;
+    }
+
+    if (ec)
+    {
+        BMCWEB_LOG_DEBUG("DBUS response error {}", ec.value());
+        messages::internalError(asyncResp->res);
+        return;
+    }
+
+    std::vector<std::string> pathNames;
+    for (const auto& object : objects)
+    {
+        sdbusplus::message::object_path path(object);
+        std::string leaf = path.filename();
+        if (leaf.empty())
+        {
+            continue;
+        }
+        pathNames.push_back(leaf);
+    }
+    std::ranges::sort(pathNames, AlphanumLess<std::string>());
+
+    nlohmann::json& members = asyncResp->res.jsonValue["Members"];
+    members = nlohmann::json::array();
+    for (const std::string& leaf : pathNames)
+    {
+        boost::urls::url url = collectionPath;
+        crow::utility::appendUrlPieces(url, leaf);
+        nlohmann::json::object_t member;
+        member["@odata.id"] = std::move(url);
+        members.emplace_back(std::move(member));
+    }
+    asyncResp->res.jsonValue["Members@odata.count"] = members.size();
+}
+
 /**
  * @brief Populate the collection "Members" from a GetSubTreePaths search of
  *        inventory
@@ -33,56 +78,15 @@
  * @return void
  */
 inline void
-    getCollectionMembers(std::shared_ptr<bmcweb::AsyncResp> asyncResp,
+    getCollectionMembers(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
                          const boost::urls::url& collectionPath,
                          std::span<const std::string_view> interfaces,
-                         const char* subtree = "/xyz/openbmc_project/inventory")
+                         const std::string& subtree)
 {
     BMCWEB_LOG_DEBUG("Get collection members for: {}", collectionPath.buffer());
     dbus::utility::getSubTreePaths(
         subtree, 0, interfaces,
-        [collectionPath, asyncResp{std::move(asyncResp)}](
-            const boost::system::error_code& ec,
-            const dbus::utility::MapperGetSubTreePathsResponse& objects) {
-        if (ec == boost::system::errc::io_error)
-        {
-            asyncResp->res.jsonValue["Members"] = nlohmann::json::array();
-            asyncResp->res.jsonValue["Members@odata.count"] = 0;
-            return;
-        }
-
-        if (ec)
-        {
-            BMCWEB_LOG_DEBUG("DBUS response error {}", ec.value());
-            messages::internalError(asyncResp->res);
-            return;
-        }
-
-        std::vector<std::string> pathNames;
-        for (const auto& object : objects)
-        {
-            sdbusplus::message::object_path path(object);
-            std::string leaf = path.filename();
-            if (leaf.empty())
-            {
-                continue;
-            }
-            pathNames.push_back(leaf);
-        }
-        std::ranges::sort(pathNames, AlphanumLess<std::string>());
-
-        nlohmann::json& members = asyncResp->res.jsonValue["Members"];
-        members = nlohmann::json::array();
-        for (const std::string& leaf : pathNames)
-        {
-            boost::urls::url url = collectionPath;
-            crow::utility::appendUrlPieces(url, leaf);
-            nlohmann::json::object_t member;
-            member["@odata.id"] = std::move(url);
-            members.emplace_back(std::move(member));
-        }
-        asyncResp->res.jsonValue["Members@odata.count"] = members.size();
-        });
+        std::bind_front(handleCollectionMembers, asyncResp, collectionPath));
 }
 
 } // namespace collection_util
diff --git a/redfish-core/lib/cable.hpp b/redfish-core/lib/cable.hpp
index 28031e1..a39d00a 100644
--- a/redfish-core/lib/cable.hpp
+++ b/redfish-core/lib/cable.hpp
@@ -210,7 +210,8 @@
         constexpr std::array<std::string_view, 1> interfaces{
             "xyz.openbmc_project.Inventory.Item.Cable"};
         collection_util::getCollectionMembers(
-            asyncResp, boost::urls::url("/redfish/v1/Cables"), interfaces);
+            asyncResp, boost::urls::url("/redfish/v1/Cables"), interfaces,
+            "/xyz/openbmc_project/inventory");
         });
 }
 
diff --git a/redfish-core/lib/chassis.hpp b/redfish-core/lib/chassis.hpp
index 969973f..0d14d4e 100644
--- a/redfish-core/lib/chassis.hpp
+++ b/redfish-core/lib/chassis.hpp
@@ -209,7 +209,8 @@
         "xyz.openbmc_project.Inventory.Item.Board",
         "xyz.openbmc_project.Inventory.Item.Chassis"};
     collection_util::getCollectionMembers(
-        asyncResp, boost::urls::url("/redfish/v1/Chassis"), interfaces);
+        asyncResp, boost::urls::url("/redfish/v1/Chassis"), interfaces,
+        "/xyz/openbmc_project/inventory");
 }
 
 inline void getChassisContainedBy(
diff --git a/redfish-core/lib/fabric_adapters.hpp b/redfish-core/lib/fabric_adapters.hpp
index 2a85f42..317348f 100644
--- a/redfish-core/lib/fabric_adapters.hpp
+++ b/redfish-core/lib/fabric_adapters.hpp
@@ -309,7 +309,7 @@
     collection_util::getCollectionMembers(
         asyncResp,
         boost::urls::url("/redfish/v1/Systems/system/FabricAdapters"),
-        interfaces);
+        interfaces, "/xyz/openbmc_project/inventory");
 }
 
 inline void handleFabricAdapterCollectionHead(
diff --git a/redfish-core/lib/memory.hpp b/redfish-core/lib/memory.hpp
index 551a579..45a3789 100644
--- a/redfish-core/lib/memory.hpp
+++ b/redfish-core/lib/memory.hpp
@@ -810,7 +810,7 @@
             "xyz.openbmc_project.Inventory.Item.Dimm"};
         collection_util::getCollectionMembers(
             asyncResp, boost::urls::url("/redfish/v1/Systems/system/Memory"),
-            interfaces);
+            interfaces, "/xyz/openbmc_project/inventory");
         });
 }
 
diff --git a/redfish-core/lib/processor.hpp b/redfish-core/lib/processor.hpp
index 78f25d4..988d5cc 100644
--- a/redfish-core/lib/processor.hpp
+++ b/redfish-core/lib/processor.hpp
@@ -1232,7 +1232,7 @@
                     boost::urls::format(
                         "/redfish/v1/Systems/system/Processors/{}/OperatingConfigs",
                         cpuName),
-                    interface, object.c_str());
+                    interface, object);
                 return;
             }
             });
@@ -1362,7 +1362,7 @@
         collection_util::getCollectionMembers(
             asyncResp,
             boost::urls::url("/redfish/v1/Systems/system/Processors"),
-            processorInterfaces);
+            processorInterfaces, "/xyz/openbmc_project/inventory");
         });
 }
 
diff --git a/redfish-core/lib/storage.hpp b/redfish-core/lib/storage.hpp
index 389a20b..74c88f7 100644
--- a/redfish-core/lib/storage.hpp
+++ b/redfish-core/lib/storage.hpp
@@ -69,7 +69,7 @@
     };
     collection_util::getCollectionMembers(
         asyncResp, boost::urls::format("/redfish/v1/Systems/system/Storage"),
-        interface);
+        interface, "/xyz/openbmc_project/inventory");
 }
 
 inline void handleStorageCollectionGet(
@@ -88,7 +88,8 @@
         "xyz.openbmc_project.Inventory.Item.Storage"
     };
     collection_util::getCollectionMembers(
-        asyncResp, boost::urls::format("/redfish/v1/Storage"), interface);
+        asyncResp, boost::urls::format("/redfish/v1/Storage"), interface,
+        "/xyz/openbmc_project/inventory");
 }
 
 inline void requestRoutesStorageCollection(App& app)
