diff --git a/common/utils.cpp b/common/utils.cpp
index 93cde3d..d3d5d5d 100644
--- a/common/utils.cpp
+++ b/common/utils.cpp
@@ -28,198 +28,6 @@
 
 using ObjectMapper = sdbusplus::client::xyz::openbmc_project::ObjectMapper<>;
 
-Entities getParentEntites(const EntityAssociations& entityAssoc)
-{
-    Entities parents{};
-    for (const auto& et : entityAssoc)
-    {
-        parents.push_back(et[0]);
-    }
-
-    bool found = false;
-    for (auto it = parents.begin(); it != parents.end();
-         it = found ? parents.erase(it) : std::next(it))
-    {
-        uint16_t parent_contained_id =
-            pldm_entity_node_get_remote_container_id(*it);
-        found = false;
-        for (const auto& evs : entityAssoc)
-        {
-            for (size_t i = 1; i < evs.size() && !found; i++)
-            {
-                uint16_t node_contained_id =
-                    pldm_entity_node_get_remote_container_id(evs[i]);
-
-                pldm_entity parent_entity = pldm_entity_extract(*it);
-                pldm_entity node_entity = pldm_entity_extract(evs[i]);
-
-                if (node_entity.entity_type == parent_entity.entity_type &&
-                    node_entity.entity_instance_num ==
-                        parent_entity.entity_instance_num &&
-                    node_contained_id == parent_contained_id)
-                {
-                    found = true;
-                }
-            }
-            if (found)
-            {
-                break;
-            }
-        }
-    }
-
-    return parents;
-}
-
-void addObjectPathEntityAssociations(const EntityAssociations& entityAssoc,
-                                     pldm_entity_node* entity,
-                                     const fs::path& path,
-                                     ObjectPathMaps& objPathMap)
-{
-    if (entity == nullptr)
-    {
-        return;
-    }
-
-    bool found = false;
-    pldm_entity node_entity = pldm_entity_extract(entity);
-    if (!entityMaps.contains(node_entity.entity_type))
-    {
-        error(
-            "Entity type '{TYPE}' fetched from remote terminus does not exist.",
-            "TYPE", (int)node_entity.entity_type);
-        return;
-    }
-
-    std::string entityName = entityMaps.at(node_entity.entity_type);
-    for (const auto& ev : entityAssoc)
-    {
-        pldm_entity ev_entity = pldm_entity_extract(ev[0]);
-        if (ev_entity.entity_instance_num == node_entity.entity_instance_num &&
-            ev_entity.entity_type == node_entity.entity_type)
-        {
-            uint16_t node_contained_id =
-                pldm_entity_node_get_remote_container_id(ev[0]);
-            uint16_t entity_contained_id =
-                pldm_entity_node_get_remote_container_id(entity);
-
-            if (node_contained_id != entity_contained_id)
-            {
-                continue;
-            }
-
-            fs::path p = path / fs::path{entityName +
-                                         std::to_string(
-                                             node_entity.entity_instance_num)};
-            std::string entity_path = p.string();
-            // If the entity obtained from the remote PLDM terminal is not in
-            // the MAP, or there is no auxiliary name PDR, add it directly.
-            // Otherwise, check whether the DBus service of entity_path exists,
-            // and overwrite the entity if it does not exist.
-            if (!objPathMap.contains(entity_path))
-            {
-                objPathMap[entity_path] = entity;
-            }
-            else
-            {
-                try
-                {
-                    pldm::utils::DBusHandler().getService(entity_path.c_str(),
-                                                          nullptr);
-                }
-                catch (const std::exception& e)
-                {
-                    objPathMap[entity_path] = entity;
-                }
-            }
-
-            for (size_t i = 1; i < ev.size(); i++)
-            {
-                addObjectPathEntityAssociations(entityAssoc, ev[i], p,
-                                                objPathMap);
-            }
-            found = true;
-        }
-    }
-
-    if (!found)
-    {
-        std::string dbusPath =
-            path / fs::path{entityName +
-                            std::to_string(node_entity.entity_instance_num)};
-
-        try
-        {
-            pldm::utils::DBusHandler().getService(dbusPath.c_str(), nullptr);
-        }
-        catch (const std::exception& e)
-        {
-            objPathMap[dbusPath] = entity;
-        }
-    }
-}
-
-void updateEntityAssociation(const EntityAssociations& entityAssoc,
-                             pldm_entity_association_tree* entityTree,
-                             ObjectPathMaps& objPathMap)
-{
-    std::vector<pldm_entity_node*> parentsEntity =
-        getParentEntites(entityAssoc);
-    for (const auto& entity : parentsEntity)
-    {
-        fs::path path{"/xyz/openbmc_project/inventory"};
-        std::deque<std::string> paths{};
-        pldm_entity node_entity = pldm_entity_extract(entity);
-        auto node = pldm_entity_association_tree_find_with_locality(
-            entityTree, &node_entity, false);
-        if (!node)
-        {
-            continue;
-        }
-
-        bool found = true;
-        while (node)
-        {
-            if (!pldm_entity_is_exist_parent(node))
-            {
-                break;
-            }
-
-            pldm_entity parent = pldm_entity_get_parent(node);
-            try
-            {
-                paths.push_back(entityMaps.at(parent.entity_type) +
-                                std::to_string(parent.entity_instance_num));
-            }
-            catch (const std::exception& e)
-            {
-                error(
-                    "Failed to find parent entity type '{TYPE}' with instance ID '{INSTANCEID}' in the entity maps, error - {ERROR}",
-                    "TYPE", (int)parent.entity_type, "INSTANCEID",
-                    (int)parent.entity_instance_num, "ERROR", e);
-                found = false;
-                break;
-            }
-
-            node = pldm_entity_association_tree_find_with_locality(
-                entityTree, &parent, false);
-        }
-
-        if (!found)
-        {
-            continue;
-        }
-
-        while (!paths.empty())
-        {
-            path = path / fs::path{paths.back()};
-            paths.pop_back();
-        }
-
-        addObjectPathEntityAssociations(entityAssoc, entity, path, objPathMap);
-    }
-}
-
 std::vector<std::vector<uint8_t>> findStateEffecterPDR(uint8_t /*tid*/,
                                                        uint16_t entityID,
                                                        uint16_t stateSetId,
diff --git a/common/utils.hpp b/common/utils.hpp
index 28f11d6..1f54d28 100644
--- a/common/utils.hpp
+++ b/common/utils.hpp
@@ -41,12 +41,6 @@
 constexpr bool Tx = true;
 constexpr bool Rx = false;
 
-using EntityName = std::string;
-using EntityType = uint16_t;
-
-using Entities = std::vector<pldm_entity_node*>;
-using EntityAssociations = std::vector<Entities>;
-using ObjectPathMaps = std::map<fs::path, pldm_entity_node*>;
 using ObjectMapper = sdbusplus::client::xyz::openbmc_project::ObjectMapper<>;
 
 using inventoryManager =
@@ -56,33 +50,6 @@
 constexpr auto mapperService = ObjectMapper::default_service;
 constexpr auto inventoryPath = "/xyz/openbmc_project/inventory";
 
-const std::map<EntityType, EntityName> entityMaps = {
-    {PLDM_ENTITY_SYSTEM_CHASSIS, "chassis"},
-    {PLDM_ENTITY_BOARD, "io_board"},
-    {PLDM_ENTITY_SYS_BOARD, "motherboard"},
-    {PLDM_ENTITY_POWER_SUPPLY, "powersupply"},
-    {PLDM_ENTITY_PROC, "cpu"},
-    {PLDM_ENTITY_SYSTEM_CHASSIS | 0x8000, "system"},
-    {PLDM_ENTITY_PROC_MODULE, "dcm"},
-    {PLDM_ENTITY_PROC | 0x8000, "core"},
-    {PLDM_ENTITY_IO_MODULE, "io_module"},
-    {PLDM_ENTITY_FAN, "fan"},
-    {PLDM_ENTITY_SYS_MGMT_MODULE, "system_management_module"},
-    {PLDM_ENTITY_POWER_CONVERTER, "power_converter"},
-    {PLDM_ENTITY_SLOT, "slot"},
-    {PLDM_ENTITY_CONNECTOR, "connector"}};
-
-/** @brief Vector a entity name to pldm_entity from entity association tree
- *  @param[in]  entityAssoc    - Vector of associated pldm entities
- *  @param[in]  entityTree     - entity association tree
- *  @param[out] objPathMap     - maps an object path to pldm_entity from the
- *                               BMC's entity association tree
- *  @return
- */
-void updateEntityAssociation(const EntityAssociations& entityAssoc,
-                             pldm_entity_association_tree* entityTree,
-                             ObjectPathMaps& objPathMap);
-
 /** @struct CustomFD
  *
  *  RAII wrapper for file descriptor.
diff --git a/host-bmc/host_pdr_handler.cpp b/host-bmc/host_pdr_handler.cpp
index 3f3b964..71e3812 100644
--- a/host-bmc/host_pdr_handler.cpp
+++ b/host-bmc/host_pdr_handler.cpp
@@ -628,7 +628,8 @@
     }
     if (!nextRecordHandle)
     {
-        updateEntityAssociation(entityAssociations, entityTree, objPathMap);
+        pldm::hostbmc::utils::updateEntityAssociation(entityAssociations,
+                                                      entityTree, objPathMap);
 
         /*received last record*/
         this->parseStateSensorPDRs(stateSensorPDRs);
diff --git a/host-bmc/host_pdr_handler.hpp b/host-bmc/host_pdr_handler.hpp
index 3b05f59..053cfef 100644
--- a/host-bmc/host_pdr_handler.hpp
+++ b/host-bmc/host_pdr_handler.hpp
@@ -7,6 +7,7 @@
 #include "libpldmresponder/oem_handler.hpp"
 #include "libpldmresponder/pdr_utils.hpp"
 #include "requester/handler.hpp"
+#include "utils.hpp"
 
 #include <libpldm/base.h>
 #include <libpldm/platform.h>
@@ -314,11 +315,11 @@
     /** @brief maps an object path to pldm_entity from the BMC's entity
      *         association tree
      */
-    utils::ObjectPathMaps objPathMap;
+    ObjectPathMaps objPathMap;
 
     /** @brief maps an entity name to map, maps to entity name to pldm_entity
      */
-    utils::EntityAssociations entityAssociations;
+    EntityAssociations entityAssociations;
 
     /** @brief the vector of FRU Record Data Format
      */
diff --git a/host-bmc/test/meson.build b/host-bmc/test/meson.build
index 30f6624..66d75b7 100644
--- a/host-bmc/test/meson.build
+++ b/host-bmc/test/meson.build
@@ -5,6 +5,7 @@
 test_sources = [
   '../../common/utils.cpp',
   '../custom_dbus.cpp',
+  '../utils.cpp'
 ]
 
 tests = [
diff --git a/host-bmc/test/utils_test.cpp b/host-bmc/test/utils_test.cpp
index ab64aa1..701f4cb 100644
--- a/host-bmc/test/utils_test.cpp
+++ b/host-bmc/test/utils_test.cpp
@@ -1,4 +1,4 @@
-#include "common/utils.hpp"
+#include "../utils.hpp"
 
 #include <libpldm/pdr.h>
 
@@ -80,7 +80,8 @@
          l5b}};
 
     ObjectPathMaps objPathMap;
