diff --git a/requester/handler.hpp b/requester/handler.hpp
index c665822..465e34f 100644
--- a/requester/handler.hpp
+++ b/requester/handler.hpp
@@ -146,9 +146,8 @@
         uint8_t numRetries = static_cast<uint8_t>(NUMBER_OF_REQUEST_RETRIES),
         std::chrono::milliseconds responseTimeOut =
             std::chrono::milliseconds(RESPONSE_TIME_OUT)) :
-        pldmTransport(pldmTransport),
-        event(event), instanceIdDb(instanceIdDb), verbose(verbose),
-        instanceIdExpiryInterval(instanceIdExpiryInterval),
+        pldmTransport(pldmTransport), event(event), instanceIdDb(instanceIdDb),
+        verbose(verbose), instanceIdExpiryInterval(instanceIdExpiryInterval),
         numRetries(numRetries), responseTimeOut(responseTimeOut)
     {}
 
@@ -475,8 +474,7 @@
     explicit SendRecvMsgOperation(Handler<RequestInterface>& handler,
                                   mctp_eid_t eid, pldm::Request&& request,
                                   R&& r) :
-        handler(handler),
-        request(std::move(request)), receiver(std::move(r))
+        handler(handler), request(std::move(request)), receiver(std::move(r))
     {
         auto requestMsg =
             reinterpret_cast<const pldm_msg*>(this->request.data());
@@ -611,8 +609,7 @@
 
     explicit SendRecvMsgSender(requester::Handler<RequestInterface>& handler,
                                mctp_eid_t eid, pldm::Request&& request) :
-        handler(handler),
-        eid(eid), request(std::move(request))
+        handler(handler), eid(eid), request(std::move(request))
     {}
 
     friend auto tag_invoke(stdexec::get_completion_signatures_t,
@@ -658,8 +655,8 @@
 {
     return SendRecvMsgSender(*this, eid, std::move(request)) |
            stdexec::then([](int rc, const pldm_msg* resp, size_t respLen) {
-        return std::make_tuple(rc, resp, respLen);
-    });
+               return std::make_tuple(rc, resp, respLen);
+           });
 }
 
 } // namespace requester
diff --git a/requester/mctp_endpoint_discovery.cpp b/requester/mctp_endpoint_discovery.cpp
index 2780281..d0122c9 100644
--- a/requester/mctp_endpoint_discovery.cpp
+++ b/requester/mctp_endpoint_discovery.cpp
@@ -24,10 +24,9 @@
 MctpDiscovery::MctpDiscovery(
     sdbusplus::bus_t& bus,
     std::initializer_list<MctpDiscoveryHandlerIntf*> list) :
-    bus(bus),
-    mctpEndpointAddedSignal(
-        bus, interfacesAdded(MCTPPath),
-        std::bind_front(&MctpDiscovery::discoverEndpoints, this)),
+    bus(bus), mctpEndpointAddedSignal(
+                  bus, interfacesAdded(MCTPPath),
+                  std::bind_front(&MctpDiscovery::discoverEndpoints, this)),
     mctpEndpointRemovedSignal(
         bus, interfacesRemoved(MCTPPath),
         std::bind_front(&MctpDiscovery::removeEndpoints, this)),
diff --git a/requester/request.hpp b/requester/request.hpp
index 0ba6172..7182c4b 100644
--- a/requester/request.hpp
+++ b/requester/request.hpp
@@ -48,8 +48,7 @@
     explicit RequestRetryTimer(sdeventplus::Event& event, uint8_t numRetries,
                                std::chrono::milliseconds timeout) :
 
-        event(event),
-        numRetries(numRetries), timeout(timeout),
+        event(event), numRetries(numRetries), timeout(timeout),
         timer(event.get(), std::bind_front(&RequestRetryTimer::callback, this))
     {}
 
