diff --git a/http/routing.hpp b/http/routing.hpp
index 5b819c5..0fa2497 100644
--- a/http/routing.hpp
+++ b/http/routing.hpp
@@ -1275,8 +1275,7 @@
         crow::connections::systemBus->async_method_call(
             [&req, asyncResp, &rules, ruleIndex,
              found](const boost::system::error_code ec,
-                    const std::map<std::string, dbus::utility::DbusVariantType>&
-                        userInfo) {
+                    const dbus::utility::DBusPropertiesMap& userInfoMap) {
                 if (ec)
                 {
                     BMCWEB_LOG_ERROR << "GetUserInfo failed...";
@@ -1284,30 +1283,42 @@
                         boost::beast::http::status::internal_server_error);
                     return;
                 }
-
-                const std::string* userRolePtr = nullptr;
-                auto userInfoIter = userInfo.find("UserPrivilege");
-                if (userInfoIter != userInfo.end())
-                {
-                    userRolePtr =
-                        std::get_if<std::string>(&userInfoIter->second);
-                }
-
                 std::string userRole{};
-                if (userRolePtr != nullptr)
+                const bool* remoteUser = nullptr;
+                std::optional<bool> passwordExpired;
+
+                for (const auto& userInfo : userInfoMap)
                 {
-                    userRole = *userRolePtr;
-                    BMCWEB_LOG_DEBUG << "userName = " << req.session->username
-                                     << " userRole = " << *userRolePtr;
+                    if (userInfo.first == "UserPrivilege")
+                    {
+                        const std::string* userRolePtr =
+                            std::get_if<std::string>(&userInfo.second);
+                        if (userRolePtr == nullptr)
+                        {
+                            continue;
+                        }
+                        userRole = *userRolePtr;
+                        BMCWEB_LOG_DEBUG
+                            << "userName = " << req.session->username
+                            << " userRole = " << *userRolePtr;
+                    }
+                    else if (userInfo.first == "RemoteUser")
+                    {
+                        remoteUser = std::get_if<bool>(&userInfo.second);
+                    }
+                    else if (userInfo.first == "UserPasswordExpired")
+                    {
+                        const bool* passwordExpiredPtr =
+                            std::get_if<bool>(&userInfo.second);
+                        if (passwordExpiredPtr == nullptr)
+                        {
+                            continue;
+                        }
+                        passwordExpired = *passwordExpiredPtr;
+                    }
                 }
 
-                const bool* remoteUserPtr = nullptr;
-                auto remoteUserIter = userInfo.find("RemoteUser");
-                if (remoteUserIter != userInfo.end())
-                {
-                    remoteUserPtr = std::get_if<bool>(&remoteUserIter->second);
-                }
-                if (remoteUserPtr == nullptr)
+                if (remoteUser == nullptr)
                 {
                     BMCWEB_LOG_ERROR
                         << "RemoteUser property missing or wrong type";
@@ -1315,24 +1326,10 @@
                         boost::beast::http::status::internal_server_error);
                     return;
                 }
-                bool remoteUser = *remoteUserPtr;
 
-                bool passwordExpired = false; // default for remote user
-                if (!remoteUser)
+                if (passwordExpired == std::nullopt)
                 {
-                    const bool* passwordExpiredPtr = nullptr;
-                    auto passwordExpiredIter =
-                        userInfo.find("UserPasswordExpired");
-                    if (passwordExpiredIter != userInfo.end())
-                    {
-                        passwordExpiredPtr =
-                            std::get_if<bool>(&passwordExpiredIter->second);
-                    }
-                    if (passwordExpiredPtr != nullptr)
-                    {
-                        passwordExpired = *passwordExpiredPtr;
-                    }
-                    else
+                    if (!*remoteUser)
                     {
                         BMCWEB_LOG_ERROR
                             << "UserPasswordExpired property is expected for"
@@ -1341,6 +1338,7 @@
                             boost::beast::http::status::internal_server_error);
                         return;
                     }
+                    passwordExpired = false;
                 }
 
                 // Get the userprivileges from the role
@@ -1350,7 +1348,7 @@
                 // Set isConfigureSelfOnly based on D-Bus results.  This
                 // ignores the results from both pamAuthenticateUser and the
                 // value from any previous use of this session.
-                req.session->isConfigureSelfOnly = passwordExpired;
+                req.session->isConfigureSelfOnly = *passwordExpired;
 
                 // Modifyprivileges if isConfigureSelfOnly.
                 if (req.session->isConfigureSelfOnly)
diff --git a/include/dbus_utility.hpp b/include/dbus_utility.hpp
index 481b33d..0c80197 100644
--- a/include/dbus_utility.hpp
+++ b/include/dbus_utility.hpp
@@ -73,6 +73,15 @@
 using MapperGetSubTreeResponse =
     std::vector<std::pair<std::string, MapperServiceMap>>;
 
