diff --git a/apphandler.cpp b/apphandler.cpp
index d5ebe2e..4a77cfa 100644
--- a/apphandler.cpp
+++ b/apphandler.cpp
@@ -5,6 +5,7 @@
 #include <string.h>
 #include <stdint.h>
 #include <systemd/sd-bus.h>
+#include <mapper.h>
 #include <array>
 
 extern sd_bus *bus;
@@ -173,10 +174,10 @@
                              ipmi_data_len_t data_len, ipmi_context_t context)
 {
     ipmi_ret_t rc = IPMI_CC_OK;
-    const char  *busname = "org.openbmc.Inventory";
     const char  *objname = "/org/openbmc/inventory/system/chassis/motherboard/bmc";
     const char  *iface   = "org.openbmc.InventoryItem";
     char *ver = NULL;
+    char *busname = NULL;
     int r;
     rev_t rev = {0};
     ipmi_device_id_t dev_id{};
@@ -194,6 +195,11 @@
     dev_id.revision = 0x80;
 
     // Firmware revision is already implemented, so get it from appropriate position.
+    r = mapper_get_service(bus, objname, &busname);
+    if (r < 0) {
+        fprintf(stderr, "Failed to get bus name, return value: %s.\n", strerror(-r));
+        goto finish;
+    }
     r = sd_bus_get_property_string(bus,busname,objname,iface,"version", NULL, &ver);
     if ( r < 0 ) {
         fprintf(stderr, "Failed to obtain version property: %s\n", strerror(-r));
@@ -242,6 +248,8 @@
 
     // Pack the actual response
     memcpy(response, &dev_id, *data_len);
+finish:
+    free(busname);
     return rc;
 }
 
@@ -249,7 +257,6 @@
                              ipmi_request_t request, ipmi_response_t response,
                              ipmi_data_len_t data_len, ipmi_context_t context)
 {
-    const char  *busname = "org.openbmc.control.Chassis";
     const char  *objname = "/org/openbmc/control/chassis0";
     const char  *iface = "org.freedesktop.DBus.Properties";
     const char  *chassis_iface = "org.openbmc.control.Chassis";
@@ -257,6 +264,7 @@
     sd_bus_error error = SD_BUS_ERROR_NULL;
     int r = 0;
     char *uuid = NULL;
+    char *busname = NULL;
 
     // UUID is in RFC4122 format. Ex: 61a39523-78f2-11e5-9862-e6402cfc3223
     // Per IPMI Spec 2.0 need to convert to 16 hex bytes and reverse the byte order
@@ -276,6 +284,11 @@
     printf("IPMI GET DEVICE GUID\n");
 
     // Call Get properties method with the interface and property name
+    r = mapper_get_service(bus, objname, &busname);
+    if (r < 0) {
+        fprintf(stderr, "Failed to get bus name, return value: %s.\n", strerror(-r));
+        goto finish;
+    }
     r = sd_bus_call_method(bus,busname,objname,iface,
                            "Get",&error, &reply, "ss",
                            chassis_iface, "uuid");
@@ -333,6 +346,7 @@
 finish:
     sd_bus_error_free(&error);
     reply = sd_bus_message_unref(reply);
+    free(busname);
 
     return rc;
 }
@@ -373,7 +387,6 @@
                              ipmi_request_t request, ipmi_response_t response,
                              ipmi_data_len_t data_len, ipmi_context_t context)
 {
-    const char  *busname = "org.openbmc.watchdog.Host";
     const char  *objname = "/org/openbmc/watchdog/host0";
     const char  *iface = "org.openbmc.Watchdog";
     sd_bus_message *reply = NULL;
@@ -383,7 +396,7 @@
     set_wd_data_t *reqptr = (set_wd_data_t*) request;
     uint16_t timer = 0;
     uint32_t timer_ms = 0;
-
+    char *busname = NULL;
     *data_len = 0;
 
     // Get number of 100ms intervals
@@ -393,6 +406,12 @@
 
     printf("WATCHDOG SET Timer:[0x%X] 100ms intervals\n",timer);
 
+    // Get bus name
+    r = mapper_get_service(bus, objname, &busname);
+    if (r < 0) {
+        fprintf(stderr, "Failed to get bus name, return value: %s.\n", strerror(-r));
+        goto finish;
+    }
     // Set watchdog timer
     r = sd_bus_call_method(bus, busname, objname, iface,
                            "set", &error, &reply, "i", timer_ms);
@@ -431,6 +450,7 @@
 finish:
     sd_bus_error_free(&error);
     reply = sd_bus_message_unref(reply);
+    free(busname);
 
     return (r < 0) ? -1 : IPMI_CC_OK;
 }