diff --git a/requester/test/handler_test.cpp b/requester/test/handler_test.cpp
index f37040f..327817c 100644
--- a/requester/test/handler_test.cpp
+++ b/requester/test/handler_test.cpp
@@ -75,9 +75,9 @@
 
 TEST_F(HandlerTest, singleRequestResponseScenario)
 {
-    Handler<NiceMock<MockRequest>> reqHandler(pldmTransport, event,
-                                              instanceIdDb, false, seconds(1),
-                                              2, milliseconds(100));
+    Handler<NiceMock<MockRequest>> reqHandler(
+        pldmTransport, event, instanceIdDb, false, seconds(1), 2,
+        milliseconds(100));
     pldm::Request request{};
     auto instanceId = instanceIdDb.next(eid);
     EXPECT_EQ(instanceId, 0);
@@ -96,9 +96,9 @@
 
 TEST_F(HandlerTest, singleRequestInstanceIdTimerExpired)
 {
-    Handler<NiceMock<MockRequest>> reqHandler(pldmTransport, event,
-                                              instanceIdDb, false, seconds(1),
-                                              2, milliseconds(100));
+    Handler<NiceMock<MockRequest>> reqHandler(
+        pldmTransport, event, instanceIdDb, false, seconds(1), 2,
+        milliseconds(100));
     pldm::Request request{};
     auto instanceId = instanceIdDb.next(eid);
     EXPECT_EQ(instanceId, 0);
@@ -115,9 +115,9 @@
 
 TEST_F(HandlerTest, multipleRequestResponseScenario)
 {
-    Handler<NiceMock<MockRequest>> reqHandler(pldmTransport, event,
-                                              instanceIdDb, false, seconds(2),
-                                              2, milliseconds(100));
+    Handler<NiceMock<MockRequest>> reqHandler(
+        pldmTransport, event, instanceIdDb, false, seconds(2), 2,
+        milliseconds(100));
     pldm::Request request{};
     auto instanceId = instanceIdDb.next(eid);
     EXPECT_EQ(instanceId, 0);
@@ -156,39 +156,40 @@
 TEST_F(HandlerTest, singleRequestResponseScenarioUsingCoroutine)
 {
     exec::async_scope scope;
-    Handler<NiceMock<MockRequest>> reqHandler(pldmTransport, event,
-                                              instanceIdDb, false, seconds(1),
-                                              2, milliseconds(100));
+    Handler<NiceMock<MockRequest>> reqHandler(
+        pldmTransport, event, instanceIdDb, false, seconds(1), 2,
+        milliseconds(100));
 
     auto instanceId = instanceIdDb.next(eid);
     EXPECT_EQ(instanceId, 0);
 
-    scope.spawn(stdexec::just() | stdexec::let_value([&] -> exec::task<void> {
-        pldm::Request request(sizeof(pldm_msg_hdr) + sizeof(uint8_t), 0);
-        const pldm_msg* responseMsg;
-        size_t responseLen;
-        int rc = PLDM_SUCCESS;
+    scope.spawn(
+        stdexec::just() | stdexec::let_value([&] -> exec::task<void> {
+            pldm::Request request(sizeof(pldm_msg_hdr) + sizeof(uint8_t), 0);
+            const pldm_msg* responseMsg;
+            size_t responseLen;
+            int rc = PLDM_SUCCESS;
 
-        auto requestPtr = reinterpret_cast<pldm_msg*>(request.data());
-        requestPtr->hdr.instance_id = instanceId;
+            auto requestPtr = reinterpret_cast<pldm_msg*>(request.data());
+            requestPtr->hdr.instance_id = instanceId;
 
-        try
-        {
-            std::tie(rc, responseMsg, responseLen) =
-                co_await reqHandler.sendRecvMsg(eid, std::move(request));
-        }
-        catch (...)
-        {
-            std::rethrow_exception(std::current_exception());
-        }
+            try
+            {
+                std::tie(rc, responseMsg, responseLen) =
+                    co_await reqHandler.sendRecvMsg(eid, std::move(request));
+            }
+            catch (...)
+            {
+                std::rethrow_exception(std::current_exception());
+            }
 
-        EXPECT_NE(responseLen, 0);
+            EXPECT_NE(responseLen, 0);
 
-        this->pldmResponseCallBack(eid, responseMsg, responseLen);
+            this->pldmResponseCallBack(eid, responseMsg, responseLen);
 
-        EXPECT_EQ(validResponse, true);
-    }),
-                exec::default_task_context<void>(exec::inline_scheduler{}));
+            EXPECT_EQ(validResponse, true);
+        }),
+        exec::default_task_context<void>(exec::inline_scheduler{}));
 
     pldm::Response mockResponse(sizeof(pldm_msg_hdr) + sizeof(uint8_t), 0);
     auto mockResponsePtr =
@@ -202,26 +203,27 @@
 TEST_F(HandlerTest, singleRequestCancellationScenarioUsingCoroutine)
 {
     exec::async_scope scope;
-    Handler<NiceMock<MockRequest>> reqHandler(pldmTransport, event,
-                                              instanceIdDb, false, seconds(1),
-                                              2, milliseconds(100));
+    Handler<NiceMock<MockRequest>> reqHandler(
+        pldmTransport, event, instanceIdDb, false, seconds(1), 2,
+        milliseconds(100));
     auto instanceId = instanceIdDb.next(eid);
     EXPECT_EQ(instanceId, 0);
 
     bool stopped = false;
 
-    scope.spawn(stdexec::just() | stdexec::let_value([&] -> exec::task<void> {
-        pldm::Request request(sizeof(pldm_msg_hdr) + sizeof(uint8_t), 0);
-        pldm::Response response;
+    scope.spawn(
+        stdexec::just() | stdexec::let_value([&] -> exec::task<void> {
+            pldm::Request request(sizeof(pldm_msg_hdr) + sizeof(uint8_t), 0);
+            pldm::Response response;
 
-        auto requestPtr = reinterpret_cast<pldm_msg*>(request.data());
-        requestPtr->hdr.instance_id = instanceId;
+            auto requestPtr = reinterpret_cast<pldm_msg*>(request.data());
+            requestPtr->hdr.instance_id = instanceId;
 
-        co_await reqHandler.sendRecvMsg(eid, std::move(request));
+            co_await reqHandler.sendRecvMsg(eid, std::move(request));
 
-        EXPECT_TRUE(false); // unreachable
-    }) | stdexec::upon_stopped([&] { stopped = true; }),
-                exec::default_task_context<void>(exec::inline_scheduler{}));
+            EXPECT_TRUE(false); // unreachable
+        }) | stdexec::upon_stopped([&] { stopped = true; }),
+        exec::default_task_context<void>(exec::inline_scheduler{}));
 
     scope.request_stop();
 
@@ -234,9 +236,9 @@
 {
     struct _
     {
-        static exec::task<uint8_t> getTIDTask(Handler<MockRequest>& handler,
-                                              mctp_eid_t eid,
-                                              uint8_t instanceId, uint8_t& tid)
+        static exec::task<uint8_t>
+            getTIDTask(Handler<MockRequest>& handler, mctp_eid_t eid,
+                       uint8_t instanceId, uint8_t& tid)
         {
             pldm::Request request(sizeof(pldm_msg_hdr), 0);
             auto requestMsg = reinterpret_cast<pldm_msg*>(request.data());
@@ -268,12 +270,13 @@
     // Execute a coroutine to send getTID command. The coroutine is suspended
     // until reqHandler.handleResponse() is received.
     scope.spawn(stdexec::just() | stdexec::let_value([&] -> exec::task<void> {
-        uint8_t respTid = 0;
+                    uint8_t respTid = 0;
 
-        co_await _::getTIDTask(reqHandler, eid, instanceId, respTid);
+                    co_await _::getTIDTask(reqHandler, eid, instanceId,
+                                           respTid);
 
-        EXPECT_EQ(expectedTid, respTid);
-    }),
+                    EXPECT_EQ(expectedTid, respTid);
+                }),
                 exec::default_task_context<void>(exec::inline_scheduler{}));
 
     pldm::Response mockResponse(sizeof(pldm_msg_hdr) + PLDM_GET_TID_RESP_BYTES,
diff --git a/requester/test/mctp_endpoint_discovery_test.cpp b/requester/test/mctp_endpoint_discovery_test.cpp
index df390a0..f955bc0 100644
--- a/requester/test/mctp_endpoint_discovery_test.cpp
+++ b/requester/test/mctp_endpoint_discovery_test.cpp
@@ -30,8 +30,8 @@
     EXPECT_CALL(manager2, handleMctpEndpoints(_)).Times(1);
 
     auto mctpDiscoveryHandler = std::make_unique<pldm::MctpDiscovery>(
-        bus, std::initializer_list<pldm::MctpDiscoveryHandlerIntf*>{&manager1,
-                                                                    &manager2});
+        bus, std::initializer_list<pldm::MctpDiscoveryHandlerIntf*>{
+                 &manager1, &manager2});
     mctpDiscoveryHandler = nullptr;
 }
 
