diff --git a/src/power_control.cpp b/src/power_control.cpp
index 84160bd..b897c3b 100644
--- a/src/power_control.cpp
+++ b/src/power_control.cpp
@@ -207,6 +207,36 @@
         "xyz.openbmc_project.BeepCode", "Beep", uint8_t(beepPriority));
 }
 
+enum class OperatingSystemStateStage
+{
+    Inactive,
+    Standby,
+};
+static constexpr std::string_view
+    getOperatingSystemStateStage(const OperatingSystemStateStage stage)
+{
+    switch (stage)
+    {
+        case OperatingSystemStateStage::Inactive:
+            return "xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.Inactive";
+            break;
+        case OperatingSystemStateStage::Standby:
+            return "xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.Standby";
+            break;
+        default:
+            return "xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.Inactive";
+            break;
+    }
+};
+static void setOperatingSystemState(const OperatingSystemStateStage stage)
+{
+    osIface->set_property("OperatingSystemState",
+                          std::string(getOperatingSystemStateStage(stage)));
+
+    lg2::info("Moving os state to {STATE} stage", "STATE",
+              getOperatingSystemStateStage(stage));
+}
+
 enum class PowerState
 {
     on,
@@ -1603,8 +1633,7 @@
                 // 'OperatingSystemState' to stay at 'Standby', even though
                 // system is OFF. Set 'OperatingSystemState' to 'Inactive'
                 // if HostState is trurned to OFF.
-                osIface->set_property("OperatingSystemState",
-                                      std::string("Inactive"));
+                setOperatingSystemState(OperatingSystemStateStage::Inactive);
 
                 // Set the restart cause set for this restart
                 setRestartCause();
@@ -2220,12 +2249,12 @@
     if (!state)
     {
         sendPowerControlEvent(Event::postCompleteAssert);
-        osIface->set_property("OperatingSystemState", std::string("Standby"));
+        setOperatingSystemState(OperatingSystemStateStage::Standby);
     }
     else
     {
         sendPowerControlEvent(Event::postCompleteDeAssert);
-        osIface->set_property("OperatingSystemState", std::string("Inactive"));
+        setOperatingSystemState(OperatingSystemStateStage::Inactive);
     }
 }
 
@@ -3247,17 +3276,23 @@
     // Get the initial OS state based on POST complete
     //      0: Asserted, OS state is "Standby" (ready to boot)
     //      1: De-Asserted, OS state is "Inactive"
-    std::string osState;
+    OperatingSystemStateStage osState;
     if (postCompleteConfig.type == ConfigType::GPIO)
     {
-        osState = postCompleteLine.get_value() > 0 ? "Inactive" : "Standby";
+        osState = postCompleteLine.get_value() > 0
+                      ? OperatingSystemStateStage::Inactive
+                      : OperatingSystemStateStage::Standby;
     }
     else
     {
-        osState = getProperty(postCompleteConfig) > 0 ? "Inactive" : "Standby";
+        osState = getProperty(postCompleteConfig) > 0
+                      ? OperatingSystemStateStage::Inactive
+                      : OperatingSystemStateStage::Standby;
     }
 
-    osIface->register_property("OperatingSystemState", std::string(osState));
+    osIface->register_property(
+        "OperatingSystemState",
+        std::string(getOperatingSystemStateStage(osState)));
 
     osIface->initialize();
 
