diff --git a/.clang-format b/.clang-format
index d43e884..28e3328 100644
--- a/.clang-format
+++ b/.clang-format
@@ -87,7 +87,7 @@
 IndentWrappedFunctionNames: true
 InsertNewlineAtEOF: true
 KeepEmptyLinesAtTheStartOfBlocks: false
-LambdaBodyIndentation: OuterScope
+LambdaBodyIndentation: Signature
 LineEnding: LF
 MacroBlockBegin: ''
 MacroBlockEnd:   ''
@@ -98,13 +98,14 @@
 ObjCSpaceBeforeProtocolList: true
 PackConstructorInitializers: BinPack
 PenaltyBreakAssignment: 25
-PenaltyBreakBeforeFirstCallParameter: 19
+PenaltyBreakBeforeFirstCallParameter: 50
 PenaltyBreakComment: 300
 PenaltyBreakFirstLessLess: 120
 PenaltyBreakString: 1000
+PenaltyBreakTemplateDeclaration: 10
 PenaltyExcessCharacter: 1000000
 PenaltyReturnTypeOnItsOwnLine: 60
-PenaltyIndentedWhitespace: 0
+PenaltyIndentedWhitespace: 1
 PointerAlignment: Left
 QualifierAlignment: Left
 ReferenceAlignment: Left
diff --git a/ipmisnoop/ipmisnoop.cpp b/ipmisnoop/ipmisnoop.cpp
index 64c685e..56d06d9 100644
--- a/ipmisnoop/ipmisnoop.cpp
+++ b/ipmisnoop/ipmisnoop.cpp
@@ -8,9 +8,9 @@
 {
     const std::string propertyName = "Position";
 
-    auto method = bus.new_method_call(selectorService.c_str(),
-                                      selectorObject.c_str(),
-                                      "org.freedesktop.DBus.Properties", "Get");
+    auto method =
+        bus.new_method_call(selectorService.c_str(), selectorObject.c_str(),
+                            "org.freedesktop.DBus.Properties", "Get");
     method.append(selectorIface.c_str(), propertyName);
 
     try
@@ -97,34 +97,34 @@
         sdbusplus::bus::match::rules::propertiesChanged(selectorObject,
                                                         selectorIface),
         [&](sdbusplus::message_t& msg) {
-        std::string objectName;
-        std::map<std::string, Selector::PropertiesVariant> msgData;
-        msg.read(objectName, msgData);
+            std::string objectName;
+            std::map<std::string, Selector::PropertiesVariant> msgData;
+            msg.read(objectName, msgData);
 
-        auto valPropMap = msgData.find("Position");
-        {
-            if (valPropMap == msgData.end())
+            auto valPropMap = msgData.find("Position");
             {
-                std::cerr << "Position property not found " << std::endl;
-                return;
-            }
-
-            posVal = std::get<size_t>(valPropMap->second);
-
-            if (posVal > minPositionVal && posVal < maxPositionVal)
-            {
-                std::tuple<uint64_t, secondary_post_code_t> postcodes =
-                    reporters[posVal - 1]->value();
-                uint64_t postcode = std::get<uint64_t>(postcodes);
-
-                // write postcode into seven segment display
-                if (postCodeDisplay(postcode) < 0)
+                if (valPropMap == msgData.end())
                 {
-                    fprintf(stderr, "Error in display the postcode\n");
+                    std::cerr << "Position property not found " << std::endl;
+                    return;
+                }
+
+                posVal = std::get<size_t>(valPropMap->second);
+
+                if (posVal > minPositionVal && posVal < maxPositionVal)
+                {
+                    std::tuple<uint64_t, secondary_post_code_t> postcodes =
+                        reporters[posVal - 1]->value();
+                    uint64_t postcode = std::get<uint64_t>(postcodes);
+
+                    // write postcode into seven segment display
+                    if (postCodeDisplay(postcode) < 0)
+                    {
+                        fprintf(stderr, "Error in display the postcode\n");
+                    }
                 }
             }
-        }
-    });
+        });
 }
 
 // handle muti-host D-bus
