diff --git a/manager/lamptest/lamptest.cpp b/manager/lamptest/lamptest.cpp
index e7c9d5a..f91a085 100644
--- a/manager/lamptest/lamptest.cpp
+++ b/manager/lamptest/lamptest.cpp
@@ -31,8 +31,8 @@
 
             if (iter != forceUpdateLEDs.end())
             {
-                manager.drivePhysicalLED(path, Layout::Action::Off, it.dutyOn,
-                                         it.period);
+                phosphor::led::Manager::drivePhysicalLED(
+                    path, Layout::Action::Off, it.dutyOn, it.period);
             }
         }
 
@@ -45,7 +45,8 @@
 
             if (iter != forceUpdateLEDs.end())
             {
-                manager.drivePhysicalLED(path, it.action, it.dutyOn, it.period);
+                phosphor::led::Manager::drivePhysicalLED(path, it.action,
+                                                         it.dutyOn, it.period);
             }
         }
 
@@ -80,7 +81,8 @@
             continue;
         }
 
-        manager.drivePhysicalLED(path, Layout::Action::Off, 0, 0);
+        phosphor::led::Manager::drivePhysicalLED(path, Layout::Action::Off, 0,
+                                                 0);
     }
 
     if (std::filesystem::exists(lampTestIndicator))
@@ -146,7 +148,9 @@
         uint8_t dutyOn{};
         try
         {
-            auto properties = dBusHandler.getAllProperties(path, phyLedIntf);
+            auto properties =
+                phosphor::led::utils::DBusHandler::getAllProperties(path,
+                                                                    phyLedIntf);
 
             state = std::get<std::string>(properties["State"]);
             period = std::get<uint16_t>(properties["Period"]);
@@ -187,7 +191,8 @@
     // Get paths of all the Physical LED objects
     try
     {
-        physicalLEDPaths = dBusHandler.getSubTreePaths(phyLedPath, phyLedIntf);
+        physicalLEDPaths = phosphor::led::utils::DBusHandler::getSubTreePaths(
+            phyLedPath, phyLedIntf);
     }
     catch (const sdbusplus::exception_t& e)
     {
@@ -233,7 +238,8 @@
             continue;
         }
 
-        manager.drivePhysicalLED(path, Layout::Action::On, 0, 0);
+        phosphor::led::Manager::drivePhysicalLED(path, Layout::Action::On, 0,
+                                                 0);
     }
 }
 
@@ -307,9 +313,9 @@
     try
     {
         PropertyValue assertedValue{value};
-        dBusHandler.setProperty(HOST_LAMP_TEST_OBJECT,
-                                "xyz.openbmc_project.Led.Group", "Asserted",
-                                assertedValue);
+        phosphor::led::utils::DBusHandler::setProperty(
+            HOST_LAMP_TEST_OBJECT, "xyz.openbmc_project.Led.Group", "Asserted",
+            assertedValue);
     }
     catch (const sdbusplus::exception_t& e)
     {
@@ -357,14 +363,14 @@
     if (std::filesystem::exists(lampTestIndicator))
     {
         // we need to off all the LEDs.
-        phosphor::led::utils::DBusHandler dBusHandler;
-        std::vector<std::string> physicalLedPaths = dBusHandler.getSubTreePaths(
-            phosphor::led::phyLedPath, phosphor::led::phyLedIntf);
+        std::vector<std::string> physicalLedPaths =
+            phosphor::led::utils::DBusHandler::getSubTreePaths(
+                phosphor::led::phyLedPath, phosphor::led::phyLedIntf);
 
         for (const auto& path : physicalLedPaths)
         {
-            manager.drivePhysicalLED(path, phosphor::led::Layout::Action::Off,
-                                     0, 0);
+            phosphor::led::Manager::drivePhysicalLED(
+                path, phosphor::led::Layout::Action::Off, 0, 0);
         }
 
         // Also remove the lamp test on indicator file.
diff --git a/manager/lamptest/lamptest.hpp b/manager/lamptest/lamptest.hpp
index 5e312e2..ce7bae1 100644
--- a/manager/lamptest/lamptest.hpp
+++ b/manager/lamptest/lamptest.hpp
@@ -79,7 +79,7 @@
      * with the persisted lamp test indicator file so that there is no sign of
      * lamptest.
      */
-    void clearLamps();
+    static void clearLamps();
 
   private:
     /** @brief Timer used for LEDs lamp test period */
@@ -88,9 +88,6 @@
     /** @brief Reference to Manager object */
     Manager& manager;
 
-    /** DBusHandler class handles the D-Bus operations */
-    DBusHandler dBusHandler;
-
     /** @brief Pointer to Group object */
     Group* groupObj;
 
@@ -137,13 +134,13 @@
      *
      *  @return enumeration equivalent of the passed in string
      */
-    Layout::Action getActionFromString(const std::string& str);
+    static Layout::Action getActionFromString(const std::string& str);
 
     /** @brief Notify host to start / stop the lamp test
      *
      *  @param[in]  value   -  the Asserted property value
      */
-    void doHostLampTest(bool value);
+    static void doHostLampTest(bool value);
 
     /** @brief Get physical LED names from lamp test JSON config file
      *
