diff --git a/src/report_factory.cpp b/src/report_factory.cpp
index 5f80355..2d7cd40 100644
--- a/src/report_factory.cpp
+++ b/src/report_factory.cpp
@@ -26,19 +26,18 @@
     std::vector<LabeledMetricParameters> labeledMetricParams, bool enabled,
     Readings readings) const
 {
-    auto metrics =
-        utils::transform(labeledMetricParams,
-                         [this](const LabeledMetricParameters& param)
-                             -> std::shared_ptr<interfaces::Metric> {
-                             namespace ts = utils::tstring;
+    auto metrics = utils::transform(labeledMetricParams,
+                                    [this](const LabeledMetricParameters& param)
+                                        -> std::shared_ptr<interfaces::Metric> {
+        namespace ts = utils::tstring;
 
-                             return std::make_shared<Metric>(
-                                 getSensors(param.at_label<ts::SensorPath>()),
-                                 param.at_label<ts::OperationType>(),
-                                 param.at_label<ts::CollectionTimeScope>(),
-                                 param.at_label<ts::CollectionDuration>(),
-                                 std::make_unique<Clock>());
-                         });
+        return std::make_shared<Metric>(
+            getSensors(param.at_label<ts::SensorPath>()),
+            param.at_label<ts::OperationType>(),
+            param.at_label<ts::CollectionTimeScope>(),
+            param.at_label<ts::CollectionDuration>(),
+            std::make_unique<Clock>());
+    });
 
     return std::make_unique<Report>(
         bus->get_io_context(), objServer, id, name, reportingType,
@@ -98,14 +97,13 @@
 {
     using namespace utils::tstring;
 
-    return utils::transform(
-        sensorPaths,
-        [this](const LabeledSensorInfo& sensorPath)
-            -> std::shared_ptr<interfaces::Sensor> {
-            return sensorCache.makeSensor<Sensor>(
-                sensorPath.at_label<Service>(), sensorPath.at_label<Path>(),
-                sensorPath.at_label<Metadata>(), bus->get_io_context(), bus);
-        });
+    return utils::transform(sensorPaths,
+                            [this](const LabeledSensorInfo& sensorPath)
+                                -> std::shared_ptr<interfaces::Sensor> {
+        return sensorCache.makeSensor<Sensor>(
+            sensorPath.at_label<Service>(), sensorPath.at_label<Path>(),
+            sensorPath.at_label<Metadata>(), bus->get_io_context(), bus);
+    });
 }
 
 std::vector<LabeledMetricParameters> ReportFactory::convertMetricParams(