+using MapperGetObject =
+    std::vector<std::pair<std::string, std::vector<std::string>>>;
+
+using MapperGetAncestorsResponse = std::vector<
+    std::pair<std::string,
+              std::vector<std::pair<std::string, std::vector<std::string>>>>>;
+
+using MapperGetSubTreePathsResponse = std::vector<std::string>;
+
 inline void escapePathForDbus(std::string& path)
 {
     const std::regex reg("[^A-Za-z0-9_/]");
@@ -109,13 +118,10 @@
 template <typename Callback>
 inline void checkDbusPathExists(const std::string& path, Callback&& callback)
 {
-    using GetObjectType =
-        std::vector<std::pair<std::string, std::vector<std::string>>>;
-
     crow::connections::systemBus->async_method_call(
         [callback{std::forward<Callback>(callback)}](
             const boost::system::error_code ec,
-            const GetObjectType& objectNames) {
+            const dbus::utility::MapperGetObject& objectNames) {
             callback(!ec && !objectNames.empty());
         },
         "xyz.openbmc_project.ObjectMapper",
diff --git a/include/hostname_monitor.hpp b/include/hostname_monitor.hpp
index 73c315f..f4e6b27 100644
--- a/include/hostname_monitor.hpp
+++ b/include/hostname_monitor.hpp
@@ -1,7 +1,7 @@
 #pragma once
 #ifdef BMCWEB_ENABLE_SSL
-#include <boost/container/flat_map.hpp>
 #include <dbus_singleton.hpp>
+#include <dbus_utility.hpp>
 #include <include/dbus_utility.hpp>
 #include <sdbusplus/bus/match.hpp>
 #include <sdbusplus/message/types.hpp>
@@ -43,20 +43,19 @@
 
     sdbusplus::message::message message(m);
     std::string iface;
-    boost::container::flat_map<std::string, dbus::utility::DbusVariantType>
-        changedProperties;
+    dbus::utility::DBusPropertiesMap changedProperties;
 
     message.read(iface, changedProperties);
-    auto it = changedProperties.find("HostName");
-    if (it == changedProperties.end())
+    const std::string* hostname = nullptr;
+    for (const auto& propertyPair : changedProperties)
     {
-        return 0;
+        if (propertyPair.first == "HostName")
+        {
+            hostname = std::get_if<std::string>(&propertyPair.second);
+        }
     }
-
-    std::string* hostname = std::get_if<std::string>(&it->second);
     if (hostname == nullptr)
     {
-        BMCWEB_LOG_ERROR << "Unable to read hostname";
         return 0;
     }
 
diff --git a/include/image_upload.hpp b/include/image_upload.hpp
index 1b0a09a..330ea9c 100644
--- a/include/image_upload.hpp
+++ b/include/image_upload.hpp
@@ -64,10 +64,7 @@
             BMCWEB_LOG_DEBUG << "Match fired";
 
             sdbusplus::message::object_path path;
-            std::vector<std::pair<
-                std::string, std::vector<std::pair<
-                                 std::string, dbus::utility::DbusVariantType>>>>
-                interfaces;
+            dbus::utility::DBusInteracesMap interfaces;
             m.read(path, interfaces);
 
             if (std::find_if(interfaces.begin(), interfaces.end(),
diff --git a/include/nbd_proxy.hpp b/include/nbd_proxy.hpp
index afb6493..e0a0111 100644
--- a/include/nbd_proxy.hpp
+++ b/include/nbd_proxy.hpp
@@ -261,10 +261,8 @@
 
             auto getUserInfoHandler = [&conn, asyncResp](
                                           const boost::system::error_code ec,
-                                          boost::container::flat_map<
-                                              std::string,
-                                              dbus::utility::DbusVariantType>
-                                              userInfo) {
+                                          const dbus::utilities::
+                                              DBusPropertiesMap& userInfo) {
                 if (ec)
                 {
                     BMCWEB_LOG_ERROR << "GetUserInfo failed...";
diff --git a/include/obmc_console.hpp b/include/obmc_console.hpp
index 478649a..01ee479 100644
--- a/include/obmc_console.hpp
+++ b/include/obmc_console.hpp
@@ -4,7 +4,6 @@
 #include <app.hpp>
 #include <async_resp.hpp>
 #include <boost/asio/local/stream_protocol.hpp>
-#include <boost/container/flat_map.hpp>
 #include <boost/container/flat_set.hpp>
 #include <websocket.hpp>
 
diff --git a/include/openbmc_dbus_rest.hpp b/include/openbmc_dbus_rest.hpp
index af6a720..042f193 100644
--- a/include/openbmc_dbus_rest.hpp
+++ b/include/openbmc_dbus_rest.hpp
@@ -32,11 +32,6 @@
 {
 namespace openbmc_mapper
 {
-
-using GetSubTreeType = std::vector<
-    std::pair<std::string,
-              std::vector<std::pair<std::string, std::vector<std::string>>>>>;
-
 const constexpr char* notFoundMsg = "404 Not Found";
 const constexpr char* badReqMsg = "400 Bad Request";
 const constexpr char* methodNotAllowedMsg = "405 Method Not Allowed";
@@ -139,10 +134,9 @@
                      << service << " " << interface;
 
     crow::connections::systemBus->async_method_call(
-        [asyncResp, objectPath, service, interface](
-            const boost::system::error_code ec,
-            const std::vector<std::pair<
-                std::string, dbus::utility::DbusVariantType>>& propertiesList) {
+        [asyncResp, objectPath, service,
+         interface](const boost::system::error_code ec,
+                    const dbus::utility::DBusPropertiesMap& propertiesList) {
             if (ec)
             {
                 BMCWEB_LOG_ERROR << "GetAll on path " << objectPath << " iface "
@@ -186,7 +180,7 @@
 // called after all ObjectManagers are searched for and called.
 inline void findRemainingObjectsForEnumerate(
     const std::string& objectPath,
-    const std::shared_ptr<GetSubTreeType>& subtree,
+    const std::shared_ptr<dbus::utility::MapperGetSubTreeResponse>& subtree,
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
 {
     BMCWEB_LOG_DEBUG << "findRemainingObjectsForEnumerate";
@@ -244,7 +238,7 @@
     InProgressEnumerateData& operator=(InProgressEnumerateData&&) = delete;
 
     const std::string objectPath;
-    std::shared_ptr<GetSubTreeType> subtree;
+    std::shared_ptr<dbus::utility::MapperGetSubTreeResponse> subtree;
     std::shared_ptr<bmcweb::AsyncResp> asyncResp;
 };
 
@@ -331,10 +325,7 @@
     crow::connections::systemBus->async_method_call(
         [transaction, objectName, connectionName](
             const boost::system::error_code ec,
-            const boost::container::flat_map<
-                std::string, boost::container::flat_map<
-                                 std::string, std::vector<std::string>>>&
-                objects) {
+            const dbus::utility::MapperGetAncestorsResponse& objects) {
             if (ec)
             {
                 BMCWEB_LOG_ERROR << "GetAncestors on path " << objectName
@@ -369,12 +360,9 @@
 inline void getObjectAndEnumerate(
     const std::shared_ptr<InProgressEnumerateData>& transaction)
 {
-    using GetObjectType =
-        std::vector<std::pair<std::string, std::vector<std::string>>>;
-
     crow::connections::systemBus->async_method_call(
         [transaction](const boost::system::error_code ec,
-                      const GetObjectType& objects) {
+                      const dbus::utility::MapperGetObject& objects) {
             if (ec)
             {
                 BMCWEB_LOG_ERROR << "GetObject for path "
@@ -1627,8 +1615,9 @@
                        const std::string& objectPath, int32_t depth = 0)
 {
     crow::connections::systemBus->async_method_call(
-        [asyncResp](const boost::system::error_code ec,
-                    const std::vector<std::string>& objectPaths) {
+        [asyncResp](
+            const boost::system::error_code ec,
+            const dbus::utility::MapperGetSubTreePathsResponse& objectPaths) {
             if (ec)
             {
                 setErrorResponse(asyncResp->res,
@@ -1658,13 +1647,15 @@
                                 {"data", nlohmann::json::object()}};
 
     crow::connections::systemBus->async_method_call(
-        [objectPath, asyncResp](const boost::system::error_code ec,
-                                const GetSubTreeType& objectNames) {
+        [objectPath, asyncResp](
+            const boost::system::error_code ec,
+            const dbus::utility::MapperGetSubTreeResponse& objectNames) {
             auto transaction = std::make_shared<InProgressEnumerateData>(
                 objectPath, asyncResp);
 
             transaction->subtree =
-                std::make_shared<GetSubTreeType>(objectNames);
+                std::make_shared<dbus::utility::MapperGetSubTreeResponse>(
+                    objectNames);
 
             if (ec)
             {
@@ -1696,11 +1687,10 @@
     std::shared_ptr<std::string> path =
         std::make_shared<std::string>(std::move(objectPath));
 
-    using GetObjectType =
-        std::vector<std::pair<std::string, std::vector<std::string>>>;
     crow::connections::systemBus->async_method_call(
-        [asyncResp, path, propertyName](const boost::system::error_code ec,
-                                        const GetObjectType& objectNames) {
+        [asyncResp, path,
+         propertyName](const boost::system::error_code ec,
+                       const dbus::utility::MapperGetObject& objectNames) {
             if (ec || objectNames.empty())
             {
                 setErrorResponse(asyncResp->res,
@@ -1869,12 +1859,9 @@
     transaction->propertyName = destProperty;
     transaction->propertyValue = propertySetValue;
 
-    using GetObjectType =
-        std::vector<std::pair<std::string, std::vector<std::string>>>;
-
     crow::connections::systemBus->async_method_call(
         [transaction](const boost::system::error_code ec2,
-                      const GetObjectType& objectNames) {
+                      const dbus::utility::MapperGetObject& objectNames) {
             if (!ec2 && objectNames.empty())
             {
                 setErrorResponse(transaction->asyncResp->res,
diff --git a/include/persistent_data.hpp b/include/persistent_data.hpp
index 02f2cce..6d0f7c1 100644
--- a/include/persistent_data.hpp
+++ b/include/persistent_data.hpp
@@ -2,7 +2,6 @@
 
 #include <app.hpp>
 #include <boost/beast/http/fields.hpp>
-#include <boost/container/flat_map.hpp>
 #include <boost/uuid/uuid.hpp>
 #include <boost/uuid/uuid_generators.hpp>
 #include <boost/uuid/uuid_io.hpp>
diff --git a/include/sessions.hpp b/include/sessions.hpp
index 85c0cb9..748bb08 100644
--- a/include/sessions.hpp
+++ b/include/sessions.hpp
@@ -6,7 +6,6 @@
 
 #include <openssl/rand.h>
 
-#include <boost/container/flat_map.hpp>
 #include <boost/uuid/uuid.hpp>
 #include <boost/uuid/uuid_generators.hpp>
 #include <boost/uuid/uuid_io.hpp>
diff --git a/redfish-core/include/event_service_manager.hpp b/redfish-core/include/event_service_manager.hpp
index 7aeacd6..90c7e87 100644
--- a/redfish-core/include/event_service_manager.hpp
+++ b/redfish-core/include/event_service_manager.hpp
@@ -1325,8 +1325,7 @@
         }
 
         std::string interface;
-        std::vector<std::pair<std::string, dbus::utility::DbusVariantType>>
-            props;
+        dbus::utility::DBusPropertiesMap props;
         std::vector<std::string> invalidProps;
         msg.read(interface, props, invalidProps);
 
diff --git a/redfish-core/include/utils/collection.hpp b/redfish-core/include/utils/collection.hpp
index c5d603a..2cb2f3d 100644
--- a/redfish-core/include/utils/collection.hpp
+++ b/redfish-core/include/utils/collection.hpp
@@ -30,9 +30,9 @@
 {
     BMCWEB_LOG_DEBUG << "Get collection members for: " << collectionPath;
     crow::connections::systemBus->async_method_call(
-        [collectionPath,
-         aResp{std::move(aResp)}](const boost::system::error_code ec,
-                                  const std::vector<std::string>& objects) {
+        [collectionPath, aResp{std::move(aResp)}](
+            const boost::system::error_code ec,
+            const dbus::utility::MapperGetSubTreePathsResponse& objects) {
             if (ec == boost::system::errc::io_error)
             {
                 aResp->res.jsonValue["Members"] = nlohmann::json::array();
diff --git a/redfish-core/include/utils/fw_utils.hpp b/redfish-core/include/utils/fw_utils.hpp
index c05f8cb..d80ce71 100644
--- a/redfish-core/include/utils/fw_utils.hpp
+++ b/redfish-core/include/utils/fw_utils.hpp
@@ -84,11 +84,7 @@
                 [aResp, fwVersionPurpose, activeVersionPropName,
                  populateLinkToImages, functionalFwIds](
                     const boost::system::error_code ec2,
-                    const std::vector<
-                        std::pair<std::string,
-                                  std::vector<std::pair<
-                                      std::string, std::vector<std::string>>>>>&
-                        subtree) {
+                    const dbus::utility::MapperGetSubTreeResponse& subtree) {
                     if (ec2)
                     {
                         BMCWEB_LOG_ERROR << "error_code = " << ec2;
@@ -132,9 +128,7 @@
                             [aResp, swId, runningImage, fwVersionPurpose,
                              activeVersionPropName, populateLinkToImages](
                                 const boost::system::error_code ec3,
-                                const boost::container::flat_map<
-                                    std::string,
-                                    dbus::utility::DbusVariantType>&
+                                const dbus::utility::DBusPropertiesMap&
                                     propertiesList) {
                                 if (ec3)
                                 {
@@ -149,36 +143,48 @@
                                 // "IBM-witherspoon-OP9-v2.0.10-2.22" "Purpose"
                                 // s
                                 // "xyz.openbmc_project.Software.Version.VersionPurpose.Host"
-
-                                boost::container::flat_map<
-                                    std::string,
-                                    dbus::utility::DbusVariantType>::
-                                    const_iterator it =
-                                        propertiesList.find("Purpose");
-                                if (it == propertiesList.end())
+                                std::string version;
+                                std::string swInvPurpose;
+                                for (const auto& propertyPair : propertiesList)
                                 {
-                                    BMCWEB_LOG_ERROR
-                                        << "Can't find property \"Purpose\"!";
-                                    messages::internalError(aResp->res);
-                                    return;
-                                }
-                                const std::string* swInvPurpose =
-                                    std::get_if<std::string>(&it->second);
-                                if (swInvPurpose == nullptr)
-                                {
-                                    BMCWEB_LOG_ERROR << "wrong types for "
-                                                        "property \"Purpose\"!";
-                                    messages::internalError(aResp->res);
-                                    return;
+                                    if (propertyPair.first == "Purpose")
+                                    {
+                                        const std::string* purpose =
+                                            std::get_if<std::string>(
+                                                &propertyPair.second);
+                                        if (purpose == nullptr)
+                                        {
+                                            messages::internalError(aResp->res);
+                                            return;
+                                        }
+                                        swInvPurpose = *purpose;
+                                    }
+                                    if (propertyPair.first == "Version")
+                                    {
+                                        const std::string* versionPtr =
+                                            std::get_if<std::string>(
+                                                &propertyPair.second);
+                                        if (versionPtr == nullptr)
+                                        {
+                                            messages::internalError(aResp->res);
+                                            return;
+                                        }
+                                        version = *versionPtr;
+                                    }
                                 }
 
                                 BMCWEB_LOG_DEBUG << "Image ID: " << swId;
                                 BMCWEB_LOG_DEBUG << "Image purpose: "
-                                                 << *swInvPurpose;
+                                                 << swInvPurpose;
                                 BMCWEB_LOG_DEBUG << "Running image: "
                                                  << runningImage;
 
-                                if (*swInvPurpose != fwVersionPurpose)
+                                if (version.empty())
+                                {
+                                    messages::internalError(aResp->res);
+                                    return;
+                                }
+                                if (swInvPurpose != fwVersionPurpose)
                                 {
                                     // Not purpose we're looking for
                                     return;
@@ -217,28 +223,9 @@
                                 if (!activeVersionPropName.empty() &&
                                     runningImage)
                                 {
-                                    it = propertiesList.find("Version");
-                                    if (it == propertiesList.end())
-                                    {
-                                        BMCWEB_LOG_ERROR
-                                            << "Can't find property "
-                                               "\"Version\"!";
-                                        messages::internalError(aResp->res);
-                                        return;
-                                    }
-                                    const std::string* version =
-                                        std::get_if<std::string>(&it->second);
-                                    if (version == nullptr)
-                                    {
-                                        BMCWEB_LOG_ERROR
-                                            << "Error getting fw version";
-                                        messages::internalError(aResp->res);
-                                        return;
-                                    }
-
                                     aResp->res
                                         .jsonValue[activeVersionPropName] =
-                                        *version;
+                                        version;
                                 }
                             },
                             obj.second[0].first, obj.first,
@@ -327,32 +314,29 @@
     BMCWEB_LOG_DEBUG << "getFwStatus: swId " << *swId << " svc " << dbusSvc;
 
     crow::connections::systemBus->async_method_call(
-        [asyncResp, swId](
-            const boost::system::error_code errorCode,
-            const boost::container::flat_map<
-                std::string, dbus::utility::DbusVariantType>& propertiesList) {
+        [asyncResp,
+         swId](const boost::system::error_code errorCode,
+               const dbus::utility::DBusPropertiesMap& propertiesList) {
             if (errorCode)
             {
                 // not all fwtypes are updateable, this is ok
                 asyncResp->res.jsonValue["Status"]["State"] = "Enabled";
                 return;
             }
-            boost::container::flat_map<
-                std::string, dbus::utility::DbusVariantType>::const_iterator
-                it = propertiesList.find("Activation");
-            if (it == propertiesList.end())
+            const std::string* swInvActivation = nullptr;
+            for (const auto& property : propertiesList)
             {
-                BMCWEB_LOG_DEBUG << "Can't find property \"Activation\"!";
-                messages::propertyMissing(asyncResp->res, "Activation");
-                return;
+                if (property.first == "Activation")
+                {
+                    swInvActivation =
+                        std::get_if<std::string>(&property.second);
+                }
             }
-            const std::string* swInvActivation =
-                std::get_if<std::string>(&it->second);
+
             if (swInvActivation == nullptr)
             {
                 BMCWEB_LOG_DEBUG << "wrong types for property\"Activation\"!";
-                messages::propertyValueTypeError(asyncResp->res, "",
-                                                 "Activation");
+                messages::internalError(asyncResp->res);
                 return;
             }
             BMCWEB_LOG_DEBUG << "getFwStatus: Activation " << *swInvActivation;
diff --git a/redfish-core/lib/account_service.hpp b/redfish-core/lib/account_service.hpp
index 5cd70bc..4fcd540 100644
--- a/redfish-core/lib/account_service.hpp
+++ b/redfish-core/lib/account_service.hpp
@@ -67,9 +67,6 @@
     std::vector<std::pair<std::string, LDAPRoleMapData>> groupRoleList;
 };
 
-using GetObjectType =
-    std::vector<std::pair<std::string, std::vector<std::string>>>;
-
 inline std::string getRoleIdFromPrivilege(std::string_view role)
 {
     if (role == "priv-admin")
@@ -385,7 +382,7 @@
 
     crow::connections::systemBus->async_method_call(
         [callback, ldapType](const boost::system::error_code ec,
-                             const GetObjectType& resp) {
+                             const dbus::utility::MapperGetObject& resp) {
             if (ec || resp.empty())
             {
                 BMCWEB_LOG_ERROR
@@ -1310,9 +1307,7 @@
             crow::connections::systemBus->async_method_call(
                 [asyncResp](
                     const boost::system::error_code ec,
-                    const std::vector<
-                        std::pair<std::string, dbus::utility::DbusVariantType>>&
-                        propertiesList) {
+                    const dbus::utility::DBusPropertiesMap& propertiesList) {
                     if (ec)
                     {
                         messages::internalError(asyncResp->res);
diff --git a/redfish-core/lib/cable.hpp b/redfish-core/lib/cable.hpp
index 05da5f6..241baf4 100644
--- a/redfish-core/lib/cable.hpp
+++ b/redfish-core/lib/cable.hpp
@@ -1,5 +1,5 @@
 #pragma once
-#include <boost/container/flat_map.hpp>
+#include <dbus_utility.hpp>
 #include <utils/json_utils.hpp>
 
 namespace redfish
diff --git a/redfish-core/lib/certificate_service.hpp b/redfish-core/lib/certificate_service.hpp
index 6d17a61..4882ec3 100644
--- a/redfish-core/lib/certificate_service.hpp
+++ b/redfish-core/lib/certificate_service.hpp
@@ -452,11 +452,9 @@
                         messages::internalError(asyncResp->res);
                         return;
                     }
-                    std::vector<std::pair<
-                        std::string,
-                        std::vector<std::pair<std::string,
-                                              dbus::utility::DbusVariantType>>>>
-                        interfacesProperties;
+
+                    dbus::utility::DBusInteracesMap interfacesProperties;
+
                     sdbusplus::message::object_path csrObjectPath;
                     m.read(csrObjectPath, interfacesProperties);
                     BMCWEB_LOG_DEBUG << "CSR object added" << csrObjectPath.str;
@@ -572,13 +570,12 @@
     const std::string& objectPath, const std::string& service, long certId,
     const std::string& certURL, const std::string& name)
 {
-    using PropertiesMap =
-        boost::container::flat_map<std::string, dbus::utility::DbusVariantType>;
     BMCWEB_LOG_DEBUG << "getCertificateProperties Path=" << objectPath
                      << " certId=" << certId << " certURl=" << certURL;
     crow::connections::systemBus->async_method_call(
-        [asyncResp, certURL, certId, name](const boost::system::error_code ec,
-                                           const PropertiesMap& properties) {
+        [asyncResp, certURL, certId,
+         name](const boost::system::error_code ec,
+               const dbus::utility::DBusPropertiesMap& properties) {
             if (ec)
             {
                 BMCWEB_LOG_ERROR << "DBUS response error: " << ec;
@@ -666,9 +663,6 @@
         certs::certPropIntf);
 }
 
-using GetObjectType =
-    std::vector<std::pair<std::string, std::vector<std::string>>>;
-
 /**
  * Action to replace an existing certificate
  */
diff --git a/redfish-core/lib/chassis.hpp b/redfish-core/lib/chassis.hpp
index 597e5d0..45348db 100644
--- a/redfish-core/lib/chassis.hpp
+++ b/redfish-core/lib/chassis.hpp
@@ -19,7 +19,6 @@
 #include "led.hpp"
 
 #include <app.hpp>
-#include <boost/container/flat_map.hpp>
 #include <dbus_utility.hpp>
 #include <registries/privilege_registry.hpp>
 #include <sdbusplus/asio/property.hpp>
@@ -75,19 +74,6 @@
         });
 }
 
-/**
- * DBus types primitives for several generic DBus interfaces
- * TODO(Pawel) consider move this to separate file into boost::dbus
- */
-using ManagedObjectsType = std::vector<std::pair<
-    sdbusplus::message::object_path,
-    std::vector<std::pair<
-        std::string,
-        std::vector<std::pair<std::string, dbus::utility::DbusVariantType>>>>>>;
-
-using PropertiesType =
-    boost::container::flat_map<std::string, dbus::utility::DbusVariantType>;
-
 inline void getIntrusionByService(std::shared_ptr<bmcweb::AsyncResp> aResp,
                                   const std::string& service,
                                   const std::string& objPath)
@@ -120,10 +106,7 @@
     crow::connections::systemBus->async_method_call(
         [aResp{std::move(aResp)}](
             const boost::system::error_code ec,
-            const std::vector<std::pair<
-                std::string,
-                std::vector<std::pair<std::string, std::vector<std::string>>>>>&
-                subtree) {
+            const dbus::utility::MapperGetSubTreeResponse& subtree) {
             if (ec)
             {
                 // do not add err msg in redfish response, because this is not
@@ -234,7 +217,7 @@
             crow::connections::systemBus->async_method_call(
                 [asyncResp, chassisId(std::string(chassisId))](
                     const boost::system::error_code ec,
-                    const crow::openbmc_mapper::GetSubTreeType& subtree) {
+                    const dbus::utility::MapperGetSubTreeResponse& subtree) {
                     if (ec)
                     {
                         messages::internalError(asyncResp->res);
@@ -346,9 +329,7 @@
                         crow::connections::systemBus->async_method_call(
                             [asyncResp, chassisId(std::string(chassisId))](
                                 const boost::system::error_code /*ec2*/,
-                                const std::vector<
-                                    std::pair<std::string,
-                                              dbus::utility::DbusVariantType>>&
+                                const dbus::utility::DBusPropertiesMap&
                                     propertiesList) {
                                 for (const std::pair<
                                          std::string,
@@ -496,7 +477,7 @@
             crow::connections::systemBus->async_method_call(
                 [asyncResp, chassisId, locationIndicatorActive, indicatorLed](
                     const boost::system::error_code ec,
-                    const crow::openbmc_mapper::GetSubTreeType& subtree) {
+                    const dbus::utility::MapperGetSubTreeResponse& subtree) {
                     if (ec)
                     {
                         messages::internalError(asyncResp->res);
@@ -595,8 +576,9 @@
 
     // Use mapper to get subtree paths.
     crow::connections::systemBus->async_method_call(
-        [asyncResp](const boost::system::error_code ec,
-                    const std::vector<std::string>& chassisList) {
+        [asyncResp](
+            const boost::system::error_code ec,
+            const dbus::utility::MapperGetSubTreePathsResponse& chassisList) {
             if (ec)
             {
                 BMCWEB_LOG_DEBUG << "[mapper] Bad D-Bus request error: " << ec;
diff --git a/redfish-core/lib/ethernet.hpp b/redfish-core/lib/ethernet.hpp
index 227b4e9..85fa633 100644
--- a/redfish-core/lib/ethernet.hpp
+++ b/redfish-core/lib/ethernet.hpp
@@ -16,7 +16,6 @@
 #pragma once
 
 #include <app.hpp>
-#include <boost/container/flat_map.hpp>
 #include <boost/container/flat_set.hpp>
 #include <dbus_singleton.hpp>
 #include <dbus_utility.hpp>
@@ -30,13 +29,6 @@
 namespace redfish
 {
 
-/**
- * DBus types primitives for several generic DBus interfaces
- * TODO(Pawel) consider move this to separate file into boost::dbus
- */
-using PropertiesMapType =
-    boost::container::flat_map<std::string, dbus::utility::DbusVariantType>;
-
 enum class LinkType
 {
     Local,
@@ -1713,7 +1705,7 @@
 
     crow::connections::systemBus->async_method_call(
         [health](const boost::system::error_code ec,
-                 const std::vector<std::string>& resp) {
+                 const dbus::utility::MapperGetSubTreePathsResponse& resp) {
             if (ec)
             {
                 return;
diff --git a/redfish-core/lib/health.hpp b/redfish-core/lib/health.hpp
index c2e40c7..31adf7b 100644
--- a/redfish-core/lib/health.hpp
+++ b/redfish-core/lib/health.hpp
@@ -189,7 +189,7 @@
         std::shared_ptr<HealthPopulate> self = shared_from_this();
         crow::connections::systemBus->async_method_call(
             [self](const boost::system::error_code ec,
-                   const std::vector<std::string>& resp) {
+                   const dbus::utility::MapperGetSubTreePathsResponse& resp) {
                 if (ec || resp.size() != 1)
                 {
                     // no global item, or too many
diff --git a/redfish-core/lib/hypervisor_system.hpp b/redfish-core/lib/hypervisor_system.hpp
index ba092c7..ed83ff6 100644
--- a/redfish-core/lib/hypervisor_system.hpp
+++ b/redfish-core/lib/hypervisor_system.hpp
@@ -1,7 +1,6 @@
 #pragma once
 
 #include <app.hpp>
-#include <boost/container/flat_map.hpp>
 #include <boost/container/flat_set.hpp>
 #include <dbus_singleton.hpp>
 #include <dbus_utility.hpp>
@@ -782,7 +781,8 @@
 
             crow::connections::systemBus->async_method_call(
                 [asyncResp](const boost::system::error_code error,
-                            const std::vector<std::string>& ifaceList) {
+                            const dbus::utility::MapperGetSubTreePathsResponse&
+                                ifaceList) {
                     if (error)
                     {
                         messages::resourceNotFound(asyncResp->res, "System",
diff --git a/redfish-core/lib/log_services.hpp b/redfish-core/lib/log_services.hpp
index 08765f2..e474f0a 100644
--- a/redfish-core/lib/log_services.hpp
+++ b/redfish-core/lib/log_services.hpp
@@ -103,9 +103,6 @@
 
 namespace fs = std::filesystem;
 
-using GetManagedPropertyType =
-    boost::container::flat_map<std::string, dbus::utility::DbusVariantType>;
-
 inline std::string translateSeverityDbusToRedfish(const std::string& s)
 {
     if ((s == "xyz.openbmc_project.Logging.Entry.Level.Alert") ||
@@ -733,10 +730,8 @@
                 taskData->state = "Cancelled";
                 return task::completed;
             }
-            std::vector<std::pair<
-                std::string, std::vector<std::pair<
-                                 std::string, dbus::utility::DbusVariantType>>>>
-                interfacesList;
+
+            dbus::utility::DBusInteracesMap interfacesList;
 
             sdbusplus::message::object_path objPath;
 
@@ -865,8 +860,9 @@
         std::string(boost::algorithm::to_lower_copy(dumpType));
 
     crow::connections::systemBus->async_method_call(
-        [asyncResp, dumpType](const boost::system::error_code ec,
-                              const std::vector<std::string>& subTreePaths) {
+        [asyncResp, dumpType](
+            const boost::system::error_code ec,
+            const dbus::utility::MapperGetSubTreePathsResponse& subTreePaths) {
             if (ec)
             {
                 BMCWEB_LOG_ERROR << "resp_handler got error " << ec;
@@ -893,10 +889,10 @@
                                    dumpType});
 }
 
-inline static void parseCrashdumpParameters(
-    const std::vector<std::pair<std::string, dbus::utility::DbusVariantType>>&
-        params,
-    std::string& filename, std::string& timestamp, std::string& logfile)
+inline static void
+    parseCrashdumpParameters(const dbus::utility::DBusPropertiesMap& params,
+                             std::string& filename, std::string& timestamp,
+                             std::string& logfile)
 {
     for (auto property : params)
     {
@@ -980,8 +976,10 @@
                     logServiceArray.size();
 
                 crow::connections::systemBus->async_method_call(
-                    [asyncResp](const boost::system::error_code ec,
-                                const std::vector<std::string>& subtreePath) {
+                    [asyncResp](
+                        const boost::system::error_code ec,
+                        const dbus::utility::MapperGetSubTreePathsResponse&
+                            subtreePath) {
                         if (ec)
                         {
                             BMCWEB_LOG_ERROR << ec;
@@ -1513,8 +1511,9 @@
                 // DBus implementation of EventLog/Entries
                 // Make call to Logging Service to find all log entry objects
                 crow::connections::systemBus->async_method_call(
-                    [asyncResp, entryID](const boost::system::error_code ec,
-                                         const GetManagedPropertyType& resp) {
+                    [asyncResp,
+                     entryID](const boost::system::error_code ec,
+                              const dbus::utility::DBusPropertiesMap& resp) {
                         if (ec.value() == EBADR)
                         {
                             messages::resourceNotFound(
@@ -2614,11 +2613,9 @@
                       const std::string& logID, nlohmann::json& logEntryJson)
 {
     auto getStoredLogCallback =
-        [asyncResp, logID, &logEntryJson](
-            const boost::system::error_code ec,
-            const std::vector<
-                std::pair<std::string, dbus::utility::DbusVariantType>>&
-                params) {
+        [asyncResp, logID,
+         &logEntryJson](const boost::system::error_code ec,
+                        const dbus::utility::DBusPropertiesMap& params) {
             if (ec)
             {
                 BMCWEB_LOG_DEBUG << "failed to get log ec: " << ec.message();
diff --git a/redfish-core/lib/managers.hpp b/redfish-core/lib/managers.hpp
index b0e2507..96b0d5d 100644
--- a/redfish-core/lib/managers.hpp
+++ b/redfish-core/lib/managers.hpp
@@ -748,9 +748,8 @@
     const std::shared_ptr<bmcweb::AsyncResp>& response, const std::string& type,
     const nlohmann::json::iterator& it, const std::string& path,
     const dbus::utility::ManagedObjectType& managedObj, bool createNewObject,
-    boost::container::flat_map<std::string, dbus::utility::DbusVariantType>&
-        output,
-    std::string& chassis, const std::string& profile)
+    dbus::utility::DBusPropertiesMap& output, std::string& chassis,
+    const std::string& profile)
 {
 
     // common deleter
@@ -814,7 +813,7 @@
     {
         if (managedItem == nullptr)
         {
-            output["Profiles"] = std::vector<std::string>{profile};
+            output.emplace_back("Profiles", std::vector<std::string>{profile});
         }
         else
         {
@@ -854,7 +853,7 @@
                                 std::vector<std::string> newProfiles =
                                     *curProfiles;
                                 newProfiles.push_back(profile);
-                                output["Profiles"] = newProfiles;
+                                output.emplace_back("Profiles", newProfiles);
                             }
                         }
                     }
@@ -875,9 +874,9 @@
     {
         if (createNewObject)
         {
-            output["Class"] = type == "PidControllers" ? std::string("temp")
-                                                       : std::string("fan");
-            output["Type"] = std::string("Pid");
+            output.emplace_back("Class",
+                                type == "PidControllers" ? "temp" : "fan");
+            output.emplace_back("Type", "Pid");
         }
 
         std::optional<std::vector<nlohmann::json>> zones;
@@ -922,8 +921,7 @@
                                        "redfish", "v1", "Chassis", chassis));
                 return CreatePIDRet::fail;
             }
-
-            output["Zones"] = std::move(zonesStr);
+            output.emplace_back("Zones", std::move(zonesStr));
         }
         if (inputs || outputs)
         {
@@ -953,7 +951,7 @@
                 {
                     key = "Outputs";
                 }
-                output[key] = *container;
+                output.emplace_back(key, *container);
                 index++;
             }
         }
@@ -963,19 +961,19 @@
             // translate between redfish and dbus names
             if (*setpointOffset == "UpperThresholdNonCritical")
             {
-                output["SetPointOffset"] = std::string("WarningLow");
+                output.emplace_back("SetPointOffset", "WarningLow");
             }
             else if (*setpointOffset == "LowerThresholdNonCritical")
             {
-                output["SetPointOffset"] = std::string("WarningHigh");
+                output.emplace_back("SetPointOffset", "WarningHigh");
             }
             else if (*setpointOffset == "LowerThresholdCritical")
             {
-                output["SetPointOffset"] = std::string("CriticalLow");
+                output.emplace_back("SetPointOffset", "CriticalLow");
             }
             else if (*setpointOffset == "UpperThresholdCritical")
             {
-                output["SetPointOffset"] = std::string("CriticalHigh");
+                output.emplace_back("SetPointOffset", "CriticalHigh");
             }
             else
             {
@@ -995,13 +993,13 @@
                 continue;
             }
             BMCWEB_LOG_DEBUG << pairs.first << " = " << *pairs.second;
-            output[pairs.first] = *(pairs.second);
+            output.emplace_back(pairs.first, *pairs.second);
         }
     }
 
     else if (type == "FanZones")
     {
-        output["Type"] = std::string("Pid.Zone");
+        output.emplace_back("Type", "Pid.Zone");
 
         std::optional<nlohmann::json> chassisContainer;
         std::optional<double> failSafePercent;
@@ -1045,16 +1043,16 @@
         }
         if (minThermalOutput)
         {
-            output["MinThermalOutput"] = *minThermalOutput;
+            output.emplace_back("MinThermalOutput", *minThermalOutput);
         }
         if (failSafePercent)
         {
-            output["FailSafePercent"] = *failSafePercent;
+            output.emplace_back("FailSafePercent", *failSafePercent);
         }
     }
     else if (type == "StepwiseControllers")
     {
-        output["Type"] = std::string("Stepwise");
+        output.emplace_back("Type", "Stepwise");
 
         std::optional<std::vector<nlohmann::json>> zones;
         std::optional<std::vector<nlohmann::json>> steps;
@@ -1092,7 +1090,7 @@
                                        "redfish", "v1", "Chassis", chassis));
                 return CreatePIDRet::fail;
             }
-            output["Zones"] = std::move(zonesStrs);
+            output.emplace_back("Zones", std::move(zonesStrs));
         }
         if (steps)
         {
@@ -1116,8 +1114,8 @@
                 readings.emplace_back(target);
                 outputs.emplace_back(out);
             }
-            output["Reading"] = std::move(readings);
-            output["Output"] = std::move(outputs);
+            output.emplace_back("Reading", std::move(readings));
+            output.emplace_back("Output", std::move(outputs));
         }
         if (inputs)
         {
@@ -1125,15 +1123,15 @@
             {
                 boost::replace_all(value, "_", " ");
             }
-            output["Inputs"] = std::move(*inputs);
+            output.emplace_back("Inputs", std::move(*inputs));
         }
         if (negativeHysteresis)
         {
-            output["NegativeHysteresis"] = *negativeHysteresis;
+            output.emplace_back("NegativeHysteresis", *negativeHysteresis);
         }
         if (positiveHysteresis)
         {
-            output["PositiveHysteresis"] = *positiveHysteresis;
+            output.emplace_back("PositiveHysteresis", *positiveHysteresis);
         }
         if (direction)
         {
@@ -1146,7 +1144,7 @@
                                                  *direction);
                 return CreatePIDRet::fail;
             }
-            output["Class"] = *direction;
+            output.emplace_back("Class", *direction);
         }
     }
     else
@@ -1171,8 +1169,9 @@
 
         // get all configurations
         crow::connections::systemBus->async_method_call(
-            [self](const boost::system::error_code ec,
-                   const crow::openbmc_mapper::GetSubTreeType& subtreeLocal) {
+            [self](
+                const boost::system::error_code ec,
+                const dbus::utility::MapperGetSubTreeResponse& subtreeLocal) {
                 if (ec)
                 {
                     BMCWEB_LOG_ERROR << ec;
@@ -1190,8 +1189,9 @@
 
         // at the same time get the selected profile
         crow::connections::systemBus->async_method_call(
-            [self](const boost::system::error_code ec,
-                   const crow::openbmc_mapper::GetSubTreeType& subtreeLocal) {
+            [self](
+                const boost::system::error_code ec,
+                const dbus::utility::MapperGetSubTreeResponse& subtreeLocal) {
                 if (ec || subtreeLocal.empty())
                 {
                     return;
@@ -1209,9 +1209,7 @@
                 crow::connections::systemBus->async_method_call(
                     [path, owner,
                      self](const boost::system::error_code ec2,
-                           const boost::container::flat_map<
-                               std::string, dbus::utility::DbusVariantType>&
-                               resp) {
+                           const dbus::utility::DBusPropertiesMap& resp) {
                         if (ec2)
                         {
                             BMCWEB_LOG_ERROR
@@ -1332,7 +1330,7 @@
 
     std::vector<std::string> supportedProfiles;
     std::string currentProfile;
-    crow::openbmc_mapper::GetSubTreeType subtree;
+    dbus::utility::MapperGetSubTreeResponse subtree;
     std::shared_ptr<bmcweb::AsyncResp> asyncResp;
 };
 
@@ -1417,7 +1415,7 @@
         // at the same time get the profile information
         crow::connections::systemBus->async_method_call(
             [self](const boost::system::error_code ec,
-                   const crow::openbmc_mapper::GetSubTreeType& subtree) {
+                   const dbus::utility::MapperGetSubTreeResponse& subtree) {
                 if (ec || subtree.empty())
                 {
                     return;
@@ -1433,10 +1431,9 @@
                 const std::string& path = subtree[0].first;
                 const std::string& owner = subtree[0].second[0].first;
                 crow::connections::systemBus->async_method_call(
-                    [self, path, owner](
-                        const boost::system::error_code ec2,
-                        const boost::container::flat_map<
-                            std::string, dbus::utility::DbusVariantType>& r) {
+                    [self, path,
+                     owner](const boost::system::error_code ec2,
+                            const dbus::utility::DBusPropertiesMap& r) {
                         if (ec2)
                         {
                             BMCWEB_LOG_ERROR
@@ -1552,9 +1549,7 @@
                                      return boost::algorithm::ends_with(
                                          obj.first.str, "/" + name);
                                  });
-                boost::container::flat_map<std::string,
-                                           dbus::utility::DbusVariantType>
-                    output;
+                dbus::utility::DBusPropertiesMap output;
 
                 output.reserve(16); // The pid interface length
 
@@ -1620,8 +1615,8 @@
                     messages::resourceExhaustion(response->res, type);
                     continue;
                 }
-
-                output["Name"] = boost::replace_all_copy(name, "_", " ");
+                output.emplace_back("Name",
+                                    boost::replace_all_copy(name, "_", " "));
 
                 std::string chassis;
                 CreatePIDRet ret = createPidInterface(
@@ -2099,11 +2094,7 @@
             crow::connections::systemBus->async_method_call(
                 [asyncResp](
                     const boost::system::error_code ec,
-                    const std::vector<
-                        std::pair<std::string,
-                                  std::vector<std::pair<
-                                      std::string, std::vector<std::string>>>>>&
-                        subtree) {
+                    const dbus::utility::MapperGetSubTreeResponse& subtree) {
                     if (ec)
                     {
                         BMCWEB_LOG_DEBUG
@@ -2146,9 +2137,7 @@
                             crow::connections::systemBus->async_method_call(
                                 [asyncResp](
                                     const boost::system::error_code ec,
-                                    const std::vector<std::pair<
-                                        std::string,
-                                        dbus::utility::DbusVariantType>>&
+                                    const dbus::utility::DBusPropertiesMap&
                                         propertiesList) {
                                     if (ec)
                                     {
diff --git a/redfish-core/lib/memory.hpp b/redfish-core/lib/memory.hpp
index 73d739a..d3bbc07 100644
--- a/redfish-core/lib/memory.hpp
+++ b/redfish-core/lib/memory.hpp
@@ -18,7 +18,6 @@
 #include "health.hpp"
 
 #include <app.hpp>
-#include <boost/container/flat_map.hpp>
 #include <dbus_utility.hpp>
 #include <registries/privilege_registry.hpp>
 #include <utils/collection.hpp>
@@ -28,9 +27,6 @@
 namespace redfish
 {
 
-using DimmProperties =
-    boost::container::flat_map<std::string, dbus::utility::DbusVariantType>;
-
 inline std::string translateMemoryTypeToRedfish(const std::string& memoryType)
 {
     if (memoryType == "xyz.openbmc_project.Inventory.Item.Dimm.DeviceType.DDR")
@@ -440,31 +436,17 @@
 
     BMCWEB_LOG_DEBUG << "Get available system components.";
     crow::connections::systemBus->async_method_call(
-        [dimmId, aResp{std::move(aResp)}](const boost::system::error_code ec,
-                                          const DimmProperties& properties) {
+        [dimmId, aResp{std::move(aResp)}](
+            const boost::system::error_code ec,
+            const dbus::utility::DBusPropertiesMap& properties) {
             if (ec)
             {
                 BMCWEB_LOG_DEBUG << "DBUS response error";
                 messages::internalError(aResp->res);
-
                 return;
             }
             aResp->res.jsonValue["Id"] = dimmId;
             aResp->res.jsonValue["Name"] = "DIMM Slot";
-
-            const auto memorySizeProperty = properties.find("MemorySizeInKB");
-            if (memorySizeProperty != properties.end())
-            {
-                const uint32_t* memorySize =
-                    std::get_if<uint32_t>(&memorySizeProperty->second);
-                if (memorySize == nullptr)
-                {
-                    // Important property not in desired type
-                    messages::internalError(aResp->res);
-                    return;
-                }
-                aResp->res.jsonValue["CapacityMiB"] = (*memorySize >> 10);
-            }
             aResp->res.jsonValue["Status"]["State"] = "Enabled";
             aResp->res.jsonValue["Status"]["Health"] = "OK";
 
@@ -480,6 +462,18 @@
                     }
                     aResp->res.jsonValue["DataWidthBits"] = *value;
                 }
+                else if (property.first == "MemorySizeInKB")
+                {
+                    const uint32_t* memorySize =
+                        std::get_if<uint32_t>(&property.second);
+                    if (memorySize == nullptr)
+                    {
+                        // Important property not in desired type
+                        messages::internalError(aResp->res);
+                        return;
+                    }
+                    aResp->res.jsonValue["CapacityMiB"] = (*memorySize >> 10);
+                }
                 else if (property.first == "PartNumber")
                 {
                     const std::string* value =
@@ -731,8 +725,7 @@
     crow::connections::systemBus->async_method_call(
         [aResp{std::move(aResp)}](
             const boost::system::error_code ec,
-            const boost::container::flat_map<
-                std::string, dbus::utility::DbusVariantType>& properties) {
+            const dbus::utility::DBusPropertiesMap& properties) {
             if (ec)
             {
                 BMCWEB_LOG_DEBUG << "DBUS response error";
@@ -814,10 +807,7 @@
     crow::connections::systemBus->async_method_call(
         [dimmId, aResp{std::move(aResp)}](
             const boost::system::error_code ec,
-            const boost::container::flat_map<
-                std::string, boost::container::flat_map<
-                                 std::string, std::vector<std::string>>>&
-                subtree) {
+            const dbus::utility::MapperGetSubTreeResponse& subtree) {
             if (ec)
             {
                 BMCWEB_LOG_DEBUG << "DBUS response error";
@@ -832,26 +822,26 @@
                 {
                     for (const auto& [service, interfaces] : object)
                     {
-                        if (!found &&
-                            (std::find(
-                                 interfaces.begin(), interfaces.end(),
-                                 "xyz.openbmc_project.Inventory.Item.Dimm") !=
-                             interfaces.end()))
+                        for (const auto& interface : interfaces)
                         {
-                            getDimmDataByService(aResp, dimmId, service, path);
-                            found = true;
-                        }
+                            if (interface ==
+                                "xyz.openbmc_project.Inventory.Item.Dimm")
+                            {
+                                getDimmDataByService(aResp, dimmId, service,
+                                                     path);
+                                found = true;
+                            }
 
-                        // partitions are separate as there can be multiple per
-                        // device, i.e.
-                        // /xyz/openbmc_project/Inventory/Item/Dimm1/Partition1
-                        // /xyz/openbmc_project/Inventory/Item/Dimm1/Partition2
-                        if (std::find(
-                                interfaces.begin(), interfaces.end(),
-                                "xyz.openbmc_project.Inventory.Item.PersistentMemory.Partition") !=
-                            interfaces.end())
-                        {
-                            getDimmPartitionData(aResp, service, path);
+                            // partitions are separate as there can be multiple
+                            // per
+                            // device, i.e.
+                            // /xyz/openbmc_project/Inventory/Item/Dimm1/Partition1
+                            // /xyz/openbmc_project/Inventory/Item/Dimm1/Partition2
+                            if (interface ==
+                                "xyz.openbmc_project.Inventory.Item.PersistentMemory.Partition")
+                            {
+                                getDimmPartitionData(aResp, service, path);
+                            }
                         }
                     }
                 }
diff --git a/redfish-core/lib/metric_report_definition.hpp b/redfish-core/lib/metric_report_definition.hpp
index ab7c88b..a27ec6b 100644
--- a/redfish-core/lib/metric_report_definition.hpp
+++ b/redfish-core/lib/metric_report_definition.hpp
@@ -22,10 +22,10 @@
     std::vector<std::tuple<sdbusplus::message::object_path, std::string,
                            std::string, std::string>>;
 
-inline void fillReportDefinition(
-    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp, const std::string& id,
-    const std::vector<std::pair<std::string, dbus::utility::DbusVariantType>>&
-        ret)
+inline void
+    fillReportDefinition(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+                         const std::string& id,
+                         const dbus::utility::DBusPropertiesMap& ret)
 {
     asyncResp->res.jsonValue["@odata.type"] =
         "#MetricReportDefinition.v1_3_0.MetricReportDefinition";
diff --git a/redfish-core/lib/network_protocol.hpp b/redfish-core/lib/network_protocol.hpp
index e221d96..aac7f66 100644
--- a/redfish-core/lib/network_protocol.hpp
+++ b/redfish-core/lib/network_protocol.hpp
@@ -253,7 +253,7 @@
     crow::connections::systemBus->async_method_call(
         [asyncResp,
          ntpServers](boost::system::error_code ec,
-                     const crow::openbmc_mapper::GetSubTreeType& subtree) {
+                     const dbus::utility::MapperGetSubTreeResponse& subtree) {
             if (ec)
             {
                 BMCWEB_LOG_WARNING << "D-Bus error: " << ec << ", "
@@ -306,7 +306,7 @@
     crow::connections::systemBus->async_method_call(
         [protocolEnabled, asyncResp,
          netBasePath](const boost::system::error_code ec,
-                      const crow::openbmc_mapper::GetSubTreeType& subtree) {
+                      const dbus::utility::MapperGetSubTreeResponse& subtree) {
             if (ec)
             {
                 messages::internalError(asyncResp->res);
diff --git a/redfish-core/lib/pcie.hpp b/redfish-core/lib/pcie.hpp
index 3c083ae..ca1eb8f 100644
--- a/redfish-core/lib/pcie.hpp
+++ b/redfish-core/lib/pcie.hpp
@@ -33,37 +33,39 @@
     getPCIeDeviceList(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
                       const std::string& name)
 {
-    auto getPCIeMapCallback = [asyncResp, name](
-                                  const boost::system::error_code ec,
-                                  std::vector<std::string>& pcieDevicePaths) {
-        if (ec)
-        {
-            BMCWEB_LOG_DEBUG << "no PCIe device paths found ec: "
-                             << ec.message();
-            // Not an error, system just doesn't have PCIe info
-            return;
-        }
-        nlohmann::json& pcieDeviceList = asyncResp->res.jsonValue[name];
-        pcieDeviceList = nlohmann::json::array();
-        for (const std::string& pcieDevicePath : pcieDevicePaths)
-        {
-            size_t devStart = pcieDevicePath.rfind('/');
-            if (devStart == std::string::npos)
+    auto getPCIeMapCallback =
+        [asyncResp, name](const boost::system::error_code ec,
+                          const dbus::utility::MapperGetSubTreePathsResponse&
+                              pcieDevicePaths) {
+            if (ec)
             {
-                continue;
+                BMCWEB_LOG_DEBUG << "no PCIe device paths found ec: "
+                                 << ec.message();
+                // Not an error, system just doesn't have PCIe info
+                return;
             }
+            nlohmann::json& pcieDeviceList = asyncResp->res.jsonValue[name];
+            pcieDeviceList = nlohmann::json::array();
+            for (const std::string& pcieDevicePath : pcieDevicePaths)
+            {
+                size_t devStart = pcieDevicePath.rfind('/');
+                if (devStart == std::string::npos)
+                {
+                    continue;
+                }
 
-            std::string devName = pcieDevicePath.substr(devStart + 1);
-            if (devName.empty())
-            {
-                continue;
+                std::string devName = pcieDevicePath.substr(devStart + 1);
+                if (devName.empty())
+                {
+                    continue;
+                }
+                pcieDeviceList.push_back(
+                    {{"@odata.id",
+                      "/redfish/v1/Systems/system/PCIeDevices/" + devName}});
             }
-            pcieDeviceList.push_back(
-                {{"@odata.id",
-                  "/redfish/v1/Systems/system/PCIeDevices/" + devName}});
-        }
-        asyncResp->res.jsonValue[name + "@odata.count"] = pcieDeviceList.size();
-    };
+            asyncResp->res.jsonValue[name + "@odata.count"] =
+                pcieDeviceList.size();
+        };
     crow::connections::systemBus->async_method_call(
         std::move(getPCIeMapCallback), "xyz.openbmc_project.ObjectMapper",
         "/xyz/openbmc_project/object_mapper",
@@ -145,11 +147,9 @@
 
             {
                 auto getPCIeDeviceCallback =
-                    [asyncResp,
-                     device](const boost::system::error_code ec,
-                             boost::container::flat_map<
-                                 std::string, dbus::utility::DbusVariantType>&
-                                 pcieDevProperties) {
+                    [asyncResp, device](const boost::system::error_code ec,
+                                        const dbus::utility::DBusPropertiesMap&
+                                            pcieDevProperties) {
                         if (ec)
                         {
                             BMCWEB_LOG_DEBUG
@@ -175,61 +175,69 @@
                                  device},
                             {"Name", "PCIe Device"},
                             {"Id", device}};
-
-                        if (std::string* property = std::get_if<std::string>(
-                                &pcieDevProperties["Manufacturer"]);
-                            property)
-                        {
-                            asyncResp->res.jsonValue["Manufacturer"] =
-                                *property;
-                        }
-
-                        if (std::string* property = std::get_if<std::string>(
-                                &pcieDevProperties["DeviceType"]);
-                            property)
-                        {
-                            asyncResp->res.jsonValue["DeviceType"] = *property;
-                        }
-
-                        if (std::string* property = std::get_if<std::string>(
-                                &pcieDevProperties["Manufacturer"]);
-                            property)
-                        {
-                            asyncResp->res.jsonValue["Manufacturer"] =
-                                *property;
-                        }
-
-                        if (std::string* property = std::get_if<std::string>(
-                                &pcieDevProperties["DeviceType"]);
-                            property)
-                        {
-                            asyncResp->res.jsonValue["DeviceType"] = *property;
-                        }
-
-                        if (std::string* property = std::get_if<std::string>(
-                                &pcieDevProperties["GenerationInUse"]);
-                            property)
-                        {
-                            std::optional<std::string> generationInUse =
-                                redfishPcieGenerationFromDbus(*property);
-                            if (!generationInUse)
-                            {
-                                messages::internalError(asyncResp->res);
-                                return;
-                            }
-                            if (generationInUse->empty())
-                            {
-                                // unknown, no need to handle
-                                return;
-                            }
-                            asyncResp->res
-                                .jsonValue["PCIeInterface"]["PCIeType"] =
-                                *generationInUse;
-                        }
                         asyncResp->res.jsonValue["PCIeFunctions"] = {
                             {"@odata.id",
                              "/redfish/v1/Systems/system/PCIeDevices/" +
                                  device + "/PCIeFunctions"}};
+                        for (const auto& property : pcieDevProperties)
+                        {
+                            const std::string* propertyString =
+                                std::get_if<std::string>(&property.second);
+                            if (property.first == "Manufacturer")
+                            {
+                                if (propertyString == nullptr)
+                                {
+                                    messages::internalError(asyncResp->res);
+                                    return;
+                                }
+                                asyncResp->res.jsonValue["Manufacturer"] =
+                                    *propertyString;
+                            }
+                            if (property.first == "DeviceType")
+                            {
+                                if (propertyString == nullptr)
+                                {
+                                    messages::internalError(asyncResp->res);
+                                    return;
+                                }
+                                asyncResp->res.jsonValue["DeviceType"] =
+                                    *propertyString;
+                            }
+                            if (property.first == "DeviceType")
+                            {
+                                if (propertyString == nullptr)
+                                {
+                                    messages::internalError(asyncResp->res);
+                                    return;
+                                }
+                                asyncResp->res.jsonValue["DeviceType"] =
+                                    *propertyString;
+                            }
+                            if (property.first == "GenerationInUse")
+                            {
+                                if (propertyString == nullptr)
+                                {
+                                    messages::internalError(asyncResp->res);
+                                    return;
+                                }
+                                std::optional<std::string> generationInUse =
+                                    redfishPcieGenerationFromDbus(
+                                        *propertyString);
+                                if (!generationInUse)
+                                {
+                                    messages::internalError(asyncResp->res);
+                                    return;
+                                }
+                                if (generationInUse->empty())
+                                {
+                                    // unknown, no need to handle
+                                    return;
+                                }
+                                asyncResp->res
+                                    .jsonValue["PCIeInterface"]["PCIeType"] =
+                                    *generationInUse;
+                            }
+                        }
                     };
                 std::string escapedPath = std::string(pciePath) + "/" + device;
                 dbus::utility::escapePathForDbus(escapedPath);
@@ -263,58 +271,62 @@
                     {"Description",
                      "Collection of PCIe Functions for PCIe Device " + device}};
 
-                auto getPCIeDeviceCallback = [asyncResp, device](
-                                                 const boost::system::error_code
-                                                     ec,
-                                                 boost::container::flat_map<
-                                                     std::string,
-                                                     dbus::utility::
-                                                         DbusVariantType>&
-                                                     pcieDevProperties) {
-                    if (ec)
-                    {
-                        BMCWEB_LOG_DEBUG
-                            << "failed to get PCIe Device properties ec: "
-                            << ec.value() << ": " << ec.message();
-                        if (ec.value() ==
-                            boost::system::linux_error::bad_request_descriptor)
+                auto getPCIeDeviceCallback =
+                    [asyncResp, device](const boost::system::error_code ec,
+                                        const dbus::utility::DBusPropertiesMap&
+                                            pcieDevProperties) {
+                        if (ec)
                         {
-                            messages::resourceNotFound(asyncResp->res,
-                                                       "PCIeDevice", device);
+                            BMCWEB_LOG_DEBUG
+                                << "failed to get PCIe Device properties ec: "
+                                << ec.value() << ": " << ec.message();
+                            if (ec.value() == boost::system::linux_error::
+                                                  bad_request_descriptor)
+                            {
+                                messages::resourceNotFound(
+                                    asyncResp->res, "PCIeDevice", device);
+                            }
+                            else
+                            {
+                                messages::internalError(asyncResp->res);
+                            }
+                            return;
                         }
-                        else
-                        {
-                            messages::internalError(asyncResp->res);
-                        }
-                        return;
-                    }
 
-                    nlohmann::json& pcieFunctionList =
-                        asyncResp->res.jsonValue["Members"];
-                    pcieFunctionList = nlohmann::json::array();
-                    static constexpr const int maxPciFunctionNum = 8;
-                    for (int functionNum = 0; functionNum < maxPciFunctionNum;
-                         functionNum++)
-                    {
-                        // Check if this function exists by looking for a device
-                        // ID
-                        std::string devIDProperty =
-                            "Function" + std::to_string(functionNum) +
-                            "DeviceId";
-                        std::string* property = std::get_if<std::string>(
-                            &pcieDevProperties[devIDProperty]);
-                        if (property != nullptr && !property->empty())
+                        nlohmann::json& pcieFunctionList =
+                            asyncResp->res.jsonValue["Members"];
+                        pcieFunctionList = nlohmann::json::array();
+                        static constexpr const int maxPciFunctionNum = 8;
+                        for (int functionNum = 0;
+                             functionNum < maxPciFunctionNum; functionNum++)
                         {
+                            // Check if this function exists by looking for a
+                            // device ID
+                            std::string devIDProperty =
+                                "Function" + std::to_string(functionNum) +
+                                "DeviceId";
+                            const std::string* property = nullptr;
+                            for (const auto& propEntry : pcieDevProperties)
+                            {
+                                if (propEntry.first == devIDProperty)
+                                {
+                                    property = std::get_if<std::string>(
+                                        &propEntry.second);
+                                }
+                            }
+                            if (property == nullptr || !property->empty())
+                            {
+                                return;
+                            }
                             pcieFunctionList.push_back(
                                 {{"@odata.id",
                                   "/redfish/v1/Systems/system/PCIeDevices/" +
                                       device + "/PCIeFunctions/" +
                                       std::to_string(functionNum)}});
                         }
-                    }
-                    asyncResp->res.jsonValue["Members@odata.count"] =
-                        pcieFunctionList.size();
-                };
+                        asyncResp->res.jsonValue["Members@odata.count"] =
+                            pcieFunctionList.size();
+                    };
                 std::string escapedPath = std::string(pciePath) + "/" + device;
                 dbus::utility::escapePathForDbus(escapedPath);
                 crow::connections::systemBus->async_method_call(
@@ -339,9 +351,7 @@
             auto getPCIeDeviceCallback =
                 [asyncResp, device, function](
                     const boost::system::error_code ec,
-                    boost::container::flat_map<std::string,
-                                               dbus::utility::DbusVariantType>&
-                        pcieDevProperties) {
+                    const dbus::utility::DBusPropertiesMap& pcieDevProperties) {
                     if (ec)
                     {
                         BMCWEB_LOG_DEBUG
@@ -361,11 +371,20 @@
                     }
 
                     // Check if this function exists by looking for a device ID
-                    std::string devIDProperty =
-                        "Function" + function + "DeviceId";
-                    if (std::string* property = std::get_if<std::string>(
-                            &pcieDevProperties[devIDProperty]);
-                        property != nullptr && property->empty())
+                    std::string functionName = "Function" + function;
+                    std::string devIDProperty = functionName + "DeviceId";
+
+                    const std::string* devIdProperty = nullptr;
+                    for (const auto& property : pcieDevProperties)
+                    {
+                        if (property.first == devIDProperty)
+                        {
+                            devIdProperty =
+                                std::get_if<std::string>(&property.second);
+                            continue;
+                        }
+                    }
+                    if (devIdProperty == nullptr || !devIdProperty->empty())
                     {
                         messages::resourceNotFound(asyncResp->res,
                                                    "PCIeFunction", function);
@@ -386,69 +405,49 @@
                              "/redfish/v1/Systems/system/PCIeDevices/" +
                                  device}}}}}};
 
-                    if (std::string* property = std::get_if<std::string>(
-                            &pcieDevProperties["Function" + function +
-                                               "DeviceId"]);
-                        property)
+                    for (const auto& property : pcieDevProperties)
                     {
-                        asyncResp->res.jsonValue["DeviceId"] = *property;
-                    }
-
-                    if (std::string* property = std::get_if<std::string>(
-                            &pcieDevProperties["Function" + function +
-                                               "VendorId"]);
-                        property)
-                    {
-                        asyncResp->res.jsonValue["VendorId"] = *property;
-                    }
-
-                    if (std::string* property = std::get_if<std::string>(
-                            &pcieDevProperties["Function" + function +
-                                               "FunctionType"]);
-                        property)
-                    {
-                        asyncResp->res.jsonValue["FunctionType"] = *property;
-                    }
-
-                    if (std::string* property = std::get_if<std::string>(
-                            &pcieDevProperties["Function" + function +
-                                               "DeviceClass"]);
-                        property)
-                    {
-                        asyncResp->res.jsonValue["DeviceClass"] = *property;
-                    }
-
-                    if (std::string* property = std::get_if<std::string>(
-                            &pcieDevProperties["Function" + function +
-                                               "ClassCode"]);
-                        property)
-                    {
-                        asyncResp->res.jsonValue["ClassCode"] = *property;
-                    }
-
-                    if (std::string* property = std::get_if<std::string>(
-                            &pcieDevProperties["Function" + function +
-                                               "RevisionId"]);
-                        property)
-                    {
-                        asyncResp->res.jsonValue["RevisionId"] = *property;
-                    }
-
-                    if (std::string* property = std::get_if<std::string>(
-                            &pcieDevProperties["Function" + function +
-                                               "SubsystemId"]);
-                        property)
-                    {
-                        asyncResp->res.jsonValue["SubsystemId"] = *property;
-                    }
-
-                    if (std::string* property = std::get_if<std::string>(
-                            &pcieDevProperties["Function" + function +
-                                               "SubsystemVendorId"]);
-                        property)
-                    {
-                        asyncResp->res.jsonValue["SubsystemVendorId"] =
-                            *property;
+                        const std::string* strProperty =
+                            std::get_if<std::string>(&property.second);
+                        if (property.first == functionName + "DeviceId")
+                        {
+                            asyncResp->res.jsonValue["DeviceId"] = *strProperty;
+                        }
+                        if (property.first == functionName + "VendorId")
+                        {
+                            asyncResp->res.jsonValue["VendorId"] = *strProperty;
+                        }
+                        if (property.first == functionName + "FunctionType")
+                        {
+                            asyncResp->res.jsonValue["FunctionType"] =
+                                *strProperty;
+                        }
+                        if (property.first == functionName + "DeviceClass")
+                        {
+                            asyncResp->res.jsonValue["DeviceClass"] =
+                                *strProperty;
+                        }
+                        if (property.first == functionName + "ClassCode")
+                        {
+                            asyncResp->res.jsonValue["ClassCode"] =
+                                *strProperty;
+                        }
+                        if (property.first == functionName + "RevisionId")
+                        {
+                            asyncResp->res.jsonValue["RevisionId"] =
+                                *strProperty;
+                        }
+                        if (property.first == functionName + "SubsystemId")
+                        {
+                            asyncResp->res.jsonValue["SubsystemId"] =
+                                *strProperty;
+                        }
+                        if (property.first ==
+                            functionName + "SubsystemVendorId")
+                        {
+                            asyncResp->res.jsonValue["SubsystemVendorId"] =
+                                *strProperty;
+                        }
                     }
                 };
             std::string escapedPath = std::string(pciePath) + "/" + device;
diff --git a/redfish-core/lib/power.hpp b/redfish-core/lib/power.hpp
index eaf7e6c..dd67aea 100644
--- a/redfish-core/lib/power.hpp
+++ b/redfish-core/lib/power.hpp
@@ -136,10 +136,11 @@
             // for the chassis that implements the Chassis inventory item.
             // This prevents things like power supplies providing the
             // chassis power limit
+
+            using Mapper = dbus::utility::MapperGetSubTreePathsResponse;
             auto chassisHandler = [sensorAsyncResp](
                                       const boost::system::error_code e,
-                                      const std::vector<std::string>&
-                                          chassisPaths) {
+                                      const Mapper& chassisPaths) {
                 if (e)
                 {
                     BMCWEB_LOG_ERROR
@@ -189,9 +190,7 @@
                 auto valueHandler =
                     [sensorAsyncResp](
                         const boost::system::error_code ec,
-                        const std::vector<std::pair<
-                            std::string, dbus::utility::DbusVariantType>>&
-                            properties) {
+                        const dbus::utility::DBusPropertiesMap& properties) {
                         if (ec)
                         {
                             messages::internalError(
diff --git a/redfish-core/lib/processor.hpp b/redfish-core/lib/processor.hpp
index b74b05c..f304eb8 100644
--- a/redfish-core/lib/processor.hpp
+++ b/redfish-core/lib/processor.hpp
@@ -32,10 +32,6 @@
 namespace redfish
 {
 
-using InterfacesProperties = boost::container::flat_map<
-    std::string,
-    boost::container::flat_map<std::string, dbus::utility::DbusVariantType>>;
-
 // Interfaces which imply a D-Bus object represents a Processor
 constexpr std::array<const char*, 2> processorInterfaces = {
     "xyz.openbmc_project.Inventory.Item.Cpu",
@@ -1072,8 +1068,10 @@
             // First find the matching CPU object so we know how to
             // constrain our search for related Config objects.
             crow::connections::systemBus->async_method_call(
-                [asyncResp, cpuName](const boost::system::error_code ec,
-                                     const std::vector<std::string>& objects) {
+                [asyncResp,
+                 cpuName](const boost::system::error_code ec,
+                          const dbus::utility::MapperGetSubTreePathsResponse&
+                              objects) {
                     if (ec)
                     {
                         BMCWEB_LOG_WARNING << "D-Bus error: " << ec << ", "
diff --git a/redfish-core/lib/redfish_util.hpp b/redfish-core/lib/redfish_util.hpp
index a42d00d..7af4ab8 100644
--- a/redfish-core/lib/redfish_util.hpp
+++ b/redfish-core/lib/redfish_util.hpp
@@ -56,7 +56,7 @@
     crow::connections::systemBus->async_method_call(
         [callback,
          asyncResp](const boost::system::error_code ec,
-                    const crow::openbmc_mapper::GetSubTreeType& subtree) {
+                    const dbus::utility::MapperGetSubTreeResponse& subtree) {
             if (ec)
             {
                 BMCWEB_LOG_ERROR << ec;
diff --git a/redfish-core/lib/sensors.hpp b/redfish-core/lib/sensors.hpp
index 3139635..d501b70 100644
--- a/redfish-core/lib/sensors.hpp
+++ b/redfish-core/lib/sensors.hpp
@@ -33,16 +33,6 @@
 namespace redfish
 {
 
-using GetSubTreeType = std::vector<
-    std::pair<std::string,
-              std::vector<std::pair<std::string, std::vector<std::string>>>>>;
-
-using ManagedObjectsVectorType = std::vector<std::pair<
-    sdbusplus::message::object_path,
-    boost::container::flat_map<
-        std::string, boost::container::flat_map<
-                         std::string, dbus::utility::DbusVariantType>>>>;
-
 namespace sensors
 {
 namespace node
@@ -329,9 +319,10 @@
 
     // Response handler for parsing objects subtree
     auto respHandler = [callback{std::forward<Callback>(callback)},
-                        sensorsAsyncResp,
-                        sensorNames](const boost::system::error_code ec,
-                                     const GetSubTreeType& subtree) {
+                        sensorsAsyncResp, sensorNames](
+                           const boost::system::error_code ec,
+                           const dbus::utility::MapperGetSubTreeResponse&
+                               subtree) {
         BMCWEB_LOG_DEBUG << "getObjectsWithConnection resp_handler enter";
         if (ec)
         {
@@ -467,38 +458,38 @@
         "xyz.openbmc_project.Inventory.Item.Board",
         "xyz.openbmc_project.Inventory.Item.Chassis"};
 
-    auto respHandler =
-        [callback{std::forward<Callback>(callback)},
-         asyncResp](const boost::system::error_code ec,
-                    const std::vector<std::string>& chassisPaths) mutable {
-            BMCWEB_LOG_DEBUG << "getValidChassisPath respHandler enter";
-            if (ec)
-            {
-                BMCWEB_LOG_ERROR
-                    << "getValidChassisPath respHandler DBUS error: " << ec;
-                messages::internalError(asyncResp->asyncResp->res);
-                return;
-            }
+    auto respHandler = [callback{std::forward<Callback>(callback)}, asyncResp](
+                           const boost::system::error_code ec,
+                           const dbus::utility::MapperGetSubTreePathsResponse&
+                               chassisPaths) mutable {
+        BMCWEB_LOG_DEBUG << "getValidChassisPath respHandler enter";
+        if (ec)
+        {
+            BMCWEB_LOG_ERROR << "getValidChassisPath respHandler DBUS error: "
+                             << ec;
+            messages::internalError(asyncResp->asyncResp->res);
+            return;
+        }
 
-            std::optional<std::string> chassisPath;
-            std::string chassisName;
-            for (const std::string& chassis : chassisPaths)
+        std::optional<std::string> chassisPath;
+        std::string chassisName;
+        for (const std::string& chassis : chassisPaths)
+        {
+            sdbusplus::message::object_path path(chassis);
+            chassisName = path.filename();
+            if (chassisName.empty())
             {
-                sdbusplus::message::object_path path(chassis);
-                chassisName = path.filename();
-                if (chassisName.empty())
-                {
-                    BMCWEB_LOG_ERROR << "Failed to find '/' in " << chassis;
-                    continue;
-                }
-                if (chassisName == asyncResp->chassisId)
-                {
-                    chassisPath = chassis;
-                    break;
-                }
+                BMCWEB_LOG_ERROR << "Failed to find '/' in " << chassis;
+                continue;
             }
-            callback(chassisPath);
-        };
+            if (chassisName == asyncResp->chassisId)
+            {
+                chassisPath = chassis;
+                break;
+            }
+        }
+        callback(chassisPath);
+    };
 
     // Get the Chassis Collection
     crow::connections::systemBus->async_method_call(
@@ -525,7 +516,8 @@
     auto respHandler = [callback{std::forward<Callback>(callback)},
                         sensorsAsyncResp](
                            const boost::system::error_code ec,
-                           const std::vector<std::string>& chassisPaths) {
+                           const dbus::utility::MapperGetSubTreePathsResponse&
+                               chassisPaths) {
         BMCWEB_LOG_DEBUG << "getChassis respHandler enter";
         if (ec)
         {
@@ -658,8 +650,10 @@
 
     // Response handler for GetSubTree DBus method
     auto respHandler = [callback{std::forward<Callback>(callback)},
-                        sensorsAsyncResp](const boost::system::error_code ec,
-                                          const GetSubTreeType& subtree) {
+                        sensorsAsyncResp](
+                           const boost::system::error_code ec,
+                           const dbus::utility::MapperGetSubTreeResponse&
+                               subtree) {
         BMCWEB_LOG_DEBUG << "getObjectManagerPaths respHandler enter";
         if (ec)
         {
@@ -1119,8 +1113,9 @@
     const std::shared_ptr<SensorsAsyncResp>& sensorsAsyncResp)
 {
     crow::connections::systemBus->async_method_call(
-        [sensorsAsyncResp](const boost::system::error_code ec,
-                           const GetSubTreeType& resp) {
+        [sensorsAsyncResp](
+            const boost::system::error_code ec,
+            const dbus::utility::MapperGetSubTreeResponse& resp) {
             if (ec)
             {
                 return; // don't have to have this interface
@@ -1699,9 +1694,10 @@
 
     // Response handler for parsing output from GetSubTree
     auto respHandler = [callback{std::forward<Callback>(callback)},
-                        sensorsAsyncResp,
-                        inventoryItems](const boost::system::error_code ec,
-                                        const GetSubTreeType& subtree) {
+                        sensorsAsyncResp, inventoryItems](
+                           const boost::system::error_code ec,
+                           const dbus::utility::MapperGetSubTreeResponse&
+                               subtree) {
         BMCWEB_LOG_DEBUG << "getInventoryItemsConnections respHandler enter";
         if (ec)
         {
@@ -2054,9 +2050,10 @@
 
     // Response handler for parsing output from GetSubTree
     auto respHandler = [callback{std::forward<Callback>(callback)},
-                        sensorsAsyncResp,
-                        inventoryItems](const boost::system::error_code ec,
-                                        const GetSubTreeType& subtree) {
+                        sensorsAsyncResp, inventoryItems](
+                           const boost::system::error_code ec,
+                           const dbus::utility::MapperGetSubTreeResponse&
+                               subtree) {
         BMCWEB_LOG_DEBUG << "getInventoryLeds respHandler enter";
         if (ec)
         {
@@ -2231,57 +2228,58 @@
         "xyz.openbmc_project.Control.PowerSupplyAttributes"};
 
     // Response handler for parsing output from GetSubTree
-    auto respHandler = [callback{std::forward<Callback>(callback)},
-                        sensorsAsyncResp,
-                        inventoryItems](const boost::system::error_code ec,
-                                        const GetSubTreeType& subtree) {
-        BMCWEB_LOG_DEBUG << "getPowerSupplyAttributes respHandler enter";
-        if (ec)
-        {
-            messages::internalError(sensorsAsyncResp->asyncResp->res);
-            BMCWEB_LOG_ERROR
-                << "getPowerSupplyAttributes respHandler DBus error " << ec;
-            return;
-        }
-        if (subtree.empty())
-        {
-            BMCWEB_LOG_DEBUG << "Can't find Power Supply Attributes!";
-            callback(inventoryItems);
-            return;
-        }
+    auto respHandler =
+        [callback{std::forward<Callback>(callback)}, sensorsAsyncResp,
+         inventoryItems](
+            const boost::system::error_code ec,
+            const dbus::utility::MapperGetSubTreeResponse& subtree) {
+            BMCWEB_LOG_DEBUG << "getPowerSupplyAttributes respHandler enter";
+            if (ec)
+            {
+                messages::internalError(sensorsAsyncResp->asyncResp->res);
+                BMCWEB_LOG_ERROR
+                    << "getPowerSupplyAttributes respHandler DBus error " << ec;
+                return;
+            }
+            if (subtree.empty())
+            {
+                BMCWEB_LOG_DEBUG << "Can't find Power Supply Attributes!";
+                callback(inventoryItems);
+                return;
+            }
 
-        // Currently we only support 1 power supply attribute, use this for
-        // all the power supplies. Build map of object path to connection.
-        // Assume just 1 connection and 1 path for now.
-        boost::container::flat_map<std::string, std::string>
-            psAttributesConnections;
+            // Currently we only support 1 power supply attribute, use this for
+            // all the power supplies. Build map of object path to connection.
+            // Assume just 1 connection and 1 path for now.
+            boost::container::flat_map<std::string, std::string>
+                psAttributesConnections;
 
-        if (subtree[0].first.empty() || subtree[0].second.empty())
-        {
-            BMCWEB_LOG_DEBUG << "Power Supply Attributes mapper error!";
-            callback(inventoryItems);
-            return;
-        }
+            if (subtree[0].first.empty() || subtree[0].second.empty())
+            {
+                BMCWEB_LOG_DEBUG << "Power Supply Attributes mapper error!";
+                callback(inventoryItems);
+                return;
+            }
 
-        const std::string& psAttributesPath = subtree[0].first;
-        const std::string& connection = subtree[0].second.begin()->first;
+            const std::string& psAttributesPath = subtree[0].first;
+            const std::string& connection = subtree[0].second.begin()->first;
 
-        if (connection.empty())
-        {
-            BMCWEB_LOG_DEBUG << "Power Supply Attributes mapper error!";
-            callback(inventoryItems);
-            return;
-        }
+            if (connection.empty())
+            {
+                BMCWEB_LOG_DEBUG << "Power Supply Attributes mapper error!";
+                callback(inventoryItems);
+                return;
+            }
 
-        psAttributesConnections[psAttributesPath] = connection;
-        BMCWEB_LOG_DEBUG << "Added mapping " << psAttributesPath << " -> "
-                         << connection;
+            psAttributesConnections[psAttributesPath] = connection;
+            BMCWEB_LOG_DEBUG << "Added mapping " << psAttributesPath << " -> "
+                             << connection;
 
-        getPowerSupplyAttributesData(sensorsAsyncResp, inventoryItems,
-                                     psAttributesConnections,
-                                     std::move(callback));
-        BMCWEB_LOG_DEBUG << "getPowerSupplyAttributes respHandler exit";
-    };
+            getPowerSupplyAttributesData(sensorsAsyncResp, inventoryItems,
+                                         psAttributesConnections,
+                                         std::move(callback));
+            BMCWEB_LOG_DEBUG << "getPowerSupplyAttributes respHandler exit";
+        };
     // Make call to ObjectMapper to find the PowerSupplyAttributes service
     crow::connections::systemBus->async_method_call(
         std::move(respHandler), "xyz.openbmc_project.ObjectMapper",
@@ -3000,8 +2998,9 @@
             // Get a list of all of the sensors that implement Sensor.Value
             // and get the path and service name associated with the sensor
             crow::connections::systemBus->async_method_call(
-                [asyncResp, sensorName](const boost::system::error_code ec,
-                                        const GetSubTreeType& subtree) {
+                [asyncResp, sensorName](
+                    const boost::system::error_code ec,
+                    const dbus::utility::MapperGetSubTreeResponse& subtree) {
                     BMCWEB_LOG_DEBUG << "respHandler1 enter";
                     if (ec)
                     {
@@ -3012,25 +3011,27 @@
                         return;
                     }
 
-                    GetSubTreeType::const_iterator it = std::find_if(
-                        subtree.begin(), subtree.end(),
-                        [sensorName](
-                            const std::pair<
-                                std::string,
-                                std::vector<std::pair<
-                                    std::string, std::vector<std::string>>>>&
-                                object) {
-                            sdbusplus::message::object_path path(object.first);
-                            std::string name = path.filename();
-                            if (name.empty())
-                            {
-                                BMCWEB_LOG_ERROR << "Invalid sensor path: "
-                                                 << object.first;
-                                return false;
-                            }
+                    dbus::utility::MapperGetSubTreeResponse::const_iterator it =
+                        std::find_if(
+                            subtree.begin(), subtree.end(),
+                            [sensorName](
+                                const std::pair<std::string,
+                                                std::vector<std::pair<
+                                                    std::string,
+                                                    std::vector<std::string>>>>&
+                                    object) {
+                                sdbusplus::message::object_path path(
+                                    object.first);
+                                std::string name = path.filename();
+                                if (name.empty())
+                                {
+                                    BMCWEB_LOG_ERROR << "Invalid sensor path: "
+                                                     << object.first;
+                                    return false;
+                                }
 
-                            return name == sensorName;
-                        });
+                                return name == sensorName;
+                            });
 
                     if (it == subtree.end())
                     {
diff --git a/redfish-core/lib/storage.hpp b/redfish-core/lib/storage.hpp
index a2a2201..6809958 100644
--- a/redfish-core/lib/storage.hpp
+++ b/redfish-core/lib/storage.hpp
@@ -64,7 +64,8 @@
             crow::connections::systemBus->async_method_call(
                 [asyncResp,
                  health](const boost::system::error_code ec,
-                         const std::vector<std::string>& storageList) {
+                         const dbus::utility::MapperGetSubTreePathsResponse&
+                             storageList) {
                     nlohmann::json& storageArray =
                         asyncResp->res.jsonValue["Drives"];
                     storageArray = nlohmann::json::array();
@@ -110,9 +111,9 @@
                     "xyz.openbmc_project.Inventory.Item.Drive"});
 
             crow::connections::systemBus->async_method_call(
-                [asyncResp,
-                 health](const boost::system::error_code ec,
-                         const crow::openbmc_mapper::GetSubTreeType& subtree) {
+                [asyncResp, health](
+                    const boost::system::error_code ec,
+                    const dbus::utility::MapperGetSubTreeResponse& subtree) {
                     if (ec || subtree.empty())
                     {
                         // doesn't have to be there
@@ -481,9 +482,9 @@
                                                   bmcweb::AsyncResp>& asyncResp,
                                               const std::string& driveId) {
             crow::connections::systemBus->async_method_call(
-                [asyncResp,
-                 driveId](const boost::system::error_code ec,
-                          const crow::openbmc_mapper::GetSubTreeType& subtree) {
+                [asyncResp, driveId](
+                    const boost::system::error_code ec,
+                    const dbus::utility::MapperGetSubTreeResponse& subtree) {
                     if (ec)
                     {
                         BMCWEB_LOG_ERROR << "Drive mapper call error";
diff --git a/redfish-core/lib/systems.hpp b/redfish-core/lib/systems.hpp
index ca85098..429e992 100644
--- a/redfish-core/lib/systems.hpp
+++ b/redfish-core/lib/systems.hpp
@@ -122,11 +122,10 @@
     }
 }
 
-inline void getProcessorProperties(
-    const std::shared_ptr<bmcweb::AsyncResp>& aResp, const std::string& service,
-    const std::string& path,
-    const std::vector<std::pair<std::string, dbus::utility::DbusVariantType>>&
-        properties)
+inline void
+    getProcessorProperties(const std::shared_ptr<bmcweb::AsyncResp>& aResp,
+                           const std::string& service, const std::string& path,
+                           const dbus::utility::DBusPropertiesMap& properties)
 {
 
     BMCWEB_LOG_DEBUG << "Got " << properties.size() << " Cpu properties.";
@@ -215,8 +214,7 @@
     crow::connections::systemBus->async_method_call(
         [aResp, service,
          path](const boost::system::error_code ec2,
-               const std::vector<std::pair<
-                   std::string, dbus::utility::DbusVariantType>>& properties) {
+               const dbus::utility::DBusPropertiesMap& properties) {
             if (ec2)
             {
                 BMCWEB_LOG_ERROR << "DBUS response error " << ec2;
@@ -244,12 +242,9 @@
     BMCWEB_LOG_DEBUG << "Get available system components.";
 
     crow::connections::systemBus->async_method_call(
-        [aResp, systemHealth](
-            const boost::system::error_code ec,
-            const std::vector<std::pair<
-                std::string,
-                std::vector<std::pair<std::string, std::vector<std::string>>>>>&
-                subtree) {
+        [aResp,
+         systemHealth](const boost::system::error_code ec,
+                       const dbus::utility::MapperGetSubTreeResponse& subtree) {
             if (ec)
             {
                 BMCWEB_LOG_DEBUG << "DBUS response error";
@@ -296,9 +291,7 @@
                             crow::connections::systemBus->async_method_call(
                                 [aResp, service{connection.first},
                                  path](const boost::system::error_code ec2,
-                                       const std::vector<std::pair<
-                                           std::string,
-                                           dbus::utility::DbusVariantType>>&
+                                       const dbus::utility::DBusPropertiesMap&
                                            properties) {
                                     if (ec2)
                                     {
@@ -402,9 +395,7 @@
                                 << "Found UUID, now get its properties.";
                             crow::connections::systemBus->async_method_call(
                                 [aResp](const boost::system::error_code ec3,
-                                        const std::vector<std::pair<
-                                            std::string,
-                                            dbus::utility::DbusVariantType>>&
+                                        const dbus::utility::DBusPropertiesMap&
                                             properties) {
                                     if (ec3)
                                     {
@@ -454,9 +445,7 @@
                         {
                             crow::connections::systemBus->async_method_call(
                                 [aResp](const boost::system::error_code ec2,
-                                        const std::vector<std::pair<
-                                            std::string,
-                                            dbus::utility::DbusVariantType>>&
+                                        const dbus::utility::DBusPropertiesMap&
                                             propertiesList) {
                                     if (ec2)
                                     {
@@ -1237,12 +1226,8 @@
     BMCWEB_LOG_DEBUG << "Get TPM required to boot.";
 
     crow::connections::systemBus->async_method_call(
-        [aResp](
-            const boost::system::error_code ec,
-            std::vector<std::pair<
-                std::string,
-                std::vector<std::pair<std::string, std::vector<std::string>>>>>&
-                subtree) {
+        [aResp](const boost::system::error_code ec,
+                const dbus::utility::MapperGetSubTreeResponse& subtree) {
             if (ec)
             {
                 BMCWEB_LOG_DEBUG
@@ -1329,12 +1314,8 @@
     BMCWEB_LOG_DEBUG << "Set TrustedModuleRequiredToBoot.";
 
     crow::connections::systemBus->async_method_call(
-        [aResp, tpmRequired](
-            const boost::system::error_code ec,
-            std::vector<std::pair<
-                std::string,
-                std::vector<std::pair<std::string, std::vector<std::string>>>>>&
-                subtree) {
+        [aResp, tpmRequired](const boost::system::error_code ec,
+                             dbus::utility::MapperGetSubTreeResponse& subtree) {
             if (ec)
             {
                 BMCWEB_LOG_DEBUG
@@ -1660,12 +1641,9 @@
                         const std::string& assetTag)
 {
     crow::connections::systemBus->async_method_call(
-        [aResp, assetTag](
-            const boost::system::error_code ec,
-            const std::vector<std::pair<
-                std::string,
-                std::vector<std::pair<std::string, std::vector<std::string>>>>>&
-                subtree) {
+        [aResp,
+         assetTag](const boost::system::error_code ec,
+                   const dbus::utility::MapperGetSubTreeResponse& subtree) {
             if (ec)
             {
                 BMCWEB_LOG_DEBUG << "D-Bus response error on GetSubTree " << ec;
@@ -1835,9 +1813,7 @@
     BMCWEB_LOG_DEBUG << "Get OEM information.";
     crow::connections::systemBus->async_method_call(
         [aResp](const boost::system::error_code ec,
-                const std::vector<
-                    std::pair<std::string, dbus::utility::DbusVariantType>>&
-                    propertiesList) {
+                const dbus::utility::DBusPropertiesMap& propertiesList) {
             nlohmann::json& oemPFR =
                 aResp->res.jsonValue["Oem"]["OpenBmc"]["FirmwareProvisioning"];
             aResp->res.jsonValue["Oem"]["OpenBmc"]["@odata.type"] =
@@ -1950,12 +1926,8 @@
 
     // Get Power Mode object path:
     crow::connections::systemBus->async_method_call(
-        [aResp](
-            const boost::system::error_code ec,
-            const std::vector<std::pair<
-                std::string,
-                std::vector<std::pair<std::string, std::vector<std::string>>>>>&
-                subtree) {
+        [aResp](const boost::system::error_code ec,
+                const dbus::utility::MapperGetSubTreeResponse& subtree) {
             if (ec)
             {
                 BMCWEB_LOG_DEBUG
@@ -2077,12 +2049,9 @@
 
     // Get Power Mode object path:
     crow::connections::systemBus->async_method_call(
-        [aResp, powerMode](
-            const boost::system::error_code ec,
-            const std::vector<std::pair<
-                std::string,
-                std::vector<std::pair<std::string, std::vector<std::string>>>>>&
-                subtree) {
+        [aResp,
+         powerMode](const boost::system::error_code ec,
+                    const dbus::utility::MapperGetSubTreeResponse& subtree) {
             if (ec)
             {
                 BMCWEB_LOG_DEBUG
@@ -2219,7 +2188,7 @@
     BMCWEB_LOG_DEBUG << "Get host watchodg";
     crow::connections::systemBus->async_method_call(
         [aResp](const boost::system::error_code ec,
-                const PropertiesType& properties) {
+                const dbus::utility::DBusPropertiesMap& properties) {
             if (ec)
             {
                 // watchdog service is stopped
@@ -2434,12 +2403,8 @@
 
     // Get IdlePowerSaver object path:
     crow::connections::systemBus->async_method_call(
-        [aResp](
-            const boost::system::error_code ec,
-            const std::vector<std::pair<
-                std::string,
-                std::vector<std::pair<std::string, std::vector<std::string>>>>>&
-                subtree) {
+        [aResp](const boost::system::error_code ec,
+                const dbus::utility::MapperGetSubTreeResponse& subtree) {
             if (ec)
             {
                 BMCWEB_LOG_DEBUG
@@ -2539,12 +2504,8 @@
     // Get IdlePowerSaver object path:
     crow::connections::systemBus->async_method_call(
         [aResp, ipsEnable, ipsEnterUtil, ipsEnterTime, ipsExitUtil,
-         ipsExitTime](
-            const boost::system::error_code ec,
-            const std::vector<std::pair<
-                std::string,
-                std::vector<std::pair<std::string, std::vector<std::string>>>>>&
-                subtree) {
+         ipsExitTime](const boost::system::error_code ec,
+                      const dbus::utility::MapperGetSubTreeResponse& subtree) {
             if (ec)
             {
                 BMCWEB_LOG_DEBUG
diff --git a/redfish-core/lib/task.hpp b/redfish-core/lib/task.hpp
index 4ebbc14..6c0a4b6 100644
--- a/redfish-core/lib/task.hpp
+++ b/redfish-core/lib/task.hpp
@@ -18,7 +18,7 @@
 #include <app.hpp>
 #include <boost/asio/post.hpp>
 #include <boost/asio/steady_timer.hpp>
-#include <boost/container/flat_map.hpp>
+#include <dbus_utility.hpp>
 #include <registries/privilege_registry.hpp>
 #include <task_messages.hpp>
 
diff --git a/redfish-core/lib/telemetry_service.hpp b/redfish-core/lib/telemetry_service.hpp
index 421985a..e0f6c03 100644
--- a/redfish-core/lib/telemetry_service.hpp
+++ b/redfish-core/lib/telemetry_service.hpp
@@ -27,10 +27,8 @@
         "/redfish/v1/TelemetryService/Triggers";
 
     crow::connections::systemBus->async_method_call(
-        [asyncResp](
-            const boost::system::error_code ec,
-            const std::vector<
-                std::pair<std::string, dbus::utility::DbusVariantType>>& ret) {
+        [asyncResp](const boost::system::error_code ec,
+                    const dbus::utility::DBusPropertiesMap& ret) {
             if (ec == boost::system::errc::host_unreachable)
             {
                 asyncResp->res.jsonValue["Status"]["State"] = "Absent";
diff --git a/redfish-core/lib/update_service.hpp b/redfish-core/lib/update_service.hpp
index cd49f57..729aa56 100644
--- a/redfish-core/lib/update_service.hpp
+++ b/redfish-core/lib/update_service.hpp
@@ -18,7 +18,6 @@
 #include "bmcweb_config.h"
 
 #include <app.hpp>
-#include <boost/container/flat_map.hpp>
 #include <dbus_utility.hpp>
 #include <registries/privilege_registry.hpp>
 #include <sdbusplus/asio/property.hpp>
@@ -66,10 +65,7 @@
                            sdbusplus::message::message& m,
                            task::Payload&& payload)
 {
-    std::vector<std::pair<
-        std::string,
-        std::vector<std::pair<std::string, dbus::utility::DbusVariantType>>>>
-        interfacesProperties;
+    dbus::utility::DBusInteracesMap interfacesProperties;
 
     sdbusplus::message::object_path objPath;
 
@@ -133,10 +129,7 @@
                                     }
 
                                     std::string iface;
-                                    boost::container::flat_map<
-                                        std::string,
-                                        dbus::utility::DbusVariantType>
-                                        values;
+                                    dbus::utility::DBusPropertiesMap values;
 
                                     std::string index =
                                         std::to_string(taskData->index);
@@ -145,21 +138,28 @@
                                     if (iface ==
                                         "xyz.openbmc_project.Software.Activation")
                                     {
-                                        auto findActivation =
-                                            values.find("Activation");
-                                        if (findActivation == values.end())
+                                        std::string* state = nullptr;
+                                        for (const auto& property : values)
                                         {
-                                            return !task::completed;
+                                            if (property.first == "Activation")
+                                            {
+                                                const std::string* state =
+                                                    std::get_if<std::string>(
+                                                        &property.second);
+                                                if (state == nullptr)
+                                                {
+                                                    taskData->messages
+                                                        .emplace_back(
+                                                            messages::
+                                                                internalError());
+                                                    return task::completed;
+                                                }
+                                            }
                                         }
-                                        std::string* state =
-                                            std::get_if<std::string>(
-                                                &(findActivation->second));
 
                                         if (state == nullptr)
                                         {
-                                            taskData->messages.emplace_back(
-                                                messages::internalError());
-                                            return task::completed;
+                                            return !task::completed;
                                         }
 
                                         if (boost::ends_with(*state,
@@ -202,21 +202,29 @@
                                         iface ==
                                         "xyz.openbmc_project.Software.ActivationProgress")
                                     {
-                                        auto findProgress =
-                                            values.find("Progress");
-                                        if (findProgress == values.end())
+
+                                        const uint8_t* progress = nullptr;
+                                        for (const auto& property : values)
                                         {
-                                            return !task::completed;
+                                            if (property.first == "Progress")
+                                            {
+                                                const std::string* progress =
+                                                    std::get_if<std::string>(
+                                                        &property.second);
+                                                if (progress == nullptr)
+                                                {
+                                                    taskData->messages
+                                                        .emplace_back(
+                                                            messages::
+                                                                internalError());
+                                                    return task::completed;
+                                                }
+                                            }
                                         }
-                                        uint8_t* progress =
-                                            std::get_if<uint8_t>(
-                                                &(findProgress->second));
 
                                         if (progress == nullptr)
                                         {
-                                            taskData->messages.emplace_back(
-                                                messages::internalError());
-                                            return task::completed;
+                                            return !task::completed;
                                         }
                                         taskData->percentComplete =
                                             static_cast<int>(*progress);
@@ -710,11 +718,7 @@
             crow::connections::systemBus->async_method_call(
                 [asyncResp](
                     const boost::system::error_code ec,
-                    const std::vector<
-                        std::pair<std::string,
-                                  std::vector<std::pair<
-                                      std::string, std::vector<std::string>>>>>&
-                        subtree) {
+                    const dbus::utility::MapperGetSubTreeResponse& subtree) {
                     if (ec)
                     {
                         messages::internalError(asyncResp->res);
@@ -798,13 +802,9 @@
                 "/redfish/v1/UpdateService/FirmwareInventory/" + *swId;
 
             crow::connections::systemBus->async_method_call(
-                [asyncResp, swId](
-                    const boost::system::error_code ec,
-                    const std::vector<
-                        std::pair<std::string,
-                                  std::vector<std::pair<
-                                      std::string, std::vector<std::string>>>>>&
-                        subtree) {
+                [asyncResp,
+                 swId](const boost::system::error_code ec,
+                       const dbus::utility::MapperGetSubTreeResponse& subtree) {
                     BMCWEB_LOG_DEBUG << "doGet callback...";
                     if (ec)
                     {
@@ -837,63 +837,47 @@
                         crow::connections::systemBus->async_method_call(
                             [asyncResp,
                              swId](const boost::system::error_code errorCode,
-                                   const boost::container::flat_map<
-                                       std::string,
-                                       dbus::utility::DbusVariantType>&
+                                   const dbus::utility::DBusPropertiesMap&
                                        propertiesList) {
                                 if (errorCode)
                                 {
                                     messages::internalError(asyncResp->res);
                                     return;
                                 }
-                                boost::container::flat_map<
-                                    std::string,
-                                    dbus::utility::DbusVariantType>::
-                                    const_iterator it =
-                                        propertiesList.find("Purpose");
-                                if (it == propertiesList.end())
+                                const std::string* swInvPurpose = nullptr;
+                                const std::string* version = nullptr;
+                                for (const auto& property : propertiesList)
                                 {
-                                    BMCWEB_LOG_DEBUG
-                                        << "Can't find property \"Purpose\"!";
-                                    messages::propertyMissing(asyncResp->res,
-                                                              "Purpose");
-                                    return;
+                                    if (property.first == "Purpose")
+                                    {
+                                        swInvPurpose = std::get_if<std::string>(
+                                            &property.second);
+                                    }
+                                    if (property.first == "Version")
+                                    {
+                                        version = std::get_if<std::string>(
+                                            &property.second);
+                                    }
                                 }
-                                const std::string* swInvPurpose =
-                                    std::get_if<std::string>(&it->second);
+
                                 if (swInvPurpose == nullptr)
                                 {
                                     BMCWEB_LOG_DEBUG
-                                        << "wrong types for property\"Purpose\"!";
-                                    messages::propertyValueTypeError(
-                                        asyncResp->res, "", "Purpose");
+                                        << "Can't find property \"Purpose\"!";
+                                    messages::internalError(asyncResp->res);
                                     return;
                                 }
 
                                 BMCWEB_LOG_DEBUG << "swInvPurpose = "
                                                  << *swInvPurpose;
-                                it = propertiesList.find("Version");
-                                if (it == propertiesList.end())
-                                {
-                                    BMCWEB_LOG_DEBUG
-                                        << "Can't find property \"Version\"!";
-                                    messages::propertyMissing(asyncResp->res,
-                                                              "Version");
-                                    return;
-                                }
-
-                                BMCWEB_LOG_DEBUG << "Version found!";
-
-                                const std::string* version =
-                                    std::get_if<std::string>(&it->second);
 
                                 if (version == nullptr)
                                 {
                                     BMCWEB_LOG_DEBUG
                                         << "Can't find property \"Version\"!";
 
-                                    messages::propertyValueTypeError(
-                                        asyncResp->res, "", "Version");
+                                    messages::internalError(asyncResp->res);
+
                                     return;
                                 }
                                 asyncResp->res.jsonValue["Version"] = *version;
diff --git a/redfish-core/lib/virtual_media.hpp b/redfish-core/lib/virtual_media.hpp
index b0e3b38..7159be1 100644
--- a/redfish-core/lib/virtual_media.hpp
+++ b/redfish-core/lib/virtual_media.hpp
@@ -15,16 +15,13 @@
 */
 #pragma once
 
+#include <account_service.hpp>
 #include <app.hpp>
-#include <boost/container/flat_map.hpp>
 #include <boost/process/async_pipe.hpp>
 #include <boost/type_traits/has_dereference.hpp>
-#include <utils/json_utils.hpp>
-// for GetObjectType and ManagedObjectType
-
-#include <account_service.hpp>
 #include <boost/url/url_view.hpp>
 #include <registries/privilege_registry.hpp>
+#include <utils/json_utils.hpp>
 
 namespace redfish
 {
@@ -821,7 +818,8 @@
                 crow::connections::systemBus->async_method_call(
                     [asyncResp, actionParams,
                      resName](const boost::system::error_code ec,
-                              const GetObjectType& getObjectType) mutable {
+                              const dbus::utility::MapperGetObject&
+                                  getObjectType) mutable {
                         if (ec)
                         {
                             BMCWEB_LOG_ERROR
@@ -927,8 +925,9 @@
                 }
 
                 crow::connections::systemBus->async_method_call(
-                    [asyncResp, resName](const boost::system::error_code ec,
-                                         const GetObjectType& getObjectType) {
+                    [asyncResp, resName](
+                        const boost::system::error_code ec,
+                        const dbus::utility::MapperGetObject& getObjectType) {
                         if (ec)
                         {
                             BMCWEB_LOG_ERROR
@@ -1022,8 +1021,9 @@
                     "/redfish/v1/Managers/" + name + "/VirtualMedia";
 
                 crow::connections::systemBus->async_method_call(
-                    [asyncResp, name](const boost::system::error_code ec,
-                                      const GetObjectType& getObjectType) {
+                    [asyncResp, name](
+                        const boost::system::error_code ec,
+                        const dbus::utility::MapperGetObject& getObjectType) {
                         if (ec)
                         {
                             BMCWEB_LOG_ERROR
@@ -1060,9 +1060,9 @@
                 }
 
                 crow::connections::systemBus->async_method_call(
-                    [asyncResp, name,
-                     resName](const boost::system::error_code ec,
-                              const GetObjectType& getObjectType) {
+                    [asyncResp, name, resName](
+                        const boost::system::error_code ec,
+                        const dbus::utility::MapperGetObject& getObjectType) {
                         if (ec)
                         {
                             BMCWEB_LOG_ERROR