@@ -440,19 +460,24 @@
                              ipmi_request_t request, ipmi_response_t response,
                              ipmi_data_len_t data_len, ipmi_context_t context)
 {
-    const char  *busname = "org.openbmc.watchdog.Host";
     const char  *objname = "/org/openbmc/watchdog/host0";
     const char  *iface = "org.openbmc.Watchdog";
     sd_bus_message *reply = NULL;
     sd_bus_error error = SD_BUS_ERROR_NULL;
     int r = 0;
+    char *busname = NULL;
 
     // Status code.
     ipmi_ret_t rc = IPMI_CC_OK;
     *data_len = 0;
 
     printf("WATCHDOG RESET\n");
-
+    // Get bus name
+    r = mapper_get_service(bus, objname, &busname);
+    if (r < 0) {
+        fprintf(stderr, "Failed to get bus name, return value: %s.\n", strerror(-r));
+        goto finish;
+    }
     // Refresh watchdog
     r = sd_bus_call_method(bus, busname, objname, iface,
                            "poke", &error, &reply, NULL);
@@ -461,8 +486,10 @@
         rc = -1;
     }
 
+finish:
     sd_bus_error_free(&error);
     reply = sd_bus_message_unref(reply);
+    free(busname);
 
     return rc;
 }
diff --git a/chassishandler.cpp b/chassishandler.cpp
index ded9157..92d9752 100644
--- a/chassishandler.cpp
+++ b/chassishandler.cpp
@@ -15,7 +15,6 @@
 
 
 // OpenBMC Chassis Manager dbus framework
-const char  *chassis_bus_name      =  "org.openbmc.control.Chassis";
 const char  *chassis_object_name   =  "/org/openbmc/control/chassis0";
 const char  *chassis_intf_name     =  "org.openbmc.control.Chassis";
 
@@ -42,7 +41,7 @@
 
     r = mapper_get_service(bus, settings_object_name, &connection);
     if (r < 0) {
-        fprintf(stderr, "Failed to get connection, return value: %d.\n", r);
+        fprintf(stderr, "Failed to get connection, return value: %s.\n", strerror(-r));
         goto finish;
     }
 
@@ -107,7 +106,7 @@
 
     r = mapper_get_service(bus, settings_object_name, &connection);
     if (r < 0) {
-        fprintf(stderr, "Failed to get connection, return value: %d.\n", r);
+        fprintf(stderr, "Failed to get connection, return value: %s.\n", strerror(-r));
         goto finish;
     }
 
@@ -180,9 +179,10 @@
 {
 	// sd_bus error
 	int rc = 0;
+	char  *busname = NULL;
 
-    // SD Bus error report mechanism.
-    sd_bus_error bus_error = SD_BUS_ERROR_NULL;
+	// SD Bus error report mechanism.
+	sd_bus_error bus_error = SD_BUS_ERROR_NULL;
 
 	// Response from the call. Although there is no response for this call,
 	// obligated to mention this to make compiler happy.
@@ -190,9 +190,13 @@
 
 	// Gets a hook onto either a SYSTEM or SESSION bus
 	sd_bus *bus_type = ipmid_get_sd_bus_connection();
-
+	rc = mapper_get_service(bus_type, chassis_object_name, &busname);
+	if (rc < 0) {
+		fprintf(stderr, "Failed to get bus name, return value: %s.\n", strerror(-rc));
+	goto finish;
+	}
 	rc = sd_bus_call_method(bus_type,        		 // On the System Bus
-							chassis_bus_name,        // Service to contact
+							busname,        // Service to contact
 							chassis_object_name,     // Object path 
 							chassis_intf_name,       // Interface name
 							method,      		 // Method to be called
@@ -208,10 +212,12 @@
 		printf("Chassis Power Off initiated successfully\n");
 	}
 
+finish:
     sd_bus_error_free(&bus_error);
     sd_bus_message_unref(response);
+    free(busname);
 
-	return rc;
+    return rc;
 }
 
 
diff --git a/host-services.c b/host-services.c
index cc47439..78ad4c3 100644
--- a/host-services.c
+++ b/host-services.c
@@ -2,13 +2,12 @@
 #include <stdlib.h>
 #include <errno.h>
 #include <systemd/sd-bus.h>
-
+#include <mapper.h>
 #include "ipmid-api.h"
 
 void register_host_services() __attribute__((constructor));
 
 // OpenBMC Host IPMI dbus framework
