diff --git a/chassis_state_manager.cpp b/chassis_state_manager.cpp
index d9eb78c..a424ebf 100644
--- a/chassis_state_manager.cpp
+++ b/chassis_state_manager.cpp
@@ -276,25 +276,25 @@
                          .c_str());
 
     chassisPowerState = server::Chassis::currentPowerState(value);
-    pOHTimer.setEnabled(chassisPowerState == PowerState::On);
+    pohTimer.setEnabled(chassisPowerState == PowerState::On);
     return chassisPowerState;
 }
 
-uint32_t Chassis::pOHCounter(uint32_t value)
+uint32_t Chassis::pohCounter(uint32_t value)
 {
-    if (value != pOHCounter())
+    if (value != pohCounter())
     {
-        ChassisInherit::pOHCounter(value);
+        ChassisInherit::pohCounter(value);
         serializePOH();
     }
-    return pOHCounter();
+    return pohCounter();
 }
 
-void Chassis::pOHCallback()
+void Chassis::pohCallback()
 {
     if (ChassisInherit::currentPowerState() == PowerState::On)
     {
-        pOHCounter(pOHCounter() + 1);
+        pohCounter(pohCounter() + 1);
     }
 }
 
@@ -304,11 +304,11 @@
     if (!deserializePOH(POH_COUNTER_PERSIST_PATH, counter))
     {
         // set to default value
-        pOHCounter(0);
+        pohCounter(0);
     }
     else
     {
-        pOHCounter(counter);
+        pohCounter(counter);
     }
 }
 
@@ -316,11 +316,11 @@
 {
     std::ofstream os(path.c_str(), std::ios::binary);
     cereal::JSONOutputArchive oarchive(os);
-    oarchive(pOHCounter());
+    oarchive(pohCounter());
     return path;
 }
 
-bool Chassis::deserializePOH(const fs::path& path, uint32_t& pOHCounter)
+bool Chassis::deserializePOH(const fs::path& path, uint32_t& pohCounter)
 {
     try
     {
@@ -328,7 +328,7 @@
         {
             std::ifstream is(path.c_str(), std::ios::in | std::ios::binary);
             cereal::JSONInputArchive iarchive(is);
-            iarchive(pOHCounter);
+            iarchive(pohCounter);
             return true;
         }
         return false;