-    updateEntityAssociation(entityAssociations, tree, objPathMap);
+    pldm::hostbmc::utils::updateEntityAssociation(entityAssociations, tree,
+                                                  objPathMap);
 
     EXPECT_EQ(objPathMap.size(), retObjectMaps.size());
 
diff --git a/host-bmc/utils.cpp b/host-bmc/utils.cpp
new file mode 100644
index 0000000..f025ada
--- /dev/null
+++ b/host-bmc/utils.cpp
@@ -0,0 +1,208 @@
+#include "common/utils.hpp"
+
+#include "libpldm/entity.h"
+
+#include "utils.hpp"
+
+#include <iostream>
+
+namespace pldm
+{
+namespace hostbmc
+{
+namespace utils
+{
+Entities getParentEntites(const EntityAssociations& entityAssoc)
+{
+    Entities parents{};
+    for (const auto& et : entityAssoc)
+    {
+        parents.push_back(et[0]);
+    }
+
+    bool found = false;
+    for (auto it = parents.begin(); it != parents.end();
+         it = found ? parents.erase(it) : std::next(it))
+    {
+        uint16_t parent_contained_id =
+            pldm_entity_node_get_remote_container_id(*it);
+        found = false;
+        for (const auto& evs : entityAssoc)
+        {
+            for (size_t i = 1; i < evs.size() && !found; i++)
+            {
+                uint16_t node_contained_id =
+                    pldm_entity_node_get_remote_container_id(evs[i]);
+
+                pldm_entity parent_entity = pldm_entity_extract(*it);
+                pldm_entity node_entity = pldm_entity_extract(evs[i]);
+
+                if (node_entity.entity_type == parent_entity.entity_type &&
+                    node_entity.entity_instance_num ==
+                        parent_entity.entity_instance_num &&
+                    node_contained_id == parent_contained_id)
+                {
+                    found = true;
+                }
+            }
+            if (found)
+            {
+                break;
+            }
+        }
+    }
+
+    return parents;
+}
+
+void addObjectPathEntityAssociations(const EntityAssociations& entityAssoc,
+                                     pldm_entity_node* entity,
+                                     const fs::path& path,
+                                     ObjectPathMaps& objPathMap)
+{
+    if (entity == nullptr)
+    {
+        return;
+    }
+
+    bool found = false;
+    pldm_entity node_entity = pldm_entity_extract(entity);
+    if (!entityMaps.contains(node_entity.entity_type))
+    {
+        lg2::info(
+            "{ENTITY_TYPE} Entity fetched from remote PLDM terminal does not exist.",
+            "ENTITY_TYPE", (int)node_entity.entity_type);
+        return;
+    }
+
+    std::string entityName = entityMaps.at(node_entity.entity_type);
+    for (const auto& ev : entityAssoc)
+    {
+        pldm_entity ev_entity = pldm_entity_extract(ev[0]);
+        if (ev_entity.entity_instance_num == node_entity.entity_instance_num &&
+            ev_entity.entity_type == node_entity.entity_type)
+        {
+            uint16_t node_contained_id =
+                pldm_entity_node_get_remote_container_id(ev[0]);
+            uint16_t entity_contained_id =
+                pldm_entity_node_get_remote_container_id(entity);
+
+            if (node_contained_id != entity_contained_id)
+            {
+                continue;
+            }
+
+            fs::path p = path / fs::path{entityName +
+                                         std::to_string(
+                                             node_entity.entity_instance_num)};
+            std::string entity_path = p.string();
+            // If the entity obtained from the remote PLDM terminal is not in
+            // the MAP, or there is no auxiliary name PDR, add it directly.
+            // Otherwise, check whether the DBus service of entity_path exists,
+            // and overwrite the entity if it does not exist.
+            if (!objPathMap.contains(entity_path))
+            {
+                objPathMap[entity_path] = entity;
+            }
+            else
+            {
+                try
+                {
+                    pldm::utils::DBusHandler().getService(entity_path.c_str(),
+                                                          nullptr);
+                }
+                catch (const std::exception& e)
+                {
+                    objPathMap[entity_path] = entity;
+                }
+            }
+
+            for (size_t i = 1; i < ev.size(); i++)
+            {
+                addObjectPathEntityAssociations(entityAssoc, ev[i], p,
+                                                objPathMap);
+            }
+            found = true;
+        }
+    }
+
+    if (!found)
+    {
+        std::string dbusPath =
+            path / fs::path{entityName +
+                            std::to_string(node_entity.entity_instance_num)};
+
+        try
+        {
+            pldm::utils::DBusHandler().getService(dbusPath.c_str(), nullptr);
+        }
+        catch (const std::exception& e)
+        {
+            objPathMap[dbusPath] = entity;
+        }
+    }
+}
+
+void updateEntityAssociation(const EntityAssociations& entityAssoc,
+                             pldm_entity_association_tree* entityTree,
+                             ObjectPathMaps& objPathMap)
+{
+    std::vector<pldm_entity_node*> parentsEntity =
+        getParentEntites(entityAssoc);
+    for (const auto& entity : parentsEntity)
+    {
+        fs::path path{"/xyz/openbmc_project/inventory"};
+        std::deque<std::string> paths{};
+        pldm_entity node_entity = pldm_entity_extract(entity);
+        auto node = pldm_entity_association_tree_find_with_locality(
+            entityTree, &node_entity, false);
+        if (!node)
+        {
+            continue;
+        }
+
+        bool found = true;
+        while (node)
+        {
+            if (!pldm_entity_is_exist_parent(node))
+            {
+                break;
+            }
+
+            pldm_entity parent = pldm_entity_get_parent(node);
+            try
+            {
+                paths.push_back(entityMaps.at(parent.entity_type) +
+                                std::to_string(parent.entity_instance_num));
+            }
+            catch (const std::exception& e)
+            {
+                lg2::error(
+                    "Parent entity not found in the entityMaps, type: {ENTITY_TYPE}, num: {NUM}, e: {ERROR}",
+                    "ENTITY_TYPE", (int)parent.entity_type, "NUM",
+                    (int)parent.entity_instance_num, "ERROR", e);
+                found = false;
+                break;
+            }
+
+            node = pldm_entity_association_tree_find_with_locality(
+                entityTree, &parent, false);
+        }
+
+        if (!found)
+        {
+            continue;
+        }
+
+        while (!paths.empty())
+        {
+            path = path / fs::path{paths.back()};
+            paths.pop_back();
+        }
+
+        addObjectPathEntityAssociations(entityAssoc, entity, path, objPathMap);
+    }
+}
+} // namespace utils
+} // namespace hostbmc
+} // namespace pldm
diff --git a/host-bmc/utils.hpp b/host-bmc/utils.hpp
new file mode 100644
index 0000000..857d6c7
--- /dev/null
+++ b/host-bmc/utils.hpp
@@ -0,0 +1,57 @@
+#include "libpldm/pdr.h"
+
+#include "libpldmresponder/oem_handler.hpp"
+
+#include <nlohmann/json.hpp>
+#include <phosphor-logging/lg2.hpp>
+
+#include <filesystem>
+#include <fstream>
+#include <map>
+#include <string>
+#include <vector>
+
+PHOSPHOR_LOG2_USING;
+namespace pldm
+{
+using EntityName = std::string;
+using EntityType = uint16_t;
+
+using Entities = std::vector<pldm_entity_node*>;
+using EntityAssociations = std::vector<Entities>;
+using ObjectPathMaps = std::map<fs::path, pldm_entity_node*>;
+namespace hostbmc
+{
+namespace utils
+{
+
+const std::map<EntityType, EntityName> entityMaps = {
+    {PLDM_ENTITY_SYSTEM_CHASSIS, "chassis"},
+    {PLDM_ENTITY_BOARD, "io_board"},
+    {PLDM_ENTITY_SYS_BOARD, "motherboard"},
+    {PLDM_ENTITY_POWER_SUPPLY, "powersupply"},
+    {PLDM_ENTITY_PROC, "cpu"},
+    {PLDM_ENTITY_SYSTEM_CHASSIS | 0x8000, "system"},
+    {PLDM_ENTITY_PROC_MODULE, "dcm"},
+    {PLDM_ENTITY_PROC | 0x8000, "core"},
+    {PLDM_ENTITY_IO_MODULE, "io_module"},
+    {PLDM_ENTITY_FAN, "fan"},
+    {PLDM_ENTITY_SYS_MGMT_MODULE, "system_management_module"},
+    {PLDM_ENTITY_POWER_CONVERTER, "power_converter"},
+    {PLDM_ENTITY_SLOT, "slot"},
+    {PLDM_ENTITY_CONNECTOR, "connector"}};
+
+/** @brief Vector a entity name to pldm_entity from entity association tree
+ *  @param[in]  entityAssoc    - Vector of associated pldm entities
+ *  @param[in]  entityTree     - entity association tree
+ *  @param[out] objPathMap     - maps an object path to pldm_entity from the
+ *                               BMC's entity association tree
+ *  @return
+ */
+void updateEntityAssociation(const EntityAssociations& entityAssoc,
+                             pldm_entity_association_tree* entityTree,
+                             ObjectPathMaps& objPathMap);
+
+} // namespace utils
+} // namespace hostbmc
+} // namespace pldm
diff --git a/libpldmresponder/meson.build b/libpldmresponder/meson.build
index 45594b0..9e3db15 100644
--- a/libpldmresponder/meson.build
+++ b/libpldmresponder/meson.build
@@ -28,6 +28,7 @@
   '../host-bmc/dbus_to_host_effecters.cpp',
   '../host-bmc/host_condition.cpp',
   '../host-bmc/custom_dbus.cpp',
+  '../host-bmc/utils.cpp',
   'event_parser.cpp'
 ]
 
