diff --git a/utility.hpp b/utility.hpp
index 168bd57..7db9047 100644
--- a/utility.hpp
+++ b/utility.hpp
@@ -1,17 +1,17 @@
 #pragma once
 
-#include <sdbusplus/bus.hpp>
-#include <unistd.h>
 #include <fcntl.h>
-#include <phosphor-logging/log.hpp>
-#include <phosphor-logging/elog.hpp>
+#include <unistd.h>
+
 #include <phosphor-logging/elog-errors.hpp>
+#include <phosphor-logging/elog.hpp>
+#include <phosphor-logging/log.hpp>
+#include <sdbusplus/bus.hpp>
 #include <xyz/openbmc_project/Common/error.hpp>
 
-
 using namespace phosphor::logging;
-using InternalFailure = sdbusplus::xyz::openbmc_project::Common::
-                            Error::InternalFailure;
+using InternalFailure =
+    sdbusplus::xyz::openbmc_project::Common::Error::InternalFailure;
 
 namespace phosphor
 {
@@ -33,50 +33,47 @@
 
 class FileDescriptor
 {
-    public:
-        FileDescriptor() = delete;
-        FileDescriptor(const FileDescriptor&) = delete;
-        FileDescriptor(FileDescriptor&&) = default;
-        FileDescriptor& operator=(const FileDescriptor&) = delete;
-        FileDescriptor& operator=(FileDescriptor&&) = default;
+  public:
+    FileDescriptor() = delete;
+    FileDescriptor(const FileDescriptor&) = delete;
+    FileDescriptor(FileDescriptor&&) = default;
+    FileDescriptor& operator=(const FileDescriptor&) = delete;
+    FileDescriptor& operator=(FileDescriptor&&) = default;
 
-        FileDescriptor(int fd) : fd(fd)
+    FileDescriptor(int fd) : fd(fd)
+    {}
+
+    ~FileDescriptor()
+    {
+        if (fd != -1)
         {
+            close(fd);
         }
+    }
 
-        ~FileDescriptor()
+    int operator()()
+    {
+        return fd;
+    }
+
+    void open(const std::string& pathname, int flags)
+    {
+        fd = ::open(pathname.c_str(), flags);
+        if (-1 == fd)
         {
-            if (fd != -1)
-            {
-                close(fd);
-            }
+            log<level::ERR>("Failed to open file device: ",
+                            entry("PATHNAME=%s", pathname.c_str()));
+            elog<InternalFailure>();
         }
+    }
 
-        int operator()()
-        {
-            return fd;
-        }
+    bool is_open()
+    {
+        return fd != -1;
+    }
 
-        void open(const std::string& pathname, int flags)
-        {
-            fd = ::open(pathname.c_str(), flags);
-            if (-1 == fd)
-            {
-                log<level::ERR>(
-                     "Failed to open file device: ",
-                     entry("PATHNAME=%s", pathname.c_str()));
-                elog<InternalFailure>();
-            }
-        }
-
-        bool is_open()
-        {
-            return fd != -1;
-        }
-
-    private:
-        int fd = -1;
-
+  private:
+    int fd = -1;
 };
 
 /**
@@ -90,10 +87,8 @@
  * @return - The full object path containing the property value
  */
 template <typename T>
-auto getObjMap(const std::string& path,
-               const std::string& intf,
-               const std::string& prop,
-               const T& value)
+auto getObjMap(const std::string& path, const std::string& intf,
+               const std::string& prop, const T& value)
 {
     using Property = std::string;
     using Value = std::variant<T>;
@@ -116,6 +111,6 @@
     return objectMap;
 }
 
-}
-}
-}
+} // namespace util
+} // namespace fan
+} // namespace phosphor
