diff --git a/manager/lamptest/lamptest.cpp b/manager/lamptest/lamptest.cpp
index d90fc8a..a70f89c 100644
--- a/manager/lamptest/lamptest.cpp
+++ b/manager/lamptest/lamptest.cpp
@@ -22,7 +22,7 @@
         // Physical LEDs will be updated during lamp test
         for (const auto& it : ledsDeAssert)
         {
-            std::string path = std::string(PHY_LED_PATH) + it.name;
+            std::string path = std::string(phyLedPath) + it.name;
             auto iter = std::find_if(
                 forceUpdateLEDs.begin(), forceUpdateLEDs.end(),
                 [&path](const auto& name) { return name == path; });
@@ -36,7 +36,7 @@
 
         for (const auto& it : ledsAssert)
         {
-            std::string path = std::string(PHY_LED_PATH) + it.name;
+            std::string path = std::string(phyLedPath) + it.name;
             auto iter = std::find_if(
                 forceUpdateLEDs.begin(), forceUpdateLEDs.end(),
                 [&path](const auto& name) { return name == path; });
@@ -137,7 +137,7 @@
         uint8_t dutyOn{};
         try
         {
-            auto properties = dBusHandler.getAllProperties(path, PHY_LED_IFACE);
+            auto properties = dBusHandler.getAllProperties(path, phyLedIntf);
 
             state = std::get<std::string>(properties["State"]);
             period = std::get<uint16_t>(properties["Period"]);
@@ -174,14 +174,13 @@
     // Get paths of all the Physical LED objects
     try
     {
-        physicalLEDPaths = dBusHandler.getSubTreePaths(PHY_LED_PATH,
-                                                       PHY_LED_IFACE);
+        physicalLEDPaths = dBusHandler.getSubTreePaths(phyLedPath, phyLedIntf);
     }
     catch (const sdbusplus::exception_t& e)
     {
         lg2::error(
             "Failed to call the SubTreePaths method: {ERROR}, ledPath: {PATH}, ledInterface: {INTERFACE}",
-            "ERROR", e, "PATH", PHY_LED_PATH, "INTERFACE", PHY_LED_IFACE);
+            "ERROR", e, "PATH", phyLedPath, "INTERFACE", phyLedIntf);
         return;
     }
 
@@ -292,11 +291,11 @@
         const std::vector<std::string> empty{};
         auto forceLEDs = json.value("forceLEDs", empty);
         std::ranges::transform(forceLEDs, std::back_inserter(forceUpdateLEDs),
-                               [](const auto& i) { return PHY_LED_PATH + i; });
+                               [](const auto& i) { return phyLedPath + i; });
 
         auto skipLEDs = json.value("skipLEDs", empty);
         std::ranges::transform(skipLEDs, std::back_inserter(skipUpdateLEDs),
-                               [](const auto& i) { return PHY_LED_PATH + i; });
+                               [](const auto& i) { return phyLedPath + i; });
     }
     catch (const std::exception& e)
     {
diff --git a/manager/manager.cpp b/manager/manager.cpp
index 12f507a..6d8bdb8 100644
--- a/manager/manager.cpp
+++ b/manager/manager.cpp
@@ -123,7 +123,7 @@
     {
         for (const auto& it : ledsDeAssert)
         {
-            std::string objPath = std::string(PHY_LED_PATH) + it.name;
+            std::string objPath = std::string(phyLedPath) + it.name;
             lg2::debug("De-Asserting LED, NAME = {NAME}", "NAME", it.name);
             drivePhysicalLED(objPath, Layout::Action::Off, it.dutyOn,
                              it.period);
@@ -134,7 +134,7 @@
     {
         for (const auto& it : ledsAssert)
         {
-            std::string objPath = std::string(PHY_LED_PATH) + it.name;
+            std::string objPath = std::string(phyLedPath) + it.name;
             lg2::debug("Asserting LED, NAME = {NAME}", "NAME", it.name);
             drivePhysicalLED(objPath, it.action, it.dutyOn, it.period);
         }
@@ -155,14 +155,12 @@
             PropertyValue dutyOnValue{dutyOn};
             PropertyValue periodValue{period};
 
-            dBusHandler.setProperty(objPath, PHY_LED_IFACE, "DutyOn",
-                                    dutyOnValue);
-            dBusHandler.setProperty(objPath, PHY_LED_IFACE, "Period",
-                                    periodValue);
+            dBusHandler.setProperty(objPath, phyLedIntf, "DutyOn", dutyOnValue);
+            dBusHandler.setProperty(objPath, phyLedIntf, "Period", periodValue);
         }
 
         PropertyValue actionValue{getPhysicalAction(action)};
-        dBusHandler.setProperty(objPath, PHY_LED_IFACE, "State", actionValue);
+        dBusHandler.setProperty(objPath, phyLedIntf, "State", actionValue);
     }
     catch (const std::exception& e)
     {
diff --git a/manager/manager.hpp b/manager/manager.hpp
index ac00d76..d8573b6 100644
--- a/manager/manager.hpp
+++ b/manager/manager.hpp
@@ -13,8 +13,8 @@
 {
 using namespace phosphor::led::utils;
 
-static constexpr auto PHY_LED_PATH = "/xyz/openbmc_project/led/physical/";
-static constexpr auto PHY_LED_IFACE = "xyz.openbmc_project.Led.Physical";
+static constexpr auto phyLedPath = "/xyz/openbmc_project/led/physical/";
+static constexpr auto phyLedIntf = "xyz.openbmc_project.Led.Physical";
 
 /** @class Manager
  *  @brief Manages group of LEDs and applies action on the elements of group