diff --git a/ipmisnoop/ipmisnoop.hpp b/ipmisnoop/ipmisnoop.hpp
index b8f737a..d8319ac 100644
--- a/ipmisnoop/ipmisnoop.hpp
+++ b/ipmisnoop/ipmisnoop.hpp
@@ -54,74 +54,74 @@
             sdbusplus::bus::match::rules::propertiesChanged(objPath, rawIface),
 
             [this, &bus](sdbusplus::message_t& msg) {
-        using primarycode_t = uint64_t;
-        using secondarycode_t = std::vector<uint8_t>;
-        using postcode_t = std::tuple<primarycode_t, secondarycode_t>;
+                using primarycode_t = uint64_t;
+                using secondarycode_t = std::vector<uint8_t>;
+                using postcode_t = std::tuple<primarycode_t, secondarycode_t>;
 
-        /* sevenSegmentLedEnabled flag is set when GPIO pins are not
-        there 7 seg display for fewer platforms. So, the code for
-        postcode display and Get Selector position can be skipped in
-        those platforms.
-        */
-        if (!sevenSegmentLedEnabled)
-        {
-            return;
-        }
-
-        std::string objectName;
-        std::string InterfaceName;
-        std::map<std::string, std::variant<postcode_t>> msgData;
-        msg.read(InterfaceName, msgData);
-
-        std::filesystem::path name(msg.get_path());
-        objectName = name.filename();
-
-        std::string hostNumStr = objectName.substr(hostParseIdx);
-        size_t hostNum = std::stoi(hostNumStr);
-
-        size_t position = getSelectorPosition(bus);
-
-        if (position > maxPosition)
-        {
-            std::cerr << "Invalid position. Position should be 1 to 4 "
-                         "for all hosts "
-                      << std::endl;
-        }
-
-        // Check if it was the Value property that changed.
-        auto valPropMap = msgData.find("Value");
-        if (valPropMap == msgData.end())
-        {
-            std::cerr << "Value property is not found " << std::endl;
-            return;
-        }
-        uint64_t postcode =
-            std::get<0>(std::get<postcode_t>(valPropMap->second));
-
-        if (postcode <= maxPostcode)
-        {
-            if (position == hostNum)
-            {
-                uint8_t postcode_8bit =
-                    static_cast<uint8_t>(postcode & 0x0000FF);
-
-                // write postcode into seven segment display
-                if (postCodeDisplay(postcode_8bit) < 0)
+                /* sevenSegmentLedEnabled flag is set when GPIO pins are not
+                there 7 seg display for fewer platforms. So, the code for
+                postcode display and Get Selector position can be skipped in
+                those platforms.
+                */
+                if (!sevenSegmentLedEnabled)
                 {
-                    fprintf(stderr, "Error in display the postcode\n");
+                    return;
                 }
-            }
-            else
-            {
-                fprintf(stderr, "Host Selector Position and host "
-                                "number is not matched..\n");
-            }
-        }
-        else
-        {
-            fprintf(stderr, "invalid postcode value \n");
-        }
-    })
+
+                std::string objectName;
+                std::string InterfaceName;
+                std::map<std::string, std::variant<postcode_t>> msgData;
+                msg.read(InterfaceName, msgData);
+
+                std::filesystem::path name(msg.get_path());
+                objectName = name.filename();
+
+                std::string hostNumStr = objectName.substr(hostParseIdx);
+                size_t hostNum = std::stoi(hostNumStr);
+
+                size_t position = getSelectorPosition(bus);
+
+                if (position > maxPosition)
+                {
+                    std::cerr << "Invalid position. Position should be 1 to 4 "
+                                 "for all hosts "
+                              << std::endl;
+                }
+
+                // Check if it was the Value property that changed.
+                auto valPropMap = msgData.find("Value");
+                if (valPropMap == msgData.end())
+                {
+                    std::cerr << "Value property is not found " << std::endl;
+                    return;
+                }
+                uint64_t postcode =
+                    std::get<0>(std::get<postcode_t>(valPropMap->second));
+
+                if (postcode <= maxPostcode)
+                {
+                    if (position == hostNum)
+                    {
+                        uint8_t postcode_8bit =
+                            static_cast<uint8_t>(postcode & 0x0000FF);
+
+                        // write postcode into seven segment display
+                        if (postCodeDisplay(postcode_8bit) < 0)
+                        {
+                            fprintf(stderr, "Error in display the postcode\n");
+                        }
+                    }
+                    else
+                    {
+                        fprintf(stderr, "Host Selector Position and host "
+                                        "number is not matched..\n");
+                    }
+                }
+                else
+                {
+                    fprintf(stderr, "invalid postcode value \n");
+                }
+            })
     {}
 
     sdbusplus::bus_t& bus;
diff --git a/main.cpp b/main.cpp
index 4785044..e544a11 100644
--- a/main.cpp
+++ b/main.cpp
@@ -113,12 +113,13 @@
     sdeventplus::source::Time<sdeventplus::ClockId::Monotonic>(
         event, rateLimitEndTime, std::chrono::milliseconds(100),
         [&ioSource](auto&, auto) {
-        if (verbose)
-        {
-            fprintf(stderr, "Reenabling POST code handler\n");
-        }
-        ioSource.set_enabled(sdeventplus::source::Enabled::On);
-    }).set_floating(true);
+            if (verbose)
+            {
+                fprintf(stderr, "Reenabling POST code handler\n");
+            }
+            ioSource.set_enabled(sdeventplus::source::Enabled::On);
+        })
+        .set_floating(true);
     return true;
 }
 
@@ -151,9 +152,9 @@
 
     for (size_t i = 0; i < (readb / pccSize); i++)
     {
-        uint16_t checkCode = firstPCCPortNumber +
-                             ((aspeedPCCBuffer.size() % fullPostPCCCount)
-                              << byteShift);
+        uint16_t checkCode =
+            firstPCCPortNumber +
+            ((aspeedPCCBuffer.size() % fullPostPCCCount) << byteShift);
 
         if (checkCode == (codePtr[i] & pccPortNumberMask))
         {
