diff --git a/src/ietf-hardware/sysrepo/Sysrepo.cpp b/src/ietf-hardware/sysrepo/Sysrepo.cpp
index aff779d..1a0fe69 100644
--- a/src/ietf-hardware/sysrepo/Sysrepo.cpp
+++ b/src/ietf-hardware/sysrepo/Sysrepo.cpp
@@ -104,10 +104,10 @@
             for (const auto& sensorXPath : activeSensors) {
                 if (!seenSensors.contains(sensorXPath)) {
                     auto componentXPath = extractComponentPrefix(sensorXPath);
-                    alarms::addResourceToInventory(m_session, ALARM_THRESHOLD_CROSSING_LOW, std::nullopt, componentXPath);
-                    alarms::addResourceToInventory(m_session, ALARM_THRESHOLD_CROSSING_HIGH, std::nullopt, componentXPath);
-                    alarms::addResourceToInventory(m_session, ALARM_SENSOR_MISSING, std::nullopt, componentXPath);
-                    alarms::addResourceToInventory(m_session, ALARM_SENSOR_NONOPERATIONAL, std::nullopt, componentXPath);
+                    alarms::addResourceToInventory(m_session, ALARM_THRESHOLD_CROSSING_LOW, componentXPath);
+                    alarms::addResourceToInventory(m_session, ALARM_THRESHOLD_CROSSING_HIGH, componentXPath);
+                    alarms::addResourceToInventory(m_session, ALARM_SENSOR_MISSING, componentXPath);
+                    alarms::addResourceToInventory(m_session, ALARM_SENSOR_NONOPERATIONAL, componentXPath);
                 }
             }
             seenSensors.merge(activeSensors);
@@ -130,14 +130,14 @@
             /* Publish sideloaded alarms */
             for (const auto& [alarm, resource, severity, text] : sideLoadedAlarms) {
                 // Sideloaded alarms are not registered using the code above, let's register those too
-                alarms::addResourceToInventory(m_session, ALARM_SENSOR_MISSING, std::nullopt, resource);
+                alarms::addResourceToInventory(m_session, ALARM_SENSOR_MISSING, resource);
 
                 bool isActive = activeSideLoadedAlarms.contains({alarm, resource});
                 if (isActive && severity == "cleared") {
-                    alarms::push(m_session, alarm, std::nullopt, resource, "cleared", text);
+                    alarms::push(m_session, alarm, resource, "cleared", text);
                     activeSideLoadedAlarms.erase({alarm, resource});
                 } else if (!isActive && severity != "cleared") {
-                    alarms::push(m_session, alarm, std::nullopt, resource, severity, text);
+                    alarms::push(m_session, alarm, resource, severity, text);
                     activeSideLoadedAlarms.insert({alarm, resource});
                 }
             }
@@ -152,9 +152,9 @@
                     }
 
                     if (value == "nonoperational" && oldValue != "nonoperational") {
-                        alarms::push(m_session, ALARM_SENSOR_NONOPERATIONAL, std::nullopt, extractComponentPrefix(leaf), ALARM_SENSOR_NONOPERATIONAL_SEVERITY, ALARM_SENSOR_NONOPERATIONAL_DESCRIPTION);
+                        alarms::push(m_session, ALARM_SENSOR_NONOPERATIONAL, extractComponentPrefix(leaf), ALARM_SENSOR_NONOPERATIONAL_SEVERITY, ALARM_SENSOR_NONOPERATIONAL_DESCRIPTION);
                     } else if (value == "ok" && oldValue && oldValue != "ok" /* don't call clear-alarm if we see this node for the first time, i.e., oldvalue is nullopt */) {
-                        alarms::push(m_session, ALARM_SENSOR_NONOPERATIONAL, std::nullopt, extractComponentPrefix(leaf), ALARM_CLEARED, ALARM_SENSOR_NONOPERATIONAL_DESCRIPTION);
+                        alarms::push(m_session, ALARM_SENSOR_NONOPERATIONAL, extractComponentPrefix(leaf), ALARM_CLEARED, ALARM_SENSOR_NONOPERATIONAL_DESCRIPTION);
                     }
                 }
             }
