diff --git a/tools/power-utils/main.cpp b/tools/power-utils/main.cpp
index 8ca7c04..236f0d6 100644
--- a/tools/power-utils/main.cpp
+++ b/tools/power-utils/main.cpp
@@ -13,11 +13,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#include "config.h"
-
 #include "model.hpp"
 #include "updater.hpp"
-#include "utils.hpp"
 #include "version.hpp"
 
 #include <CLI/CLI.hpp>
@@ -55,18 +52,10 @@
 
     std::string ret;
 
-    bool useJsonFile = utils::checkFileExists(PSU_JSON_PATH);
     auto bus = sdbusplus::bus::new_default();
     if (!psuPathVersion.empty())
     {
-        if (!useJsonFile)
-        {
-            ret = version::getVersion(bus, psuPathVersion);
-        }
-        else
-        {
-            ret = version::getVersion(psuPathVersion);
-        }
+        ret = version::getVersion(bus, psuPathVersion);
     }
     if (!psuPathModel.empty())
     {
diff --git a/tools/power-utils/model.cpp b/tools/power-utils/model.cpp
index 6677eac..7bfda66 100644
--- a/tools/power-utils/model.cpp
+++ b/tools/power-utils/model.cpp
@@ -140,8 +140,7 @@
     std::string model;
     try
     {
-        // If PSU JSON file exists
-        if (checkFileExists(PSU_JSON_PATH))
+        if (usePsuJsonFile())
         {
             // Obtain PSU information from JSON file
             model = internal::getModelJson(psuInventoryPath);
diff --git a/tools/power-utils/test/meson.build b/tools/power-utils/test/meson.build
index 61c5f53..33d3df1 100644
--- a/tools/power-utils/test/meson.build
+++ b/tools/power-utils/test/meson.build
@@ -1,33 +1,13 @@
 test(
-    'test_version',
+    'psutils-tests',
     executable(
-        'test_version',
-        'test_version.cpp',
-        '../version.cpp',
-        '../utils.cpp',
-        dependencies: [
-            gtest,
-            nlohmann_json_dep,
-            phosphor_logging,
-        ],
-        implicit_include_directories: false,
-        include_directories: libpower_inc,
-        link_args: dynamic_linker,
-        build_rpath: get_option('oe-sdk').allowed() ? rpath : '',
-        link_with: [
-            libpower,
-        ],
-        objects: record_manager,
-    )
-)
-
-test(
-    'test_updater',
-    executable(
-        'test_updater',
+        'psutils-tests',
         'test_updater.cpp',
+        'test_utils.cpp',
+        'test_version.cpp',
         '../updater.cpp',
         '../utils.cpp',
+        '../version.cpp',
         dependencies: [
             gtest,
             gmock,
@@ -46,6 +26,5 @@
             libpower,
             libi2c_dev_mock
         ],
-        objects: record_manager,
     )
 )
diff --git a/tools/power-utils/test/test_updater.cpp b/tools/power-utils/test/test_updater.cpp
index 9c34926..a56d2df 100644
--- a/tools/power-utils/test/test_updater.cpp
+++ b/tools/power-utils/test/test_updater.cpp
@@ -27,17 +27,6 @@
 using ::testing::An;
 using ::testing::Pointee;
 
-namespace updater
-{
-namespace internal
-{
-
-std::string getDeviceName(std::string devPath);
-std::pair<uint8_t, uint8_t> parseDeviceName(const std::string& devName);
-
-} // namespace internal
-} // namespace updater
-
 using namespace updater;
 
 class TestUpdater : public ::testing::Test
@@ -103,30 +92,3 @@
     EXPECT_CALL(i2c, read(0xf1, An<uint8_t&>()));
     updater->doUpdate();
 }
-
-TEST_F(TestUpdater, getDeviceName)
-{
-    auto ret = internal::getDeviceName("");
-    EXPECT_TRUE(ret.empty());
-
-    ret = internal::getDeviceName("/sys/bus/i2c/devices/3-0069");
-    EXPECT_EQ("3-0069", ret);
-
-    ret = internal::getDeviceName("/sys/bus/i2c/devices/3-0069/");
-    EXPECT_EQ("3-0069", ret);
-}
-
-TEST_F(TestUpdater, parseDeviceName)
-{
-    auto [id, addr] = internal::parseDeviceName("3-0068");
-    EXPECT_EQ(3, id);
-    EXPECT_EQ(0x68, addr);
-
-    std::tie(id, addr) = internal::parseDeviceName("11-0069");
-    EXPECT_EQ(11, id);
-    EXPECT_EQ(0x69, addr);
-
-    EXPECT_THROW(internal::parseDeviceName("no-number"), std::invalid_argument);
-
-    EXPECT_DEATH(internal::parseDeviceName("invalid"), "");
-}
diff --git a/tools/power-utils/test/test_utils.cpp b/tools/power-utils/test/test_utils.cpp
new file mode 100644
index 0000000..b88d024
--- /dev/null
+++ b/tools/power-utils/test/test_utils.cpp
@@ -0,0 +1,50 @@
+/**
+ * Copyright © 2024 IBM Corporation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include "../utils.hpp"
+
+#include <stdexcept>
+#include <tuple>
+
+#include <gtest/gtest.h>
+
+using namespace utils;
+
+TEST(TestUtils, getDeviceName)
+{
+    auto ret = getDeviceName("");
+    EXPECT_TRUE(ret.empty());
+
+    ret = getDeviceName("/sys/bus/i2c/devices/3-0069");
+    EXPECT_EQ("3-0069", ret);
+
+    ret = getDeviceName("/sys/bus/i2c/devices/3-0069/");
+    EXPECT_EQ("3-0069", ret);
+}
+
+TEST(TestUtils, parseDeviceName)
+{
+    auto [id, addr] = parseDeviceName("3-0068");
+    EXPECT_EQ(3, id);
+    EXPECT_EQ(0x68, addr);
+
+    std::tie(id, addr) = parseDeviceName("11-0069");
+    EXPECT_EQ(11, id);
+    EXPECT_EQ(0x69, addr);
+
+    EXPECT_THROW(parseDeviceName("no-number"), std::invalid_argument);
+
+    EXPECT_DEATH(parseDeviceName("invalid"), "");
+}
diff --git a/tools/power-utils/updater.cpp b/tools/power-utils/updater.cpp
index dab0460..c48decb 100644
--- a/tools/power-utils/updater.cpp
+++ b/tools/power-utils/updater.cpp
@@ -13,8 +13,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#include "config.h"
-
 #include "updater.hpp"
 
 #include "pmbus.hpp"
@@ -22,8 +20,6 @@
 #include "utility.hpp"
 #include "utils.hpp"
 
-#include <sys/stat.h>
-
 #include <phosphor-logging/log.hpp>
 
 #include <chrono>
@@ -44,75 +40,6 @@
 constexpr uint8_t CRC8_POLYNOMIAL = 0x07;
 constexpr uint8_t CRC8_INITIAL = 0x00;
 
-/* Get the device name from the device path */
-std::string getDeviceName(std::string devPath)
-{
-    if (devPath.back() == '/')
-    {
-        devPath.pop_back();
-    }
-    return fs::path(devPath).stem().string();
-}
-
-// Construct the device path using the I2C bus and address or read inventory
-// path
-std::string getDevicePath(sdbusplus::bus_t& bus,
-                          const std::string& psuInventoryPath)
-{
-    try
-    {
-        if (internal::usePsuJsonFile())
-        {
-            auto data = util::loadJSONFromFile(PSU_JSON_PATH);
-            if (data == nullptr)
-            {
-                return {};
-            }
-            auto devicePath = data["psuDevices"][psuInventoryPath];
-            if (devicePath.empty())
-            {
-                log<level::WARNING>("Unable to find psu devices or path");
-            }
-            return devicePath;
-        }
-        else
-        {
-            const auto& [i2cbus, i2caddr] =
-                utils::getPsuI2c(bus, psuInventoryPath);
-            const auto DevicePath = "/sys/bus/i2c/devices/";
-            std::ostringstream ss;
-            ss << std::hex << std::setw(4) << std::setfill('0') << i2caddr;
-            std::string addrStr = ss.str();
-            std::string busStr = std::to_string(i2cbus);
-            std::string devPath = DevicePath + busStr + "-" + addrStr;
-            return devPath;
-        }
-    }
-    catch (const std::exception& e)
-    {
-        log<level::ERR>(
-            std::format("Error in getDevicePath: {}", e.what()).c_str());
-        return {};
-    }
-    catch (...)
-    {
-        log<level::ERR>("Unknown error occurred in getDevicePath");
-        return {};
-    }
-}
-
-// Parse the device name to get I2C bus and address
-std::pair<uint8_t, uint8_t> parseDeviceName(const std::string& devName)
-{
-    // Get I2C bus and device address, e.g. 3-0068
-    // is parsed to bus 3, device address 0x68
-    auto pos = devName.find('-');
-    assert(pos != std::string::npos);
-    uint8_t busId = std::stoi(devName.substr(0, pos));
-    uint8_t devAddr = std::stoi(devName.substr(pos + 1), nullptr, 16);
-    return {busId, devAddr};
-}
-
 // Get the appropriate Updater class instance based PSU model number
 std::unique_ptr<updater::Updater> getClassInstance(
     const std::string& model, const std::string& psuInventoryPath,
@@ -250,17 +177,12 @@
     return readDataBytes;
 }
 
-// Wrapper to check existence of PSU JSON file.
-bool usePsuJsonFile()
-{
-    return utils::checkFileExists(PSU_JSON_PATH);
-}
 } // namespace internal
 
 bool update(sdbusplus::bus_t& bus, const std::string& psuInventoryPath,
             const std::string& imageDir)
 {
-    auto devPath = internal::getDevicePath(bus, psuInventoryPath);
+    auto devPath = utils::getDevicePath(bus, psuInventoryPath);
 
     if (devPath.empty())
     {
@@ -289,8 +211,7 @@
 Updater::Updater(const std::string& psuInventoryPath,
                  const std::string& devPath, const std::string& imageDir) :
     bus(sdbusplus::bus::new_default()), psuInventoryPath(psuInventoryPath),
-    devPath(devPath), devName(internal::getDeviceName(devPath)),
-    imageDir(imageDir)
+    devPath(devPath), devName(utils::getDeviceName(devPath)), imageDir(imageDir)
 {
     fs::path p = fs::path(devPath) / "driver";
     try
@@ -397,7 +318,7 @@
         // directly read the debugfs to get the status.
         try
         {
-            auto path = internal::getDevicePath(bus, p);
+            auto path = utils::getDevicePath(bus, p);
             PMBus pmbus(path);
             uint16_t statusWord = pmbus.read(STATUS_WORD, Type::Debug);
             auto status0Vout = pmbus.insertPageNum(STATUS_VOUT, 0);
@@ -457,7 +378,7 @@
 
 void Updater::createI2CDevice()
 {
-    auto [id, addr] = internal::parseDeviceName(devName);
+    auto [id, addr] = utils::parseDeviceName(devName);
     i2c = i2c::create(id, addr);
 }
 } // namespace updater
diff --git a/tools/power-utils/updater.hpp b/tools/power-utils/updater.hpp
index 251347e..c02541b 100644
--- a/tools/power-utils/updater.hpp
+++ b/tools/power-utils/updater.hpp
@@ -19,11 +19,9 @@
 
 #include <sdbusplus/bus.hpp>
 
-#include <chrono>
 #include <filesystem>
 #include <memory>
 #include <string>
-#include <thread>
 
 class TestUpdater;
 
@@ -168,36 +166,6 @@
 {
 
 /**
- * @brief Get the device name from the device path
- *
- * @param[in] devPath - PSU path
- *
- * @return device name e.g. 3-0068
- */
-std::string getDeviceName(std::string devPath);
-
-/**
- * @brief Function to get device path using DBus bus and PSU
- * inventory Path
- *
- * @param[in] bus - The sdbusplus DBus bus connection
- * @param[in] psuInventoryPath - PSU inventory path
- *
- * @return device path e.g. /sys/bus/i2c/devices/3-0068
- */
-std::string getDevicePath(sdbusplus::bus_t& bus,
-                          const std::string& psuInventoryPath);
-
-/**
- * @brief Parse the device name to obtain bus and device address
- *
- * @param[in] devName - Device name
- *
- * @return bus and device address
- */
-std::pair<uint8_t, uint8_t> parseDeviceName(const std::string& devName);
-
-/**
  * @brief Factory function to create an Updater instance based on PSU model
  * number
  *
@@ -275,11 +243,5 @@
 std::vector<uint8_t> readFirmwareBytes(std::ifstream& inputFile,
                                        const size_t numberOfBytesToRead);
 
-/**
- * @brief Wrapper to check existence of PSU JSON file
- *
- * @return true or false (true if using JSON file)
- */
-bool usePsuJsonFile();
 } // namespace internal
 } // namespace updater
diff --git a/tools/power-utils/utils.cpp b/tools/power-utils/utils.cpp
index 0afc4a8..e70004d 100644
--- a/tools/power-utils/utils.cpp
+++ b/tools/power-utils/utils.cpp
@@ -13,6 +13,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+#include "config.h"
+
 #include "utils.hpp"
 
 #include "utility.hpp"
@@ -20,14 +22,21 @@
 #include <phosphor-logging/log.hpp>
 #include <xyz/openbmc_project/Common/Device/error.hpp>
 
+#include <cassert>
 #include <exception>
+#include <filesystem>
+#include <format>
+#include <iomanip>
+#include <ios>
 #include <iostream>
 #include <regex>
+#include <sstream>
 #include <stdexcept>
 
 using namespace phosphor::logging;
 using namespace phosphor::power::util;
 using namespace sdbusplus::xyz::openbmc_project::Common::Device::Error;
+namespace fs = std::filesystem;
 
 namespace utils
 {
@@ -165,4 +174,73 @@
     return false;
 }
 
+std::string getDeviceName(std::string devPath)
+{
+    if (devPath.back() == '/')
+    {
+        devPath.pop_back();
+    }
+    return fs::path(devPath).stem().string();
+}
+
+std::string getDevicePath(sdbusplus::bus_t& bus,
+                          const std::string& psuInventoryPath)
+{
+    try
+    {
+        if (usePsuJsonFile())
+        {
+            auto data = loadJSONFromFile(PSU_JSON_PATH);
+            if (data == nullptr)
+            {
+                return {};
+            }
+            auto devicePath = data["psuDevices"][psuInventoryPath];
+            if (devicePath.empty())
+            {
+                log<level::WARNING>("Unable to find psu devices or path");
+            }
+            return devicePath;
+        }
+        else
+        {
+            const auto [i2cbus, i2caddr] = getPsuI2c(bus, psuInventoryPath);
+            const auto DevicePath = "/sys/bus/i2c/devices/";
+            std::ostringstream ss;
+            ss << std::hex << std::setw(4) << std::setfill('0') << i2caddr;
+            std::string addrStr = ss.str();
+            std::string busStr = std::to_string(i2cbus);
+            std::string devPath = DevicePath + busStr + "-" + addrStr;
+            return devPath;
+        }
+    }
+    catch (const std::exception& e)
+    {
+        log<level::ERR>(
+            std::format("Error in getDevicePath: {}", e.what()).c_str());
+        return {};
+    }
+    catch (...)
+    {
+        log<level::ERR>("Unknown error occurred in getDevicePath");
+        return {};
+    }
+}
+
+std::pair<uint8_t, uint8_t> parseDeviceName(const std::string& devName)
+{
+    // Get I2C bus and device address, e.g. 3-0068
+    // is parsed to bus 3, device address 0x68
+    auto pos = devName.find('-');
+    assert(pos != std::string::npos);
+    uint8_t busId = std::stoi(devName.substr(0, pos));
+    uint8_t devAddr = std::stoi(devName.substr(pos + 1), nullptr, 16);
+    return {busId, devAddr};
+}
+
+bool usePsuJsonFile()
+{
+    return checkFileExists(PSU_JSON_PATH);
+}
+
 } // namespace utils
diff --git a/tools/power-utils/utils.hpp b/tools/power-utils/utils.hpp
index 4c86b54..256ae60 100644
--- a/tools/power-utils/utils.hpp
+++ b/tools/power-utils/utils.hpp
@@ -23,6 +23,7 @@
 #include <memory>
 #include <string>
 #include <tuple>
+#include <utility> // for std::pair
 
 /**
  * @namespace utils
@@ -85,4 +86,41 @@
  */
 bool checkFileExists(const std::string& filePath);
 
+/**
+ * @brief Get the device name from the device path
+ *
+ * @param[in] devPath - PSU path
+ *
+ * @return device name e.g. 3-0068
+ */
+std::string getDeviceName(std::string devPath);
+
+/**
+ * @brief Function to get device path using DBus bus and PSU
+ * inventory Path
+ *
+ * @param[in] bus - The sdbusplus DBus bus connection
+ * @param[in] psuInventoryPath - PSU inventory path
+ *
+ * @return device path e.g. /sys/bus/i2c/devices/3-0068
+ */
+std::string getDevicePath(sdbusplus::bus_t& bus,
+                          const std::string& psuInventoryPath);
+
+/**
+ * @brief Parse the device name to obtain bus and device address
+ *
+ * @param[in] devName - Device name
+ *
+ * @return bus and device address
+ */
+std::pair<uint8_t, uint8_t> parseDeviceName(const std::string& devName);
+
+/**
+ * @brief Wrapper to check existence of PSU JSON file
+ *
+ * @return true or false (true if using JSON file)
+ */
+bool usePsuJsonFile();
+
 } // namespace utils
diff --git a/tools/power-utils/version.cpp b/tools/power-utils/version.cpp
index 26507ee..738664d 100644
--- a/tools/power-utils/version.cpp
+++ b/tools/power-utils/version.cpp
@@ -39,6 +39,17 @@
 namespace internal
 {
 
+// PsuInfo contains the device path, PMBus access type, and sysfs file name
+using PsuVersionInfo =
+    std::tuple<std::string, phosphor::pmbus::Type, std::string>;
+
+/**
+ * @brief Get PSU version information
+ *
+ * @param[in] psuInventoryPath - The PSU inventory path.
+ *
+ * @return tuple - device path, PMBus access type, and sysfs file name
+ */
 PsuVersionInfo getVersionInfo(const std::string& psuInventoryPath)
 {
     auto data = loadJSONFromFile(PSU_JSON_PATH);
@@ -64,24 +75,83 @@
 
     auto type = getPMBusAccessType(data);
 
-    std::string versionStr;
+    std::string fileName;
     for (const auto& fru : data["fruConfigs"])
     {
-        if (fru["propertyName"] == "Version")
+        if (fru.contains("propertyName") &&
+            (fru["propertyName"] == "Version") && fru.contains("fileName"))
         {
-            versionStr = fru["fileName"].get<std::string>();
+            fileName = fru["fileName"];
             break;
         }
     }
-    if (versionStr.empty())
+    if (fileName.empty())
     {
         log<level::WARNING>("Unable to find Version file");
         return {};
     }
-    return std::make_tuple(*devicePath, type, versionStr);
+    return std::make_tuple(*devicePath, type, fileName);
 }
 
-// A default implemention compare the string itself
+/**
+ * @brief Get the PSU version from sysfs.
+ *
+ * Obtain PSU information from the PSU JSON file.
+ *
+ * Throws an exception if an error occurs.
+ *
+ * @param[in] psuInventoryPath - PSU D-Bus inventory path
+ *
+ * @return PSU version, or "" if none found
+ */
+std::string getVersionJson(const std::string& psuInventoryPath)
+{
+    // Get PSU device path, PMBus access type, and sysfs file name from JSON
+    const auto [devicePath, type, fileName] = getVersionInfo(psuInventoryPath);
+
+    // Read version from sysfs file
+    std::string version;
+    if (!devicePath.empty() && !fileName.empty())
+    {
+        phosphor::pmbus::PMBus pmbus(devicePath);
+        version = pmbus.readString(fileName, type);
+    }
+    return version;
+}
+
+/**
+ * @brief Get the PSU version from sysfs.
+ *
+ * Obtain PSU information from D-Bus.
+ *
+ * Throws an exception if an error occurs.
+ *
+ * @param[in] bus - D-Bus connection
+ * @param[in] psuInventoryPath - PSU D-Bus inventory path
+ *
+ * @return PSU version, or "" if none found
+ */
+std::string getVersionDbus(sdbusplus::bus_t& bus,
+                           const std::string& psuInventoryPath)
+{
+    // Get PSU I2C bus/address and create PMBus interface
+    const auto [i2cbus, i2caddr] = getPsuI2c(bus, psuInventoryPath);
+    auto pmbus = getPmbusIntf(i2cbus, i2caddr);
+
+    // Read version from sysfs file
+    std::string name = "fw_version";
+    auto type = phosphor::pmbus::Type::HwmonDeviceDebug;
+    std::string version = pmbus->readString(name, type);
+    return version;
+}
+
+/**
+ * @brief Get firmware latest version
+ *
+ * @param[in] versions - String of versions
+ *
+ * @return version - latest firmware level
+ */
 std::string getLatestDefault(const std::vector<std::string>& versions)
 {
     std::string latest;
@@ -97,38 +167,22 @@
 
 } // namespace internal
 
-std::string getVersion(const std::string& psuInventoryPath)
-{
-    const auto& [devicePath, type, versionStr] =
-        internal::getVersionInfo(psuInventoryPath);
-    if (devicePath.empty() || versionStr.empty())
-    {
-        return "";
-    }
-    std::string version;
-    try
-    {
-        phosphor::pmbus::PMBus pmbus(devicePath);
-        version = pmbus.readString(versionStr, type);
-    }
-    catch (const std::exception& ex)
-    {
-        log<level::ERR>(ex.what());
-    }
-    return version;
-}
-
 std::string getVersion(sdbusplus::bus_t& bus,
                        const std::string& psuInventoryPath)
 {
     std::string version;
     try
     {
-        const auto& [i2cbus, i2caddr] = getPsuI2c(bus, psuInventoryPath);
-        auto pmbus = getPmbusIntf(i2cbus, i2caddr);
-        std::string name = "fw_version";
-        auto type = phosphor::pmbus::Type::HwmonDeviceDebug;
-        version = pmbus->readString(name, type);
+        if (usePsuJsonFile())
+        {
+            // Obtain PSU information from JSON file
+            version = internal::getVersionJson(psuInventoryPath);
+        }
+        else
+        {
+            // Obtain PSU information from D-Bus
+            version = internal::getVersionDbus(bus, psuInventoryPath);
+        }
     }
     catch (const std::exception& e)
     {
@@ -157,4 +211,5 @@
     // So just compare by strings is OK for these cases
     return internal::getLatestDefault(versions);
 }
+
 } // namespace version
diff --git a/tools/power-utils/version.hpp b/tools/power-utils/version.hpp
index 4770a71..98735fe 100644
--- a/tools/power-utils/version.hpp
+++ b/tools/power-utils/version.hpp
@@ -20,58 +20,22 @@
 #include <sdbusplus/bus.hpp>
 
 #include <string>
-#include <tuple>
 #include <vector>
 
 namespace version
 {
-namespace internal
-{
-// PsuInfo contains the device path, pmbus read type, and the version string
-using PsuVersionInfo =
-    std::tuple<std::string, phosphor::pmbus::Type, std::string>;
-
-/**
- * @brief Get PSU version information
- *
- * @param[in] psuInventoryPath - The PSU inventory path.
- *
- * @return tuple - device path, pmbus read type and PSU version
- */
-PsuVersionInfo getVersionInfo(const std::string& psuInventoryPath);
-
-/**
- * @brief Get firmware latest version
- *
- * @param[in] versions - String of versions
- *
- * @return version - latest firmware level
- */
-std::string getLatestDefault(const std::vector<std::string>& versions);
-
-} // namespace internal
-
 /**
  * Get the software version of the PSU using sysfs
  *
- * @param[in] bus - Systemd bus connection
- * @param[in] psuInventoryPath - The inventory path of the PSU
+ * @param[in] bus - D-Bus connection
+ * @param[in] psuInventoryPath - PSU D-Bus inventory path
  *
- * @return The version of the PSU
+ * @return PSU version, or "" if version could not be found
  */
 std::string getVersion(sdbusplus::bus_t& bus,
                        const std::string& psuInventoryPath);
 
 /**
- * Get the software version of the PSU using psu.json
- *
- * @param[in] psuInventoryPath - The inventory path of the PSU
- *
- * @return The version of the PSU
- */
-std::string getVersion(const std::string& psuInventoryPath);
-
-/**
  * Get the latest version from a list of versions
  *
  * @param[in] versions - The list of PSU version strings
