diff --git a/fw-update/device_updater.cpp b/fw-update/device_updater.cpp
index 4009a48..20bca0c 100644
--- a/fw-update/device_updater.cpp
+++ b/fw-update/device_updater.cpp
@@ -19,7 +19,7 @@
 
 void DeviceUpdater::startFwUpdateFlow()
 {
-    auto instanceId = updateManager->requester.getInstanceId(eid);
+    auto instanceId = updateManager->instanceIdDb.next(eid);
     // NumberOfComponents
     const auto& applicableComponents =
         std::get<ApplicableComponents>(fwDeviceIDRecord);
@@ -48,7 +48,7 @@
         sizeof(struct pldm_request_update_req) + compImgSetVerStrInfo.length);
     if (rc)
     {
-        updateManager->requester.markFree(eid, instanceId);
+        updateManager->instanceIdDb.free(eid, instanceId);
         error("encode_request_update_req failed, EID = {EID}, RC = {RC}", "EID",
               unsigned(eid), "RC", rc);
         // Handle error scenario
@@ -107,7 +107,7 @@
 {
     pldmRequest.reset();
 
-    auto instanceId = updateManager->requester.getInstanceId(eid);
+    auto instanceId = updateManager->instanceIdDb.next(eid);
     // TransferFlag
     const auto& applicableComponents =
         std::get<ApplicableComponents>(fwDeviceIDRecord);
@@ -170,7 +170,7 @@
         sizeof(pldm_pass_component_table_req) + compVerStrInfo.length);
     if (rc)
     {
-        updateManager->requester.markFree(eid, instanceId);
+        updateManager->instanceIdDb.free(eid, instanceId);
         error("encode_pass_component_table_req failed, EID = {EID}, RC = {RC}",
               "EID", unsigned(eid), "RC", rc);
         // Handle error scenario
@@ -249,7 +249,7 @@
 {
     pldmRequest.reset();
 
-    auto instanceId = updateManager->requester.getInstanceId(eid);
+    auto instanceId = updateManager->instanceIdDb.next(eid);
     const auto& applicableComponents =
         std::get<ApplicableComponents>(fwDeviceIDRecord);
     const auto& comp = compImageInfos[applicableComponents[offset]];
@@ -297,7 +297,7 @@
         sizeof(pldm_update_component_req) + compVerStrInfo.length);
     if (rc)
     {
-        updateManager->requester.markFree(eid, instanceId);
+        updateManager->instanceIdDb.free(eid, instanceId);
         error("encode_update_component_req failed, EID={EID}, RC = {RC}", "EID",
               unsigned(eid), "RC", rc);
         // Handle error scenario
@@ -631,7 +631,7 @@
 void DeviceUpdater::sendActivateFirmwareRequest()
 {
     pldmRequest.reset();
-    auto instanceId = updateManager->requester.getInstanceId(eid);
+    auto instanceId = updateManager->instanceIdDb.next(eid);
     Request request(sizeof(pldm_msg_hdr) +
                     sizeof(struct pldm_activate_firmware_req));
     auto requestMsg = reinterpret_cast<pldm_msg*>(request.data());
@@ -641,7 +641,7 @@
         sizeof(pldm_activate_firmware_req));
     if (rc)
     {
-        updateManager->requester.markFree(eid, instanceId);
+        updateManager->instanceIdDb.free(eid, instanceId);
         error("encode_activate_firmware_req failed, EID={EID}, RC = {RC}",
               "EID", unsigned(eid), "RC", rc);
     }
diff --git a/fw-update/inventory_manager.cpp b/fw-update/inventory_manager.cpp
index ea80e69..f5a797b 100644
--- a/fw-update/inventory_manager.cpp
+++ b/fw-update/inventory_manager.cpp
@@ -19,7 +19,7 @@
 {
     for (const auto& eid : eids)
     {
-        auto instanceId = requester.getInstanceId(eid);
+        auto instanceId = instanceIdDb.next(eid);
         Request requestMsg(sizeof(pldm_msg_hdr) +
                            PLDM_QUERY_DEVICE_IDENTIFIERS_REQ_BYTES);
         auto request = reinterpret_cast<pldm_msg*>(requestMsg.data());
@@ -27,7 +27,7 @@
             instanceId, PLDM_QUERY_DEVICE_IDENTIFIERS_REQ_BYTES, request);
         if (rc)
         {
-            requester.markFree(eid, instanceId);
+            instanceIdDb.free(eid, instanceId);
             error(
                 "encode_query_device_identifiers_req failed, EID={EID}, RC = {RC}",
                 "EID", unsigned(eid), "RC", rc);
@@ -150,7 +150,7 @@
 
 void InventoryManager::sendGetFirmwareParametersRequest(mctp_eid_t eid)
 {
-    auto instanceId = requester.getInstanceId(eid);
+    auto instanceId = instanceIdDb.next(eid);
     Request requestMsg(sizeof(pldm_msg_hdr) +
                        PLDM_GET_FIRMWARE_PARAMETERS_REQ_BYTES);
     auto request = reinterpret_cast<pldm_msg*>(requestMsg.data());
@@ -158,7 +158,7 @@
         instanceId, PLDM_GET_FIRMWARE_PARAMETERS_REQ_BYTES, request);
     if (rc)
     {
-        requester.markFree(eid, instanceId);
+        instanceIdDb.free(eid, instanceId);
         error("encode_get_firmware_parameters_req failed, EID={EID}, RC = {RC}",
               "EID", unsigned(eid), "RC", rc);
         return;
diff --git a/fw-update/inventory_manager.hpp b/fw-update/inventory_manager.hpp
index 1bca43f..ae5030f 100644
--- a/fw-update/inventory_manager.hpp
+++ b/fw-update/inventory_manager.hpp
@@ -1,7 +1,7 @@
 #pragma once
 
 #include "common/types.hpp"
-#include "pldmd/dbus_impl_requester.hpp"
+#include "pldmd/instance_id.hpp"
 #include "requester/handler.hpp"
 
 #include <libpldm/pldm.h>
@@ -33,7 +33,7 @@
     /** @brief Constructor
      *
      *  @param[in] handler - PLDM request handler
-     *  @param[in] requester - Managing instance ID for PLDM requests
+     *  @param[in] instanceIdDb - Managing instance ID for PLDM requests
      *  @param[out] descriptorMap - Populate the firmware identifers for the
      *                              FDs managed by the BMC.
      *  @param[out] componentInfoMap - Populate the component info for the FDs
@@ -41,10 +41,10 @@
      */
     explicit InventoryManager(
         pldm::requester::Handler<pldm::requester::Request>& handler,
-        pldm::dbus_api::Requester& requester, DescriptorMap& descriptorMap,
+        InstanceIdDb& instanceIdDb, DescriptorMap& descriptorMap,
         ComponentInfoMap& componentInfoMap) :
         handler(handler),
-        requester(requester), descriptorMap(descriptorMap),
+        instanceIdDb(instanceIdDb), descriptorMap(descriptorMap),
         componentInfoMap(componentInfoMap)
     {}
 
@@ -93,8 +93,8 @@
     /** @brief PLDM request handler */
     pldm::requester::Handler<pldm::requester::Request>& handler;
 
-    /** @brief D-Bus API for managing instance ID*/
-    pldm::dbus_api::Requester& requester;
+    /** @brief Instance ID database for managing instance ID*/
+    InstanceIdDb& instanceIdDb;
 
     /** @brief Device identifiers of the managed FDs */
     DescriptorMap& descriptorMap;
diff --git a/fw-update/manager.hpp b/fw-update/manager.hpp
index 8c2f2e1..46a3285 100644
--- a/fw-update/manager.hpp
+++ b/fw-update/manager.hpp
@@ -4,7 +4,7 @@
 #include "common/types.hpp"
 #include "device_updater.hpp"
 #include "inventory_manager.hpp"
-#include "pldmd/dbus_impl_requester.hpp"
+#include "pldmd/instance_id.hpp"
 #include "requester/handler.hpp"
 #include "update_manager.hpp"
 
@@ -19,8 +19,6 @@
 namespace fw_update
 {
 
-using namespace pldm::dbus_api;
-
 /** @class Manager
  *
  * This class handles all the aspects of the PLDM FW update specification for
@@ -42,9 +40,9 @@
      */
     explicit Manager(Event& event,
                      requester::Handler<requester::Request>& handler,
-                     Requester& requester) :
-        inventoryMgr(handler, requester, descriptorMap, componentInfoMap),
-        updateManager(event, handler, requester, descriptorMap,
+                     pldm::InstanceIdDb& instanceIdDb) :
+        inventoryMgr(handler, instanceIdDb, descriptorMap, componentInfoMap),
+        updateManager(event, handler, instanceIdDb, descriptorMap,
                       componentInfoMap)
     {}
 
diff --git a/fw-update/test/device_updater_test.cpp b/fw-update/test/device_updater_test.cpp
index 2e237e3..ba2b16f 100644
--- a/fw-update/test/device_updater_test.cpp
+++ b/fw-update/test/device_updater_test.cpp
@@ -1,7 +1,7 @@
 #include "common/utils.hpp"
 #include "fw-update/device_updater.hpp"
 #include "fw-update/package_parser.hpp"
-#include "pldmd/dbus_impl_requester.hpp"
+#include "pldmd/instance_id.hpp"
 #include "requester/handler.hpp"
 
 #include <libpldm/firmware_update.h>
diff --git a/fw-update/test/inventory_manager_test.cpp b/fw-update/test/inventory_manager_test.cpp
index 1f7d142..3876563 100644
--- a/fw-update/test/inventory_manager_test.cpp
+++ b/fw-update/test/inventory_manager_test.cpp
@@ -16,18 +16,15 @@
   protected:
     InventoryManagerTest() :
         event(sdeventplus::Event::get_default()), instanceIdDb(),
-        dbusImplRequester(pldm::utils::DBusHandler::getBus(),
-                          "/xyz/openbmc_project/pldm", instanceIdDb),
-        reqHandler(fd, event, dbusImplRequester, false, 90000, seconds(1), 2,
+        reqHandler(fd, event, instanceIdDb, false, 90000, seconds(1), 2,
                    milliseconds(100)),
-        inventoryManager(reqHandler, dbusImplRequester, outDescriptorMap,
+        inventoryManager(reqHandler, instanceIdDb, outDescriptorMap,
                          outComponentInfoMap)
     {}
 
     int fd = -1;
     sdeventplus::Event event;
     TestInstanceIdDb instanceIdDb;
-    pldm::dbus_api::Requester dbusImplRequester;
     requester::Handler<requester::Request> reqHandler;
     InventoryManager inventoryManager;
     DescriptorMap outDescriptorMap{};
diff --git a/fw-update/update_manager.hpp b/fw-update/update_manager.hpp
index 64cf222..00ddc0c 100644
--- a/fw-update/update_manager.hpp
+++ b/fw-update/update_manager.hpp
@@ -3,7 +3,7 @@
 #include "common/types.hpp"
 #include "device_updater.hpp"
 #include "package_parser.hpp"
-#include "pldmd/dbus_impl_requester.hpp"
+#include "pldmd/instance_id.hpp"
 #include "requester/handler.hpp"
 #include "watch.hpp"
 
@@ -24,7 +24,6 @@
 
 using namespace sdeventplus;
 using namespace sdeventplus::source;
-using namespace pldm::dbus_api;
 using namespace pldm;
 
 using DeviceIDRecordOffset = size_t;
@@ -48,11 +47,11 @@
     explicit UpdateManager(
         Event& event,
         pldm::requester::Handler<pldm::requester::Request>& handler,
-        Requester& requester, const DescriptorMap& descriptorMap,
+        InstanceIdDb& instanceIdDb, const DescriptorMap& descriptorMap,
         const ComponentInfoMap& componentInfoMap) :
         event(event),
-        handler(handler), requester(requester), descriptorMap(descriptorMap),
-        componentInfoMap(componentInfoMap),
+        handler(handler), instanceIdDb(instanceIdDb),
+        descriptorMap(descriptorMap), componentInfoMap(componentInfoMap),
         watch(event.get(),
               std::bind_front(&UpdateManager::processPackage, this))
     {}
@@ -96,7 +95,7 @@
     Event& event; //!< reference to PLDM daemon's main event loop
     /** @brief PLDM request handler */
     pldm::requester::Handler<pldm::requester::Request>& handler;
-    Requester& requester; //!< reference to Requester object
+    InstanceIdDb& instanceIdDb; //!< reference to an InstanceIdDb
 
   private:
     /** @brief Device identifiers of the managed FDs */
diff --git a/host-bmc/dbus_to_event_handler.cpp b/host-bmc/dbus_to_event_handler.cpp
index e8f84a6..2c9d92e 100644
--- a/host-bmc/dbus_to_event_handler.cpp
+++ b/host-bmc/dbus_to_event_handler.cpp
@@ -10,7 +10,6 @@
 
 namespace pldm
 {
-using namespace pldm::dbus_api;
 using namespace pldm::responder;
 using namespace pldm::responder::pdr;
 using namespace pldm::responder::pdr_utils;
@@ -22,16 +21,16 @@
 const std::vector<uint8_t> pdrTypes{PLDM_STATE_SENSOR_PDR};
 
 DbusToPLDMEvent::DbusToPLDMEvent(
-    int mctp_fd, uint8_t mctp_eid, Requester& requester,
+    int mctp_fd, uint8_t mctp_eid, pldm::InstanceIdDb& instanceIdDb,
     pldm::requester::Handler<pldm::requester::Request>* handler) :
     mctp_fd(mctp_fd),
-    mctp_eid(mctp_eid), requester(requester), handler(handler)
+    mctp_eid(mctp_eid), instanceIdDb(instanceIdDb), handler(handler)
 {}
 
 void DbusToPLDMEvent::sendEventMsg(uint8_t eventType,
                                    const std::vector<uint8_t>& eventDataVec)
 {
-    auto instanceId = requester.getInstanceId(mctp_eid);
+    auto instanceId = instanceIdDb.next(mctp_eid);
     std::vector<uint8_t> requestMsg(sizeof(pldm_msg_hdr) +
                                     PLDM_PLATFORM_EVENT_MESSAGE_MIN_REQ_BYTES +
                                     eventDataVec.size());
@@ -43,7 +42,7 @@
         eventDataVec.size() + PLDM_PLATFORM_EVENT_MESSAGE_MIN_REQ_BYTES);
     if (rc != PLDM_SUCCESS)
     {
-        requester.markFree(mctp_eid, instanceId);
+        instanceIdDb.free(mctp_eid, instanceId);
         error("Failed to encode_platform_event_message_req, rc = {RC}", "RC",
               rc);
         return;
diff --git a/host-bmc/dbus_to_event_handler.hpp b/host-bmc/dbus_to_event_handler.hpp
index 886d6b5..87668c2 100644
--- a/host-bmc/dbus_to_event_handler.hpp
+++ b/host-bmc/dbus_to_event_handler.hpp
@@ -1,7 +1,7 @@
 #pragma once
 
 #include "libpldmresponder/pdr_utils.hpp"
-#include "pldmd/dbus_impl_requester.hpp"
+#include "pldmd/instance_id.hpp"
 #include "requester/handler.hpp"
 
 #include <libpldm/platform.h>
@@ -41,7 +41,7 @@
      *  @param[in] handler - PLDM request handler
      */
     explicit DbusToPLDMEvent(
-        int mctp_fd, uint8_t mctp_eid, pldm::dbus_api::Requester& requester,
+        int mctp_fd, uint8_t mctp_eid, pldm::InstanceIdDb& instanceIdDb,
         pldm::requester::Handler<pldm::requester::Request>* handler);
 
   public:
@@ -71,10 +71,10 @@
     /** @brief MCTP EID of host firmware */
     uint8_t mctp_eid;
 
-    /** @brief reference to Requester object, primarily used to access API to
-     *  obtain PLDM instance id.
+    /** @brief reference to an Instance ID database object, used to obtain PLDM
+     * instance IDs
      */
-    pldm::dbus_api::Requester& requester;
+    pldm::InstanceIdDb& instanceIdDb;
 
     /** @brief D-Bus property changed signal match */
     std::vector<std::unique_ptr<sdbusplus::bus::match_t>> stateSensorMatchs;
diff --git a/host-bmc/dbus_to_host_effecters.cpp b/host-bmc/dbus_to_host_effecters.cpp
index 8f54ca2..884662e 100644
--- a/host-bmc/dbus_to_host_effecters.cpp
+++ b/host-bmc/dbus_to_host_effecters.cpp
@@ -255,7 +255,7 @@
 {
     uint8_t& mctpEid = hostEffecterInfo[effecterInfoIndex].mctpEid;
     uint8_t& compEffCnt = hostEffecterInfo[effecterInfoIndex].compEffecterCnt;
-    auto instanceId = requester->getInstanceId(mctpEid);
+    auto instanceId = instanceIdDb->next(mctpEid);
 
     std::vector<uint8_t> requestMsg(
         sizeof(pldm_msg_hdr) + sizeof(effecterId) + sizeof(compEffCnt) +
@@ -269,7 +269,7 @@
     {
         error("Message encode failure. PLDM error code = {RC}", "RC", lg2::hex,
               rc);
-        requester->markFree(mctpEid, instanceId);
+        instanceIdDb->free(mctpEid, instanceId);
         return rc;
     }
 
diff --git a/host-bmc/dbus_to_host_effecters.hpp b/host-bmc/dbus_to_host_effecters.hpp
index c5aef12..3690ad8 100644
--- a/host-bmc/dbus_to_host_effecters.hpp
+++ b/host-bmc/dbus_to_host_effecters.hpp
@@ -2,7 +2,7 @@
 
 #include "common/types.hpp"
 #include "common/utils.hpp"
-#include "pldmd/dbus_impl_requester.hpp"
+#include "pldmd/instance_id.hpp"
 #include "requester/handler.hpp"
 
 #include <phosphor-logging/lg2.hpp>
@@ -74,7 +74,7 @@
     virtual ~HostEffecterParser() = default;
 
     /** @brief Constructor to create a HostEffecterParser object.
-     *  @param[in] requester - PLDM Requester object pointer
+     *  @param[in] instanceIdDb - PLDM InstanceIdDb object pointer
      *  @param[in] fd - socket fd to communicate to host
      *  @param[in] repo -  PLDM PDR repository
      *  @param[in] dbusHandler - D-bus Handler
@@ -82,11 +82,11 @@
      *  @param[in] handler - PLDM request handler
      */
     explicit HostEffecterParser(
-        pldm::dbus_api::Requester* requester, int fd, const pldm_pdr* repo,
+        pldm::InstanceIdDb* instanceIdDb, int fd, const pldm_pdr* repo,
         pldm::utils::DBusHandler* const dbusHandler,
         const std::string& jsonPath,
         pldm::requester::Handler<pldm::requester::Request>* handler) :
-        requester(requester),
+        instanceIdDb(instanceIdDb),
         sockFd(fd), pdrRepo(repo), dbusHandler(dbusHandler), handler(handler)
     {
         try
@@ -173,10 +173,10 @@
                                          uint16_t effecterId);
 
   protected:
-    pldm::dbus_api::Requester*
-        requester;           //!< Reference to Requester to obtain instance id
-    int sockFd;              //!< Socket fd to send message to host
-    const pldm_pdr* pdrRepo; //!< Reference to PDR repo
+    pldm::InstanceIdDb* instanceIdDb; //!< Reference to the InstanceIdDb object
+                                      //!< to obtain instance id
+    int sockFd;                       //!< Socket fd to send message to host
+    const pldm_pdr* pdrRepo;          //!< Reference to PDR repo
     std::vector<EffecterInfo> hostEffecterInfo; //!< Parsed effecter information
     std::vector<std::unique_ptr<sdbusplus::bus::match_t>>
         effecterInfoMatch; //!< vector to catch the D-Bus property change
diff --git a/host-bmc/host_pdr_handler.cpp b/host-bmc/host_pdr_handler.cpp
index a5ecced..1b0024c 100644
--- a/host-bmc/host_pdr_handler.cpp
+++ b/host-bmc/host_pdr_handler.cpp
@@ -18,7 +18,6 @@
 
 namespace pldm
 {
-using namespace pldm::dbus_api;
 using namespace pldm::responder::events;
 using namespace pldm::utils;
 using namespace sdbusplus::bus::match::rules;
@@ -50,12 +49,13 @@
 HostPDRHandler::HostPDRHandler(
     int mctp_fd, uint8_t mctp_eid, sdeventplus::Event& event, pldm_pdr* repo,
     const std::string& eventsJsonsDir, pldm_entity_association_tree* entityTree,
-    pldm_entity_association_tree* bmcEntityTree, Requester& requester,
+    pldm_entity_association_tree* bmcEntityTree,
+    pldm::InstanceIdDb& instanceIdDb,
     pldm::requester::Handler<pldm::requester::Request>* handler) :
     mctp_fd(mctp_fd),
     mctp_eid(mctp_eid), event(event), repo(repo),
     stateSensorHandler(eventsJsonsDir), entityTree(entityTree),
-    bmcEntityTree(bmcEntityTree), requester(requester), handler(handler)
+    bmcEntityTree(bmcEntityTree), instanceIdDb(instanceIdDb), handler(handler)
 {
     fs::path hostFruJson(fs::path(HOST_JSONS_DIR) / fruJson);
     if (fs::exists(hostFruJson))
@@ -172,14 +172,14 @@
     {
         recordHandle = nextRecordHandle;
     }
-    auto instanceId = requester.getInstanceId(mctp_eid);
+    auto instanceId = instanceIdDb.next(mctp_eid);
 
     auto rc = encode_get_pdr_req(instanceId, recordHandle, 0,
                                  PLDM_GET_FIRSTPART, UINT16_MAX, 0, request,
                                  PLDM_GET_PDR_REQ_BYTES);
     if (rc != PLDM_SUCCESS)
     {
-        requester.markFree(mctp_eid, instanceId);
+        instanceIdDb.free(mctp_eid, instanceId);
         error("Failed to encode_get_pdr_req, rc = {RC}", "RC", rc);
         return;
     }
@@ -313,7 +313,7 @@
               "RC", rc);
         return;
     }
-    auto instanceId = requester.getInstanceId(mctp_eid);
+    auto instanceId = instanceIdDb.next(mctp_eid);
     std::vector<uint8_t> requestMsg(sizeof(pldm_msg_hdr) +
                                     PLDM_PLATFORM_EVENT_MESSAGE_MIN_REQ_BYTES +
                                     actualSize);
@@ -324,7 +324,7 @@
         actualSize + PLDM_PLATFORM_EVENT_MESSAGE_MIN_REQ_BYTES);
     if (rc != PLDM_SUCCESS)
     {
-        requester.markFree(mctp_eid, instanceId);
+        instanceIdDb.free(mctp_eid, instanceId);
         error("Failed to encode_platform_event_message_req, rc = {RC}", "RC",
               rc);
         return;
@@ -600,7 +600,7 @@
 void HostPDRHandler::setHostFirmwareCondition()
 {
     responseReceived = false;
-    auto instanceId = requester.getInstanceId(mctp_eid);
+    auto instanceId = instanceIdDb.next(mctp_eid);
     std::vector<uint8_t> requestMsg(sizeof(pldm_msg_hdr) +
                                     PLDM_GET_VERSION_REQ_BYTES);
     auto request = reinterpret_cast<pldm_msg*>(requestMsg.data());
@@ -610,7 +610,7 @@
     {
         error("GetPLDMVersion encode failure. PLDM error code = {RC}", "RC",
               lg2::hex, rc);
-        requester.markFree(mctp_eid, instanceId);
+        instanceIdDb.free(mctp_eid, instanceId);
         return;
     }
 
@@ -672,7 +672,7 @@
                 sensorRearm.byte = 0;
                 uint8_t tid = std::get<0>(terminusInfo);
 
-                auto instanceId = requester.getInstanceId(mctp_eid);
+                auto instanceId = instanceIdDb.next(mctp_eid);
                 std::vector<uint8_t> requestMsg(
                     sizeof(pldm_msg_hdr) +
                     PLDM_GET_STATE_SENSOR_READINGS_REQ_BYTES);
@@ -682,7 +682,7 @@
 
                 if (rc != PLDM_SUCCESS)
                 {
-                    requester.markFree(mctp_eid, instanceId);
+                    instanceIdDb.free(mctp_eid, instanceId);
                     error(
                         "Failed to encode_get_state_sensor_readings_req, rc = {RC}",
                         "RC", rc);
diff --git a/host-bmc/host_pdr_handler.hpp b/host-bmc/host_pdr_handler.hpp
index 64f2442..15ce1ac 100644
--- a/host-bmc/host_pdr_handler.hpp
+++ b/host-bmc/host_pdr_handler.hpp
@@ -4,7 +4,7 @@
 #include "common/utils.hpp"
 #include "libpldmresponder/event_parser.hpp"
 #include "libpldmresponder/pdr_utils.hpp"
-#include "pldmd/dbus_impl_requester.hpp"
+#include "pldmd/instance_id.hpp"
 #include "requester/handler.hpp"
 
 #include <libpldm/base.h>
@@ -83,7 +83,7 @@
      *  @param[in] eventsJsonDir - directory path which has the config JSONs
      *  @param[in] entityTree - Pointer to BMC and Host entity association tree
      *  @param[in] bmcEntityTree - pointer to BMC's entity association tree
-     *  @param[in] requester - reference to Requester object
+     *  @param[in] instanceIdDb - reference to an InstanceIdDb object
      *  @param[in] handler - PLDM request handler
      */
     explicit HostPDRHandler(
@@ -91,7 +91,7 @@
         pldm_pdr* repo, const std::string& eventsJsonsDir,
         pldm_entity_association_tree* entityTree,
         pldm_entity_association_tree* bmcEntityTree,
-        pldm::dbus_api::Requester& requester,
+        pldm::InstanceIdDb& instanceIdDb,
         pldm::requester::Handler<pldm::requester::Request>* handler);
 
     /** @brief fetch PDRs from host firmware. See @class.
@@ -230,10 +230,10 @@
     /** @brief Pointer to BMC's entity association tree */
     pldm_entity_association_tree* bmcEntityTree;
 
-    /** @brief reference to Requester object, primarily used to access API to
-     *  obtain PLDM instance id.
+    /** @brief reference to Instance ID database object, used to obtain PLDM
+     * instance IDs
      */
-    pldm::dbus_api::Requester& requester;
+    pldm::InstanceIdDb& instanceIdDb;
 
     /** @brief PLDM request handler */
     pldm::requester::Handler<pldm::requester::Request>* handler;
diff --git a/host-bmc/test/dbus_to_host_effecter_test.cpp b/host-bmc/test/dbus_to_host_effecter_test.cpp
index bb9fc13..5c62e31 100644
--- a/host-bmc/test/dbus_to_host_effecter_test.cpp
+++ b/host-bmc/test/dbus_to_host_effecter_test.cpp
@@ -10,7 +10,6 @@
 
 using namespace pldm::host_effecters;
 using namespace pldm::utils;
-using namespace pldm::dbus_api;
 
 class MockHostEffecterParser : public HostEffecterParser
 {
diff --git a/libpldmresponder/base.cpp b/libpldmresponder/base.cpp
index dd0e94a..e5bbf2f 100644
--- a/libpldmresponder/base.cpp
+++ b/libpldmresponder/base.cpp
@@ -184,7 +184,7 @@
     std::vector<uint8_t> requestMsg(sizeof(pldm_msg_hdr) +
                                     PLDM_SET_EVENT_RECEIVER_REQ_BYTES);
     auto request = reinterpret_cast<pldm_msg*>(requestMsg.data());
-    auto instanceId = requester.getInstanceId(eid);
+    auto instanceId = instanceIdDb.next(eid);
     uint8_t eventMessageGlobalEnable =
         PLDM_EVENT_MESSAGE_GLOBAL_ENABLE_ASYNC_KEEP_ALIVE;
     uint8_t transportProtocolType = PLDM_TRANSPORT_PROTOCOL_TYPE_MCTP;
@@ -196,7 +196,7 @@
         eventReceiverAddressInfo, heartbeatTimer, request);
     if (rc != PLDM_SUCCESS)
     {
-        requester.markFree(eid, instanceId);
+        instanceIdDb.free(eid, instanceId);
         error("Failed to encode_set_event_receiver_req, rc = {RC}", "RC",
               lg2::hex, rc);
         return;
diff --git a/libpldmresponder/base.hpp b/libpldmresponder/base.hpp
index 9a13f2d..2f7c714 100644
--- a/libpldmresponder/base.hpp
+++ b/libpldmresponder/base.hpp
@@ -13,7 +13,6 @@
 
 #include <vector>
 
-using namespace pldm::dbus_api;
 using namespace pldm::responder;
 
 namespace pldm
@@ -25,11 +24,12 @@
 class Handler : public CmdHandler
 {
   public:
-    Handler(uint8_t eid, Requester& requester, sdeventplus::Event& event,
+    Handler(uint8_t eid, pldm::InstanceIdDb& instanceIdDb,
+            sdeventplus::Event& event,
             pldm::responder::oem_platform::Handler* oemPlatformHandler,
             pldm::requester::Handler<pldm::requester::Request>* handler) :
         eid(eid),
-        requester(requester), event(event),
+        instanceIdDb(instanceIdDb), event(event),
         oemPlatformHandler(oemPlatformHandler), handler(handler)
     {
         handlers.emplace(PLDM_GET_PLDM_TYPES,
@@ -94,10 +94,8 @@
     /** @brief MCTP EID of host firmware */
     uint8_t eid;
 
-    /** @brief reference to Requester object, primarily used to access API to
-     *  obtain PLDM instance id.
-     */
-    Requester& requester;
+    /** @brief An instance ID database for allocating instance IDs. */
+    InstanceIdDb& instanceIdDb;
 
     /** @brief reference of main event loop of pldmd, primarily used to schedule
      *  work
diff --git a/libpldmresponder/bios.cpp b/libpldmresponder/bios.cpp
index e2e4e52..4c46b9a 100644
--- a/libpldmresponder/bios.cpp
+++ b/libpldmresponder/bios.cpp
@@ -69,10 +69,10 @@
 
 DBusHandler dbusHandler;
 
-Handler::Handler(int fd, uint8_t eid, dbus_api::Requester* requester,
+Handler::Handler(int fd, uint8_t eid, pldm::InstanceIdDb* instanceIdDb,
                  pldm::requester::Handler<pldm::requester::Request>* handler) :
     biosConfig(BIOS_JSONS_DIR, BIOS_TABLES_DIR, &dbusHandler, fd, eid,
-               requester, handler)
+               instanceIdDb, handler)
 {
     biosConfig.removeTables();
     biosConfig.buildTables();
diff --git a/libpldmresponder/bios.hpp b/libpldmresponder/bios.hpp
index d77e9c8..f72c9e8 100644
--- a/libpldmresponder/bios.hpp
+++ b/libpldmresponder/bios.hpp
@@ -4,8 +4,8 @@
 
 #include "bios_config.hpp"
 #include "bios_table.hpp"
-#include "pldmd/dbus_impl_requester.hpp"
 #include "pldmd/handler.hpp"
+#include "pldmd/instance_id.hpp"
 #include "requester/handler.hpp"
 
 #include <libpldm/bios.h>
@@ -33,10 +33,10 @@
      *
      *  @param[in] fd - socket descriptor to communicate to host
      *  @param[in] eid - MCTP EID of host firmware
-     *  @param[in] requester - pointer to Requester object
+     *  @param[in] instanceIdDb - pointer to an InstanceIdDb object
      *  @param[in] handler - PLDM request handler
      */
-    Handler(int fd, uint8_t eid, dbus_api::Requester* requester,
+    Handler(int fd, uint8_t eid, pldm::InstanceIdDb* instanceIdDb,
             pldm::requester::Handler<pldm::requester::Request>* handler);
 
     /** @brief Handler for GetDateTime
diff --git a/libpldmresponder/bios_config.cpp b/libpldmresponder/bios_config.cpp
index 716b0dc..69a98f4 100644
--- a/libpldmresponder/bios_config.cpp
+++ b/libpldmresponder/bios_config.cpp
@@ -18,7 +18,6 @@
 
 PHOSPHOR_LOG2_USING;
 
-using namespace pldm::dbus_api;
 using namespace pldm::utils;
 
 namespace pldm
@@ -44,11 +43,11 @@
 
 BIOSConfig::BIOSConfig(
     const char* jsonDir, const char* tableDir, DBusHandler* const dbusHandler,
-    int fd, uint8_t eid, dbus_api::Requester* requester,
+    int fd, uint8_t eid, pldm::InstanceIdDb* instanceIdDb,
     pldm::requester::Handler<pldm::requester::Request>* handler) :
     jsonDir(jsonDir),
     tableDir(tableDir), dbusHandler(dbusHandler), fd(fd), eid(eid),
-    requester(requester), handler(handler)
+    instanceIdDb(instanceIdDb), handler(handler)
 
 {
     fs::create_directories(tableDir);
@@ -1042,7 +1041,7 @@
     {
 #ifdef OEM_IBM
         auto rc = pldm::responder::platform::sendBiosAttributeUpdateEvent(
-            eid, requester, listOfHandles, handler);
+            eid, instanceIdDb, listOfHandles, handler);
         if (rc != PLDM_SUCCESS)
         {
             return;
diff --git a/libpldmresponder/bios_config.hpp b/libpldmresponder/bios_config.hpp
index 2d07593..6e27642 100644
--- a/libpldmresponder/bios_config.hpp
+++ b/libpldmresponder/bios_config.hpp
@@ -2,7 +2,7 @@
 
 #include "bios_attribute.hpp"
 #include "bios_table.hpp"
-#include "pldmd/dbus_impl_requester.hpp"
+#include "pldmd/instance_id.hpp"
 #include "requester/handler.hpp"
 
 #include <libpldm/bios_table.h>
@@ -74,13 +74,13 @@
      *  @param[in] dbusHandler - Dbus Handler
      *  @param[in] fd - socket descriptor to communicate to host
      *  @param[in] eid - MCTP EID of host firmware
-     *  @param[in] requester - pointer to Requester object
+     *  @param[in] instanceIdDb - pointer to an InstanceIdDb object
      *  @param[in] handler - PLDM request handler
      */
     explicit BIOSConfig(
         const char* jsonDir, const char* tableDir,
         pldm::utils::DBusHandler* const dbusHandler, int fd, uint8_t eid,
-        dbus_api::Requester* requester,
+        pldm::InstanceIdDb* instanceIdDb,
         pldm::requester::Handler<pldm::requester::Request>* handler);
 
     /** @brief Set attribute value on dbus and attribute value table
@@ -146,10 +146,10 @@
     /** @brief MCTP EID of host firmware */
     uint8_t eid;
 
-    /** @brief pointer to Requester object, primarily used to access API to
-     *  obtain PLDM instance id.
+    /** @brief pointer to an Instance ID database object, used to obtain PLDM
+     * instance IDs.
      */
-    dbus_api::Requester* requester;
+    pldm::InstanceIdDb* instanceIdDb;
 
     /** @brief PLDM request handler */
     pldm::requester::Handler<pldm::requester::Request>* handler;
diff --git a/libpldmresponder/test/libpldmresponder_base_test.cpp b/libpldmresponder/test/libpldmresponder_base_test.cpp
index f1ecfc3..8931f0c 100644
--- a/libpldmresponder/test/libpldmresponder_base_test.cpp
+++ b/libpldmresponder/test/libpldmresponder_base_test.cpp
@@ -18,14 +18,11 @@
 {
   protected:
     TestBaseCommands() :
-        instanceIdDb(), requester(pldm::utils::DBusHandler::getBus(),
-                                  "/abc/def", this->instanceIdDb),
-        event(sdeventplus::Event::get_default())
+        instanceIdDb(), event(sdeventplus::Event::get_default())
     {}
 
     uint8_t mctpEid = 0;
     TestInstanceIdDb instanceIdDb;
-    Requester requester;
     sdeventplus::Event event;
 };
 
@@ -35,7 +32,7 @@
     auto request = reinterpret_cast<pldm_msg*>(requestPayload.data());
     // payload length will be 0 in this case
     size_t requestPayloadLength = 0;
-    base::Handler handler(mctpEid, requester, event, nullptr, nullptr);
+    base::Handler handler(mctpEid, instanceIdDb, event, nullptr, nullptr);
     auto response = handler.getPLDMTypes(request, requestPayloadLength);
     // Need to support OEM type.
     auto responsePtr = reinterpret_cast<pldm_msg*>(response.data());
@@ -52,7 +49,7 @@
         requestPayload{};
     auto request = reinterpret_cast<pldm_msg*>(requestPayload.data());
     size_t requestPayloadLength = requestPayload.size() - sizeof(pldm_msg_hdr);
-    base::Handler handler(mctpEid, requester, event, nullptr, nullptr);
+    base::Handler handler(mctpEid, instanceIdDb, event, nullptr, nullptr);
     auto response = handler.getPLDMCommands(request, requestPayloadLength);
     auto responsePtr = reinterpret_cast<pldm_msg*>(response.data());
     uint8_t* payload_ptr = responsePtr->payload;
@@ -69,7 +66,7 @@
 
     request->payload[0] = 0xFF;
     size_t requestPayloadLength = requestPayload.size() - sizeof(pldm_msg_hdr);
-    base::Handler handler(mctpEid, requester, event, nullptr, nullptr);
+    base::Handler handler(mctpEid, instanceIdDb, event, nullptr, nullptr);
     auto response = handler.getPLDMCommands(request, requestPayloadLength);
     auto responsePtr = reinterpret_cast<pldm_msg*>(response.data());
     uint8_t* payload_ptr = responsePtr->payload;
@@ -94,7 +91,7 @@
 
     ASSERT_EQ(0, rc);
 
-    base::Handler handler(mctpEid, requester, event, nullptr, nullptr);
+    base::Handler handler(mctpEid, instanceIdDb, event, nullptr, nullptr);
     auto response = handler.getPLDMVersion(request, requestPayloadLength);
     auto responsePtr = reinterpret_cast<pldm_msg*>(response.data());
 
@@ -125,7 +122,7 @@
 
     ASSERT_EQ(0, rc);
 
-    base::Handler handler(mctpEid, requester, event, nullptr, nullptr);
+    base::Handler handler(mctpEid, instanceIdDb, event, nullptr, nullptr);
     auto response = handler.getPLDMVersion(request, requestPayloadLength - 1);
     auto responsePtr = reinterpret_cast<pldm_msg*>(response.data());
 
@@ -150,7 +147,7 @@
     auto request = reinterpret_cast<pldm_msg*>(requestPayload.data());
     size_t requestPayloadLength = 0;
 
-    base::Handler handler(mctpEid, requester, event, nullptr, nullptr);
+    base::Handler handler(mctpEid, instanceIdDb, event, nullptr, nullptr);
     auto response = handler.getTID(request, requestPayloadLength);
 
     auto responsePtr = reinterpret_cast<pldm_msg*>(response.data());
diff --git a/oem/ibm/libpldmresponder/file_io.hpp b/oem/ibm/libpldmresponder/file_io.hpp
index 4e2af4f..aa3b9a9 100644
--- a/oem/ibm/libpldmresponder/file_io.hpp
+++ b/oem/ibm/libpldmresponder/file_io.hpp
@@ -170,11 +170,11 @@
 {
   public:
     Handler(oem_platform::Handler* oemPlatformHandler, int hostSockFd,
-            uint8_t hostEid, dbus_api::Requester* dbusImplReqester,
+            uint8_t hostEid, pldm::InstanceIdDb* instanceIdDb,
             pldm::requester::Handler<pldm::requester::Request>* handler) :
         oemPlatformHandler(oemPlatformHandler),
-        hostSockFd(hostSockFd), hostEid(hostEid),
-        dbusImplReqester(dbusImplReqester), handler(handler)
+        hostSockFd(hostSockFd), hostEid(hostEid), instanceIdDb(instanceIdDb),
+        handler(handler)
     {
         handlers.emplace(PLDM_READ_FILE_INTO_MEMORY,
                          [this](const pldm_msg* request, size_t payloadLength) {
@@ -229,7 +229,7 @@
             pldm::utils::DBusHandler::getBus(),
             sdbusplus::bus::match::rules::interfacesAdded() +
                 sdbusplus::bus::match::rules::argNpath(0, dumpObjPath),
-            [this, hostSockFd, hostEid, dbusImplReqester,
+            [this, hostSockFd, hostEid, instanceIdDb,
              handler](sdbusplus::message_t& msg) {
             std::map<std::string,
                      std::map<std::string, std::variant<std::string, uint32_t>>>
@@ -258,7 +258,7 @@
                         .emplace_back(
                             std::make_unique<
                                 pldm::requester::oem_ibm::DbusToFileHandler>(
-                                hostSockFd, hostEid, dbusImplReqester, path,
+                                hostSockFd, hostEid, instanceIdDb, path,
                                 handler))
                         ->processNewResourceDump(vspstring, password);
                     break;
@@ -269,7 +269,7 @@
             pldm::utils::DBusHandler::getBus(),
             sdbusplus::bus::match::rules::interfacesAdded() +
                 sdbusplus::bus::match::rules::argNpath(0, certObjPath),
-            [this, hostSockFd, hostEid, dbusImplReqester,
+            [this, hostSockFd, hostEid, instanceIdDb,
              handler](sdbusplus::message_t& msg) {
             std::map<std::string,
                      std::map<std::string, std::variant<std::string, uint32_t>>>
@@ -295,8 +295,8 @@
                                 .emplace_back(
                                     std::make_unique<pldm::requester::oem_ibm::
                                                          DbusToFileHandler>(
-                                        hostSockFd, hostEid, dbusImplReqester,
-                                        path, handler))
+                                        hostSockFd, hostEid, instanceIdDb, path,
+                                        handler))
                                 ->newCsrFileAvailable(csr, fileHandle);
                             break;
                         }
@@ -408,7 +408,7 @@
     oem_platform::Handler* oemPlatformHandler;
     int hostSockFd;
     uint8_t hostEid;
-    dbus_api::Requester* dbusImplReqester;
+    pldm::InstanceIdDb* instanceIdDb;
     using DBusInterfaceAdded = std::vector<std::pair<
         std::string,
         std::vector<std::pair<std::string, std::variant<std::string>>>>>;
diff --git a/oem/ibm/libpldmresponder/oem_ibm_handler.cpp b/oem/ibm/libpldmresponder/oem_ibm_handler.cpp
index fd1b0c4..c4befbb 100644
--- a/oem/ibm/libpldmresponder/oem_ibm_handler.cpp
+++ b/oem/ibm/libpldmresponder/oem_ibm_handler.cpp
@@ -368,7 +368,7 @@
     eventClass->sensor_offset = sensorOffset;
     eventClass->event_state = eventState;
     eventClass->previous_event_state = prevEventState;
-    auto instanceId = requester.getInstanceId(mctp_eid);
+    auto instanceId = instanceIdDb.next(mctp_eid);
     std::vector<uint8_t> requestMsg(sizeof(pldm_msg_hdr) +
                                     PLDM_PLATFORM_EVENT_MESSAGE_MIN_REQ_BYTES +
                                     sensorEventDataVec.size());
@@ -377,7 +377,7 @@
     if (rc != PLDM_SUCCESS)
     {
         error("Failed to encode state sensor event, rc = {RC}", "RC", rc);
-        requester.markFree(mctp_eid, instanceId);
+        instanceIdDb.free(mctp_eid, instanceId);
         return;
     }
     rc = sendEventToHost(requestMsg, instanceId);
diff --git a/oem/ibm/libpldmresponder/oem_ibm_handler.hpp b/oem/ibm/libpldmresponder/oem_ibm_handler.hpp
index 4de6835..520d060 100644
--- a/oem/ibm/libpldmresponder/oem_ibm_handler.hpp
+++ b/oem/ibm/libpldmresponder/oem_ibm_handler.hpp
@@ -31,12 +31,13 @@
   public:
     Handler(const pldm::utils::DBusHandler* dBusIntf,
             pldm::responder::CodeUpdate* codeUpdate, int mctp_fd,
-            uint8_t mctp_eid, pldm::dbus_api::Requester& requester,
+            uint8_t mctp_eid, pldm::InstanceIdDb& instanceIdDb,
             sdeventplus::Event& event,
             pldm::requester::Handler<pldm::requester::Request>* handler) :
         oem_platform::Handler(dBusIntf),
         codeUpdate(codeUpdate), platformHandler(nullptr), mctp_fd(mctp_fd),
-        mctp_eid(mctp_eid), requester(requester), event(event), handler(handler)
+        mctp_eid(mctp_eid), instanceIdDb(instanceIdDb), event(event),
+        handler(handler)
     {
         codeUpdate->setVersions();
         setEventReceiverCnt = 0;
@@ -192,10 +193,9 @@
     /** @brief MCTP EID of host firmware */
     uint8_t mctp_eid;
 
-    /** @brief reference to Requester object, primarily used to access API to
-     *  obtain PLDM instance id.
-     */
-    pldm::dbus_api::Requester& requester;
+    /** @brief reference to an InstanceIdDb object, used to obtain a PLDM
+     * instance id. */
+    pldm::InstanceIdDb& instanceIdDb;
     /** @brief sdeventplus event source */
     std::unique_ptr<sdeventplus::source::Defer> assembleImageEvent;
     std::unique_ptr<sdeventplus::source::Defer> startUpdateEvent;
diff --git a/oem/ibm/libpldmresponder/platform_oem_ibm.cpp b/oem/ibm/libpldmresponder/platform_oem_ibm.cpp
index e7966a2..022404c 100644
--- a/oem/ibm/libpldmresponder/platform_oem_ibm.cpp
+++ b/oem/ibm/libpldmresponder/platform_oem_ibm.cpp
@@ -20,7 +20,7 @@
 namespace platform
 {
 int sendBiosAttributeUpdateEvent(
-    uint8_t eid, dbus_api::Requester* requester,
+    uint8_t eid, pldm::InstanceIdDb* instanceIdDb,
     const std::vector<uint16_t>& handles,
     pldm::requester::Handler<pldm::requester::Request>* handler)
 {
@@ -61,7 +61,7 @@
             "EXCEP_NAME", e.name());
     }
 
-    auto instanceId = requester->getInstanceId(eid);
+    auto instanceId = instanceIdDb->next(eid);
 
     std::vector<uint8_t> requestMsg(
         sizeof(pldm_msg_hdr) + sizeof(pldm_bios_attribute_update_event_req) -
@@ -79,7 +79,7 @@
         error(
             "BIOS Attribute update event message encode failure. PLDM error code = {RC}",
             "RC", lg2::hex, rc);
-        requester->markFree(eid, instanceId);
+        instanceIdDb->free(eid, instanceId);
         return rc;
     }
 
diff --git a/oem/ibm/libpldmresponder/platform_oem_ibm.hpp b/oem/ibm/libpldmresponder/platform_oem_ibm.hpp
index 94dc2dd..13ec2d5 100644
--- a/oem/ibm/libpldmresponder/platform_oem_ibm.hpp
+++ b/oem/ibm/libpldmresponder/platform_oem_ibm.hpp
@@ -1,6 +1,6 @@
 #pragma once
 
-#include "pldmd/dbus_impl_requester.hpp"
+#include "pldmd/instance_id.hpp"
 #include "requester/handler.hpp"
 
 #include <vector>
@@ -20,12 +20,12 @@
  *  list of BIOS attribute handles.
  *
  *  @param[in] eid - MCTP EID of host firmware
- *  @param[in] requester - pointer to Requester object
+ *  @param[in] instanceIdDb - pointer to InstanceIdDb object
  *  @param[in] handles - List of BIOS attribute handles
  *  @param[in] handler - PLDM request handler
  */
 int sendBiosAttributeUpdateEvent(
-    uint8_t eid, dbus_api::Requester* requester,
+    uint8_t eid, pldm::InstanceIdDb* instanceIdDb,
     const std::vector<uint16_t>& handles,
     pldm::requester::Handler<pldm::requester::Request>* handler);
 
diff --git a/oem/ibm/requester/dbus_to_file_handler.cpp b/oem/ibm/requester/dbus_to_file_handler.cpp
index e71116a..9c2b80a 100644
--- a/oem/ibm/requester/dbus_to_file_handler.cpp
+++ b/oem/ibm/requester/dbus_to_file_handler.cpp
@@ -27,25 +27,25 @@
     "xyz.openbmc_project.Common.Progress.OperationStatus.Failed";
 
 DbusToFileHandler::DbusToFileHandler(
-    int mctp_fd, uint8_t mctp_eid, dbus_api::Requester* requester,
+    int mctp_fd, uint8_t mctp_eid, pldm::InstanceIdDb* instanceIdDb,
     sdbusplus::message::object_path resDumpCurrentObjPath,
     pldm::requester::Handler<pldm::requester::Request>* handler) :
     mctp_fd(mctp_fd),
-    mctp_eid(mctp_eid), requester(requester),
+    mctp_eid(mctp_eid), instanceIdDb(instanceIdDb),
     resDumpCurrentObjPath(resDumpCurrentObjPath), handler(handler)
 {}
 
 void DbusToFileHandler::sendNewFileAvailableCmd(uint64_t fileSize)
 {
-    if (requester == NULL)
+    if (instanceIdDb == NULL)
     {
         error(
-            "Failed to send resource dump parameters as requester is not set");
+            "Failed to send resource dump parameters as instance ID DB is not set");
         pldm::utils::reportError(
             "xyz.openbmc_project.bmc.pldm.InternalFailure");
         return;
     }
-    auto instanceId = requester->getInstanceId(mctp_eid);
+    auto instanceId = instanceIdDb->next(mctp_eid);
     std::vector<uint8_t> requestMsg(sizeof(pldm_msg_hdr) +
                                     PLDM_NEW_FILE_REQ_BYTES);
     auto request = reinterpret_cast<pldm_msg*>(requestMsg.data());
@@ -57,7 +57,7 @@
                                   fileHandle, fileSize, request);
     if (rc != PLDM_SUCCESS)
     {
-        requester->markFree(mctp_eid, instanceId);
+        instanceIdDb->free(mctp_eid, instanceId);
         error("Failed to encode_new_file_req, rc = {RC}", "RC", rc);
         return;
     }
@@ -247,14 +247,14 @@
                                                    const uint32_t fileHandle,
                                                    const uint16_t type)
 {
-    if (requester == NULL)
+    if (instanceIdDb == NULL)
     {
         error("Failed to send csr to host.");
         pldm::utils::reportError(
             "xyz.openbmc_project.bmc.pldm.InternalFailure");
         return;
     }
-    auto instanceId = requester->getInstanceId(mctp_eid);
+    auto instanceId = instanceIdDb->next(mctp_eid);
     std::vector<uint8_t> requestMsg(sizeof(pldm_msg_hdr) +
                                     PLDM_NEW_FILE_REQ_BYTES);
     auto request = reinterpret_cast<pldm_msg*>(requestMsg.data());
@@ -263,7 +263,7 @@
                                   request);
     if (rc != PLDM_SUCCESS)
     {
-        requester->markFree(mctp_eid, instanceId);
+        instanceIdDb->free(mctp_eid, instanceId);
         error("Failed to encode_new_file_req, rc = {RC}", "RC", rc);
         return;
     }
diff --git a/oem/ibm/requester/dbus_to_file_handler.hpp b/oem/ibm/requester/dbus_to_file_handler.hpp
index 60f1b70..a2ba166 100644
--- a/oem/ibm/requester/dbus_to_file_handler.hpp
+++ b/oem/ibm/requester/dbus_to_file_handler.hpp
@@ -1,6 +1,6 @@
 #pragma once
 
-#include "pldmd/dbus_impl_requester.hpp"
+#include "pldmd/instance_id.hpp"
 #include "requester/handler.hpp"
 
 #include <libpldm/platform.h>
@@ -34,12 +34,12 @@
     /** @brief Constructor
      *  @param[in] mctp_fd - fd of MCTP communications socket
      *  @param[in] mctp_eid - MCTP EID of host firmware
-     *  @param[in] requester - pointer to a Requester object
+     *  @param[in] instanceIdDb - pointer to a InstanceIdDb object
      *  @param[in] resDumpCurrentObjPath - resource dump current object path
      *  @param[in] handler - PLDM request handler
      */
     DbusToFileHandler(
-        int mctp_fd, uint8_t mctp_eid, dbus_api::Requester* requester,
+        int mctp_fd, uint8_t mctp_eid, pldm::InstanceIdDb* instanceIdDb,
         sdbusplus::message::object_path resDumpCurrentObjPath,
         pldm::requester::Handler<pldm::requester::Request>* handler);
 
@@ -85,10 +85,8 @@
     /** @brief MCTP EID of host firmware */
     uint8_t mctp_eid;
 
-    /** @brief Pointer to a Requester object, primarily used to access API to
-     *  obtain PLDM instance id.
-     */
-    dbus_api::Requester* requester;
+    /** @brief Pointer to an InstanceIdDb used to obtain PLDM instance id. */
+    pldm::InstanceIdDb* instanceIdDb;
 
     /** @brief Hold the current resource dump object path */
     sdbusplus::message::object_path resDumpCurrentObjPath;
diff --git a/oem/ibm/test/libpldmresponder_oem_platform_test.cpp b/oem/ibm/test/libpldmresponder_oem_platform_test.cpp
index ca9dd66..bb157f2 100644
--- a/oem/ibm/test/libpldmresponder_oem_platform_test.cpp
+++ b/oem/ibm/test/libpldmresponder_oem_platform_test.cpp
@@ -15,7 +15,6 @@
 
 #include <iostream>
 
-using namespace pldm::dbus_api;
 using namespace pldm::utils;
 using namespace pldm::responder;
 using namespace pldm::responder::pdr;
@@ -37,10 +36,10 @@
   public:
     MockOemPlatformHandler(const pldm::utils::DBusHandler* dBusIntf,
                            pldm::responder::CodeUpdate* codeUpdate, int mctp_fd,
-                           uint8_t mctp_eid, Requester& requester,
+                           uint8_t mctp_eid, pldm::InstanceIdDb& instanceIdDb,
                            sdeventplus::Event& event) :
         oem_ibm_platform::Handler(dBusIntf, codeUpdate, mctp_fd, mctp_eid,
-                                  requester, event, nullptr)
+                                  instanceIdDb, event, nullptr)
     {}
     MOCK_METHOD(uint16_t, getNextEffecterId, ());
     MOCK_METHOD(uint16_t, getNextSensorId, ());
@@ -56,7 +55,6 @@
     TestInstanceIdDb instanceIdDb;
 
     sdbusplus::bus_t bus(sdbusplus::bus::new_default());
-    Requester requester(bus, "/abc/def", instanceIdDb);
     auto event = sdeventplus::Event::get_default();
     std::vector<get_sensor_state_field> stateField;
 
@@ -66,8 +64,8 @@
     std::unique_ptr<oem_platform::Handler> oemPlatformHandler{};
 
     oemPlatformHandler = std::make_unique<oem_ibm_platform::Handler>(
-        mockDbusHandler.get(), mockCodeUpdate.get(), 0x1, 0x9, requester, event,
-        nullptr);
+        mockDbusHandler.get(), mockCodeUpdate.get(), 0x1, 0x9, instanceIdDb,
+        event, nullptr);
 
     auto rc = oemPlatformHandler->getOemStateSensorReadingsHandler(
         entityID_, entityInstance_, stateSetId_, compSensorCnt_, stateField);
@@ -191,7 +189,6 @@
     sdbusplus::bus_t bus(sdbusplus::bus::new_default());
     std::filesystem::path dbPath;
     TestInstanceIdDb instanceIdDb;
-    Requester requester(bus, "/abc/def", instanceIdDb);
     auto mockDbusHandler = std::make_unique<MockdBusHandler>();
     auto event = sdeventplus::Event::get_default();
     std::unique_ptr<CodeUpdate> mockCodeUpdate =
@@ -199,7 +196,7 @@
     std::unique_ptr<oem_ibm_platform::Handler> mockoemPlatformHandler =
         std::make_unique<MockOemPlatformHandler>(mockDbusHandler.get(),
                                                  mockCodeUpdate.get(), 0x1, 0x9,
-                                                 requester, event);
+                                                 instanceIdDb, event);
     Repo inRepo(inPDRRepo);
 
     mockoemPlatformHandler->buildOEMPDR(inRepo);
@@ -298,7 +295,6 @@
     sdbusplus::bus_t bus(sdbusplus::bus::new_default());
     std::filesystem::path dbPath;
     TestInstanceIdDb instanceIdDb;
-    Requester requester(bus, "/abc/def", instanceIdDb);
 
     auto mockDbusHandler = std::make_unique<MockdBusHandler>();
     auto event = sdeventplus::Event::get_default();
@@ -307,7 +303,7 @@
     std::unique_ptr<oem_ibm_platform::Handler> mockoemPlatformHandler =
         std::make_unique<MockOemPlatformHandler>(mockDbusHandler.get(),
                                                  mockCodeUpdate.get(), 0x1, 0x9,
-                                                 requester, event);
+                                                 instanceIdDb, event);
     Repo inRepo(inPDRRepo);
     mockoemPlatformHandler->buildOEMPDR(inRepo);
     ASSERT_EQ(inRepo.empty(), false);
diff --git a/pldmd/pldmd.cpp b/pldmd/pldmd.cpp
index 5da52f0..320bd89 100644
--- a/pldmd/pldmd.cpp
+++ b/pldmd/pldmd.cpp
@@ -204,7 +204,7 @@
 
     Invoker invoker{};
     requester::Handler<requester::Request> reqHandler(
-        sockfd, event, dbusImplReq, currentSendbuffSize, verbose);
+        sockfd, event, instanceIdDb, currentSendbuffSize, verbose);
 
 #ifdef LIBPLDMRESPONDER
     using namespace pldm::state_sensor;
@@ -229,17 +229,17 @@
     {
         hostPDRHandler = std::make_shared<HostPDRHandler>(
             sockfd, hostEID, event, pdrRepo.get(), EVENTS_JSONS_DIR,
-            entityTree.get(), bmcEntityTree.get(), dbusImplReq, &reqHandler);
+            entityTree.get(), bmcEntityTree.get(), instanceIdDb, &reqHandler);
         // HostFirmware interface needs access to hostPDR to know if host
         // is running
         dbusImplHost.setHostPdrObj(hostPDRHandler);
 
         hostEffecterParser =
             std::make_unique<pldm::host_effecters::HostEffecterParser>(
-                &dbusImplReq, sockfd, pdrRepo.get(), &dbusHandler,
+                &instanceIdDb, sockfd, pdrRepo.get(), &dbusHandler,
                 HOST_JSONS_DIR, &reqHandler);
         dbusToPLDMEventHandler = std::make_unique<DbusToPLDMEvent>(
-            sockfd, hostEID, dbusImplReq, &reqHandler);
+            sockfd, hostEID, instanceIdDb, &reqHandler);
     }
     std::unique_ptr<oem_platform::Handler> oemPlatformHandler{};
 
@@ -248,16 +248,16 @@
         std::make_unique<pldm::responder::CodeUpdate>(&dbusHandler);
     codeUpdate->clearDirPath(LID_STAGING_DIR);
     oemPlatformHandler = std::make_unique<oem_ibm_platform::Handler>(
-        &dbusHandler, codeUpdate.get(), sockfd, hostEID, dbusImplReq, event,
+        &dbusHandler, codeUpdate.get(), sockfd, hostEID, instanceIdDb, event,
         &reqHandler);
     codeUpdate->setOemPlatformHandler(oemPlatformHandler.get());
     invoker.registerHandler(PLDM_OEM, std::make_unique<oem_ibm::Handler>(
                                           oemPlatformHandler.get(), sockfd,
-                                          hostEID, &dbusImplReq, &reqHandler));
+                                          hostEID, &instanceIdDb, &reqHandler));
 #endif
     invoker.registerHandler(
         PLDM_BIOS, std::make_unique<bios::Handler>(sockfd, hostEID,
-                                                   &dbusImplReq, &reqHandler));
+                                                   &instanceIdDb, &reqHandler));
     auto fruHandler = std::make_unique<fru::Handler>(
         FRU_JSONS_DIR, FRU_MASTER_JSON, pdrRepo.get(), entityTree.get(),
         bmcEntityTree.get());
@@ -278,7 +278,7 @@
     invoker.registerHandler(PLDM_PLATFORM, std::move(platformHandler));
     invoker.registerHandler(
         PLDM_BASE,
-        std::make_unique<base::Handler>(hostEID, dbusImplReq, event,
+        std::make_unique<base::Handler>(hostEID, instanceIdDb, event,
                                         oemPlatformHandler.get(), &reqHandler));
     invoker.registerHandler(PLDM_FRU, std::move(fruHandler));
     dbus_api::Pdr dbusImplPdr(bus, "/xyz/openbmc_project/pldm", pdrRepo.get());
@@ -313,7 +313,7 @@
     }
 
     std::unique_ptr<fw_update::Manager> fwManager =
-        std::make_unique<fw_update::Manager>(event, reqHandler, dbusImplReq);
+        std::make_unique<fw_update::Manager>(event, reqHandler, instanceIdDb);
     std::unique_ptr<MctpDiscovery> mctpDiscoveryHandler =
         std::make_unique<MctpDiscovery>(bus, fwManager.get());
 
diff --git a/requester/handler.hpp b/requester/handler.hpp
index ece1382..9fa5c31 100644
--- a/requester/handler.hpp
+++ b/requester/handler.hpp
@@ -3,7 +3,7 @@
 #include "config.h"
 
 #include "common/types.hpp"
-#include "pldmd/dbus_impl_requester.hpp"
+#include "pldmd/instance_id.hpp"
 #include "request.hpp"
 
 #include <libpldm/base.h>
@@ -91,7 +91,7 @@
      *
      *  @param[in] fd - fd of MCTP communications socket
      *  @param[in] event - reference to PLDM daemon's main event loop
-     *  @param[in] requester - reference to Requester object
+     *  @param[in] instanceIdDb - reference to an InstanceIdDb
      *  @param[in] currentSendbuffSize - current send buffer size
      *  @param[in] verbose - verbose tracing flag
      *  @param[in] instanceIdExpiryInterval - instance ID expiration interval
@@ -99,7 +99,7 @@
      *  @param[in] responseTimeOut - time to wait between each retry
      */
     explicit Handler(
-        int fd, sdeventplus::Event& event, pldm::dbus_api::Requester& requester,
+        int fd, sdeventplus::Event& event, pldm::InstanceIdDb& instanceIdDb,
         int currentSendbuffSize, bool verbose,
         std::chrono::seconds instanceIdExpiryInterval =
             std::chrono::seconds(INSTANCE_ID_EXPIRATION_INTERVAL),
@@ -107,7 +107,7 @@
         std::chrono::milliseconds responseTimeOut =
             std::chrono::milliseconds(RESPONSE_TIME_OUT)) :
         fd(fd),
-        event(event), requester(requester),
+        event(event), instanceIdDb(instanceIdDb),
         currentSendbuffSize(currentSendbuffSize), verbose(verbose),
         instanceIdExpiryInterval(instanceIdExpiryInterval),
         numRetries(numRetries), responseTimeOut(responseTimeOut)
@@ -174,7 +174,7 @@
         auto rc = request->start();
         if (rc)
         {
-            requester.markFree(eid, instanceId);
+            instanceIdDb.free(eid, instanceId);
             error("Failure to send the PLDM request message");
             return rc;
         }
@@ -186,7 +186,7 @@
         }
         catch (const std::runtime_error& e)
         {
-            requester.markFree(eid, instanceId);
+            instanceIdDb.free(eid, instanceId);
             error(
                 "Failed to start the instance ID expiry timer. RC = {ERR_EXCEP}",
                 "ERR_EXCEP", e.what());
@@ -224,7 +224,7 @@
                       "RC", static_cast<int>(rc));
             }
             responseHandler(eid, response, respMsgLen);
-            requester.markFree(key.eid, key.instanceId);
+            instanceIdDb.free(key.eid, key.instanceId);
             handlers.erase(key);
         }
         else
@@ -233,21 +233,21 @@
             // request handler, so freeing up the instance ID, this can be other
             // OpenBMC applications relying on PLDM D-Bus apis like
             // openpower-occ-control and softoff
-            requester.markFree(key.eid, key.instanceId);
+            instanceIdDb.free(key.eid, key.instanceId);
         }
     }
 
   private:
     int fd; //!< file descriptor of MCTP communications socket
     sdeventplus::Event& event; //!< reference to PLDM daemon's main event loop
-    pldm::dbus_api::Requester& requester; //!< reference to Requester object
-    int currentSendbuffSize;              //!< current Send Buffer size
-    bool verbose;                         //!< verbose tracing flag
+    pldm::InstanceIdDb& instanceIdDb; //!< reference to an InstanceIdDb
+    int currentSendbuffSize;          //!< current Send Buffer size
+    bool verbose;                     //!< verbose tracing flag
     std::chrono::seconds
-        instanceIdExpiryInterval;         //!< Instance ID expiration interval
-    uint8_t numRetries;                   //!< number of request retries
+        instanceIdExpiryInterval;     //!< Instance ID expiration interval
+    uint8_t numRetries;               //!< number of request retries
     std::chrono::milliseconds
-        responseTimeOut;                  //!< time to wait between each retry
+        responseTimeOut;              //!< time to wait between each retry
 
     /** @brief Container for storing the details of the PLDM request
      *         message, handler for the corresponding PLDM response and the
@@ -276,7 +276,7 @@
         if (removeRequestContainer.contains(key))
         {
             removeRequestContainer[key].reset();
-            requester.markFree(key.eid, key.instanceId);
+            instanceIdDb.free(key.eid, key.instanceId);
             handlers.erase(key);
             removeRequestContainer.erase(key);
         }
diff --git a/requester/test/handler_test.cpp b/requester/test/handler_test.cpp
index 69facdb..6251974 100644
--- a/requester/test/handler_test.cpp
+++ b/requester/test/handler_test.cpp
@@ -1,7 +1,7 @@
 #include "common/types.hpp"
 #include "common/utils.hpp"
 #include "mock_request.hpp"
-#include "pldmd/dbus_impl_requester.hpp"
+#include "pldmd/instance_id.hpp"
 #include "requester/handler.hpp"
 #include "test/test_instance_id.hpp"
 
@@ -22,17 +22,12 @@
 class HandlerTest : public testing::Test
 {
   protected:
-    HandlerTest() :
-        event(sdeventplus::Event::get_default()), instanceIdDb(),
-        dbusImplReq(pldm::utils::DBusHandler::getBus(),
-                    "/xyz/openbmc_project/pldm", instanceIdDb)
-    {}
+    HandlerTest() : event(sdeventplus::Event::get_default()), instanceIdDb() {}
 
     int fd = 0;
     mctp_eid_t eid = 0;
     sdeventplus::Event event;
     TestInstanceIdDb instanceIdDb;
-    pldm::dbus_api::Requester dbusImplReq;
 
     /** @brief This function runs the sd_event_run in a loop till all the events
      *         in the testcase are dispatched and exits when there are no events
@@ -76,10 +71,11 @@
 
 TEST_F(HandlerTest, singleRequestResponseScenario)
 {
-    Handler<NiceMock<MockRequest>> reqHandler(
-        fd, event, dbusImplReq, false, 90000, seconds(1), 2, milliseconds(100));
+    Handler<NiceMock<MockRequest>> reqHandler(fd, event, instanceIdDb, false,
+                                              90000, seconds(1), 2,
+                                              milliseconds(100));
     pldm::Request request{};
-    auto instanceId = dbusImplReq.getInstanceId(eid);
+    auto instanceId = instanceIdDb.next(eid);
     EXPECT_EQ(instanceId, 0);
     auto rc = reqHandler.registerRequest(
         eid, instanceId, 0, 0, std::move(request),
@@ -96,10 +92,11 @@
 
 TEST_F(HandlerTest, singleRequestInstanceIdTimerExpired)
 {
-    Handler<NiceMock<MockRequest>> reqHandler(
-        fd, event, dbusImplReq, false, 90000, seconds(1), 2, milliseconds(100));
+    Handler<NiceMock<MockRequest>> reqHandler(fd, event, instanceIdDb, false,
+                                              90000, seconds(1), 2,
+                                              milliseconds(100));
     pldm::Request request{};
-    auto instanceId = dbusImplReq.getInstanceId(eid);
+    auto instanceId = instanceIdDb.next(eid);
     EXPECT_EQ(instanceId, 0);
     auto rc = reqHandler.registerRequest(
         eid, instanceId, 0, 0, std::move(request),
@@ -114,10 +111,11 @@
 
 TEST_F(HandlerTest, multipleRequestResponseScenario)
 {
-    Handler<NiceMock<MockRequest>> reqHandler(
-        fd, event, dbusImplReq, false, 90000, seconds(2), 2, milliseconds(100));
+    Handler<NiceMock<MockRequest>> reqHandler(fd, event, instanceIdDb, false,
+                                              90000, seconds(2), 2,
+                                              milliseconds(100));
     pldm::Request request{};
-    auto instanceId = dbusImplReq.getInstanceId(eid);
+    auto instanceId = instanceIdDb.next(eid);
     EXPECT_EQ(instanceId, 0);
     auto rc = reqHandler.registerRequest(
         eid, instanceId, 0, 0, std::move(request),
@@ -125,7 +123,7 @@
     EXPECT_EQ(rc, PLDM_SUCCESS);
 
     pldm::Request requestNxt{};
-    auto instanceIdNxt = dbusImplReq.getInstanceId(eid);
+    auto instanceIdNxt = instanceIdDb.next(eid);
     EXPECT_EQ(instanceIdNxt, 1);
     rc = reqHandler.registerRequest(
         eid, instanceIdNxt, 0, 0, std::move(requestNxt),