-const char  *bus_name      =  "org.openbmc.HostIpmi";
 const char  *object_name   =  "/org/openbmc/HostIpmi/1";
 const char  *intf_name     =  "org.openbmc.HostIpmi";
 
@@ -19,6 +18,7 @@
 {
     int64_t bt_resp = -1;
     int rc = 0;
+    char *bus_name = NULL;
 
     // Steps to be taken when we get this.
     //  1: Send a SMS_ATN to the Host
@@ -43,7 +43,11 @@
 
     // Gets a hook onto either a SYSTEM or SESSION bus
     sd_bus *bus = ipmid_get_sd_bus_connection();
-
+    rc = mapper_get_service(bus, object_name, &bus_name);
+    if (rc < 0) {
+        fprintf(stderr, "Failed to get bus name, return value: %s.\n", strerror(-rc));
+        goto finish;
+    }
     rc = sd_bus_call_method(bus,             // In the System Bus
                             bus_name,        // Service to contact
                             object_name,     // Object path
@@ -69,6 +73,7 @@
 finish:
     sd_bus_error_free(&bus_error);
     response = sd_bus_message_unref(response);
+    free(bus_name);
 
     if(rc < 0)
     {
diff --git a/ipmid.cpp b/ipmid.cpp
index 7848afe..31608e9 100644
--- a/ipmid.cpp
+++ b/ipmid.cpp
@@ -35,7 +35,6 @@
 }
 
 // Host settings in DBUS
-constexpr char settings_host_bus[] = "org.openbmc.settings.Host";
 constexpr char settings_host_object[] = "/org/openbmc/settings/host0";
 constexpr char settings_host_intf[] = "org.freedesktop.DBus.Properties";
 
@@ -271,16 +270,22 @@
     sd_bus_message *reply = NULL;
     sd_bus_error error = SD_BUS_ERROR_NULL;
     int rc = 0;
+    char  *busname = NULL;
 
+    rc = mapper_get_service(bus, settings_host_object, &busname);
+    if (rc < 0) {
+        fprintf(stderr, "Failed to get HOST busname: %s\n", strerror(-rc));
+        goto cleanup;
+    }
     rc = sd_bus_call_method(bus,
-                            settings_host_bus,
+                            busname,
                             settings_host_object,
                             settings_host_intf,
                             "Get",
                             &error,
                             &reply,
                             "ss",
-                            settings_host_bus,
+                            "org.openbmc.settings.Host",
                             "restricted_mode");
     if(rc < 0)
     {
@@ -303,6 +308,7 @@
 cleanup:
     sd_bus_error_free(&error);
     reply = sd_bus_message_unref(reply);
+    free(busname);
 }
 
 static int handle_restricted_mode_change(sd_bus_message *m, void *user_data,
diff --git a/storageaddsel.cpp b/storageaddsel.cpp
index 3343772..9d15a49 100644
--- a/storageaddsel.cpp
+++ b/storageaddsel.cpp
@@ -7,7 +7,7 @@
 #include <vector>
 #include <memory>
 #include <systemd/sd-bus.h>
-
+#include <mapper.h>
 #include "ipmid.H"
 #include "storagehandler.h"
 #include "sensorhandler.h"
@@ -179,12 +179,18 @@
     sd_bus_message *reply = NULL, *m=NULL;
     uint16_t x;
     int r;
+    const char *object_name  =  "/org/openbmc/records/events";
+    char *bus_name = NULL;
 
     mbus = ipmid_get_sd_bus_connection();
-
+    r = mapper_get_service(mbus, object_name, &bus_name);
+    if (r < 0) {
+        fprintf(stderr, "Failed to get connection, return value: %s.\n", strerror(-r));
+        goto finish;
+    }
     r = sd_bus_message_new_method_call(mbus,&m,
-    									"org.openbmc.records.events",
-    									"/org/openbmc/records/events",
+    									bus_name,
+    									object_name,
     									"org.openbmc.recordlog",
     									"acceptHostMessage");
     if (r < 0) {
@@ -218,6 +224,7 @@
     sd_bus_error_free(&error);
     m = sd_bus_message_unref(m);
     reply = sd_bus_message_unref(reply);
+    free (bus_name);
     return r;
 }
 
diff --git a/testaddsel.cpp b/testaddsel.cpp
index 202200a..9fd9d35 100644
--- a/testaddsel.cpp
+++ b/testaddsel.cpp
@@ -5,6 +5,7 @@
 #include <stdint.h>
 #include <systemd/sd-bus.h>
 #include "sensorhandler.h"
+#include <mapper.h>
 
 
 extern void send_esel(uint16_t recordid);
@@ -16,15 +17,19 @@
 // step for mapping IPMI
 int find_openbmc_path(const char *type, const uint8_t num, dbus_interface_t *interface) {
 
-    const char  *busname = "org.openbmc.managers.System";
     const char  *objname = "/org/openbmc/managers/System";
 
     char  *str1, *str2, *str3;
     sd_bus_error error = SD_BUS_ERROR_NULL;
     sd_bus_message *reply = NULL, *m=NULL;
-
-
     int r;
+    char  *busname = NULL;
+
+    r = mapper_get_service(bus, objname, &busname);
+    if (r < 0) {
+        fprintf(stderr, "Failed to get busname: %s\n", strerror(-r));
+        goto final;
+    }
 
     r = sd_bus_message_new_method_call(bus,&m,busname,objname,busname,"getObjectFromByteId");
     if (r < 0) {
@@ -60,6 +65,7 @@
 
     sd_bus_error_free(&error);
     sd_bus_message_unref(m);
+    free (busname);
 
     return r;
 }
diff --git a/transporthandler.cpp b/transporthandler.cpp
index 3b4cf07..5bb5355 100644
--- a/transporthandler.cpp
+++ b/transporthandler.cpp
@@ -12,10 +12,10 @@
 
 #ifdef SYSTEMD_NETWORKD_DBUS
 #include <systemd/sd-bus.h>
+#include <mapper.h>
 #endif
 
 // OpenBMC System Manager dbus framework
-const char  *app   =  "org.openbmc.NetworkManager";
 const char  *obj   =  "/org/openbmc/NetworkManager/Interface";
 const char  *ifc   =  "org.openbmc.NetworkManager";
 
@@ -53,7 +53,13 @@
     char* gateway = NULL;
     int r = 0;
     ipmi_ret_t rc = IPMI_CC_OK;
+    char *app = NULL;
 
+    r = mapper_get_service(bus, obj, &app);
+    if (r < 0) {
+        fprintf(stderr, "Failed to get bus name, return value: %s.\n", strerror(-r));
+        goto cleanup;
+    }
     r = sd_bus_call_method(bus, app, obj, ifc, "GetAddress4", &error,
                             &reply, "s", nwinterface);
     if(r < 0)
@@ -118,6 +124,7 @@
 cleanup:
     sd_bus_error_free(&error);
     reply = sd_bus_message_unref(reply);
+    free(app);
 
     return rc;
 }
@@ -149,6 +156,7 @@
     sd_bus_message *reply = NULL;
     sd_bus_error error = SD_BUS_ERROR_NULL;
     int r = 0;
+    char *app = NULL;
 
     printf("IPMI SET_LAN\n");
 
@@ -175,6 +183,11 @@
                 reqptr->data[4],
                 reqptr->data[5]);
 
+        r = mapper_get_service(bus, obj, &app);
+        if (r < 0) {
+            fprintf(stderr, "Failed to get bus name, return value: %s.\n", strerror(-r));
+            goto finish;
+        }
         r = sd_bus_call_method(bus, app, obj, ifc, "SetHwAddress", &error,
                                 &reply, "ss", nwinterface, mac);
         if(r < 0)
@@ -239,8 +252,10 @@
         rc = IPMI_CC_PARM_NOT_SUPPORTED;
     }
 
+finish:
     sd_bus_error_free(&error);
     reply = sd_bus_message_unref(reply);
+    free(app);
 
     return rc;
 }
@@ -264,6 +279,7 @@
     int r = 0;
     const uint8_t current_revision = 0x11; // Current rev per IPMI Spec 2.0
     int i = 0;
+    char *app = NULL;
 
     printf("IPMI GET_LAN\n");
 
@@ -321,6 +337,11 @@
         uint8_t buf[7];
         char *eaddr1 = NULL;
 
+        r = mapper_get_service(bus, obj, &app);
+        if (r < 0) {
+            fprintf(stderr, "Failed to get bus name, return value: %s.\n", strerror(-r));
+            goto cleanup;
+        }
         r = sd_bus_call_method(bus, app, obj, ifc, "GetHwAddress", &error,
                                 &reply, "s", nwinterface);
         if(r < 0)
@@ -376,6 +397,7 @@
 cleanup:
     sd_bus_error_free(&error);
     reply = sd_bus_message_unref(reply);
+    free(app);
 
     return rc;
 }