@@ -171,14 +171,14 @@
 
                 if (state == State::NoValue) {
                     logAlarm(m_log, componentXPath, ALARM_SENSOR_MISSING, ALARM_MISSING_SEVERITY);
-                    alarms::push(m_session, ALARM_SENSOR_MISSING, std::nullopt, componentXPath, ALARM_MISSING_SEVERITY, ALARM_MISSING_DESCRIPTION);
+                    alarms::push(m_session, ALARM_SENSOR_MISSING, componentXPath, ALARM_MISSING_SEVERITY, ALARM_MISSING_DESCRIPTION);
                 } else if (prevState == State::NoValue) {
                     logAlarm(m_log, componentXPath, ALARM_SENSOR_MISSING, ALARM_CLEARED);
                     /* The alarm message is same for both setting and clearing the alarm. RFC8632 says that it is
                      * "The string used to inform operators about the alarm. This MUST contain enough information for an operator to be able to understand the problem and how to resolve it.",
                      * i.e., from my POV it does not make sense to say something like "cleared" when clearing the alarm as this would not be beneficial for the operator to understand what happened.
                      */
-                    alarms::push(m_session, ALARM_SENSOR_MISSING, std::nullopt, componentXPath, ALARM_CLEARED, ALARM_MISSING_DESCRIPTION);
+                    alarms::push(m_session, ALARM_SENSOR_MISSING, componentXPath, ALARM_CLEARED, ALARM_MISSING_DESCRIPTION);
                 }
 
                 /*
@@ -192,19 +192,19 @@
                  */
                 if (isThresholdCrossingLow(state)) {
                     logAlarm(m_log, componentXPath, ALARM_THRESHOLD_CROSSING_LOW, toYangAlarmSeverity(state));
-                    alarms::push(m_session, ALARM_THRESHOLD_CROSSING_LOW, std::nullopt, componentXPath, toYangAlarmSeverity(state), ALARM_THRESHOLD_CROSSING_LOW_DESCRIPTION);
+                    alarms::push(m_session, ALARM_THRESHOLD_CROSSING_LOW, componentXPath, toYangAlarmSeverity(state), ALARM_THRESHOLD_CROSSING_LOW_DESCRIPTION);
                 } else if (isThresholdCrossingHigh(state)) {
                     logAlarm(m_log, componentXPath, ALARM_THRESHOLD_CROSSING_HIGH, toYangAlarmSeverity(state));
-                    alarms::push(m_session, ALARM_THRESHOLD_CROSSING_HIGH, std::nullopt, componentXPath, toYangAlarmSeverity(state), ALARM_THRESHOLD_CROSSING_HIGH_DESCRIPTION);
+                    alarms::push(m_session, ALARM_THRESHOLD_CROSSING_HIGH, componentXPath, toYangAlarmSeverity(state), ALARM_THRESHOLD_CROSSING_HIGH_DESCRIPTION);
                 }
 
                 /* Now we can clear the old threshold alarms that are no longer active, i.e., we transition away from the CriticalLow/WarningLow or CriticalHigh/WarningHigh. */
                 if (!isThresholdCrossingLow(state) && isThresholdCrossingLow(prevState)) {
                     logAlarm(m_log, componentXPath, ALARM_THRESHOLD_CROSSING_LOW, ALARM_CLEARED);
-                    alarms::push(m_session, ALARM_THRESHOLD_CROSSING_LOW, std::nullopt, componentXPath, ALARM_CLEARED, ALARM_THRESHOLD_CROSSING_LOW_DESCRIPTION);
+                    alarms::push(m_session, ALARM_THRESHOLD_CROSSING_LOW, componentXPath, ALARM_CLEARED, ALARM_THRESHOLD_CROSSING_LOW_DESCRIPTION);
                 } else if (!isThresholdCrossingHigh(state) && isThresholdCrossingHigh(prevState)) {
                     logAlarm(m_log, componentXPath, ALARM_THRESHOLD_CROSSING_HIGH, ALARM_CLEARED);
-                    alarms::push(m_session, ALARM_THRESHOLD_CROSSING_HIGH, std::nullopt, componentXPath, ALARM_CLEARED, ALARM_THRESHOLD_CROSSING_HIGH_DESCRIPTION);
+                    alarms::push(m_session, ALARM_THRESHOLD_CROSSING_HIGH, componentXPath, ALARM_CLEARED, ALARM_THRESHOLD_CROSSING_HIGH_DESCRIPTION);
                 }
 
                 thresholdsStates[sensorXPath] = state;
