diff --git a/lib/include/phosphor-logging/commit.hpp b/lib/include/phosphor-logging/commit.hpp
index aa34df3..d3b291c 100644
--- a/lib/include/phosphor-logging/commit.hpp
+++ b/lib/include/phosphor-logging/commit.hpp
@@ -1,6 +1,5 @@
 #pragma once
 
-#include <phosphor-logging/lg2/commit.hpp>
 #include <sdbusplus/async.hpp>
 #include <sdbusplus/exception.hpp>
 
@@ -8,31 +7,22 @@
 {
 /** Commit a generated event/error.
  *
- *  @param t - The event to commit.
+ *  @param e - The event to commit.
  *  @return The object path of the resulting event.
  *
  *  Note: Similar to elog(), this will use the default dbus connection to
  *  perform the operation.
  */
-template <typename T>
-    requires std::is_base_of_v<sdbusplus::exception::generated_event_base, T>
-auto commit(T&& t) -> sdbusplus::message::object_path
-{
-    return details::commit(std::forward<T>(t));
-}
+auto commit(sdbusplus::exception::generated_event_base&& e)
+    -> sdbusplus::message::object_path;
 
 /** Commit a generated event/error (using async context).
  *
  *  @param ctx - The async context to use.
- *  @param t - The event to commit.
+ *  @param e - The event to commit.
  *  @return The object path of the resulting event.
  */
-template <typename T>
-    requires std::is_base_of_v<sdbusplus::exception::generated_event_base, T>
 auto commit(sdbusplus::async::context& ctx,
-            T&& t) -> sdbusplus::async::task<sdbusplus::message::object_path>
-{
-    return details::commit(ctx, std::forward<T>(t));
-}
-
+            sdbusplus::exception::generated_event_base&& e)
+    -> sdbusplus::async::task<sdbusplus::message::object_path>;
 } // namespace lg2
diff --git a/lib/include/phosphor-logging/lg2/commit.hpp b/lib/include/phosphor-logging/lg2/commit.hpp
deleted file mode 100644
index 47c5be1..0000000
--- a/lib/include/phosphor-logging/lg2/commit.hpp
+++ /dev/null
@@ -1,18 +0,0 @@
-#pragma once
-
-#include <sdbusplus/async.hpp>
-#include <sdbusplus/exception.hpp>
-
-namespace lg2::details
-{
-
-/* Non-template versions of the commit functions */
-
-auto commit(sdbusplus::exception::generated_event_base&& t)
-    -> sdbusplus::message::object_path;
-
-auto commit(sdbusplus::async::context& ctx,
-            sdbusplus::exception::generated_event_base&& t)
-    -> sdbusplus::async::task<sdbusplus::message::object_path>;
-
-} // namespace lg2::details
diff --git a/lib/lg2_commit.cpp b/lib/lg2_commit.cpp
index 4f37cb6..d5ae41b 100644
--- a/lib/lg2_commit.cpp
+++ b/lib/lg2_commit.cpp
@@ -5,14 +5,16 @@
 #include <sys/syslog.h>
 
 #include <nlohmann/json.hpp>
+#include <phosphor-logging/commit.hpp>
 #include <phosphor-logging/lg2.hpp>
-#include <phosphor-logging/lg2/commit.hpp>
 #include <sdbusplus/async.hpp>
 #include <sdbusplus/exception.hpp>
 #include <xyz/openbmc_project/Logging/Create/client.hpp>
 #include <xyz/openbmc_project/Logging/Entry/client.hpp>
 
-namespace lg2::details
+namespace lg2
+{
+namespace details
 {
 
 using Create = sdbusplus::client::xyz::openbmc_project::logging::Create<>;
@@ -97,52 +99,6 @@
     return result;
 }
 
-auto commit(sdbusplus::exception::generated_event_base&& t)
-    -> sdbusplus::message::object_path
-{
-    if constexpr (LG2_COMMIT_JOURNAL)
-    {
-        lg2::error("OPENBMC_MESSAGE_ID={DATA}", "DATA", t.to_json().dump());
-    }
-
-    if constexpr (LG2_COMMIT_DBUS)
-    {
-        auto b = sdbusplus::bus::new_default();
-        auto m =
-            b.new_method_call(Create::default_service, Create::instance_path,
-                              Create::interface, "Create");
-
-        m.append(t.name(), severity_from_syslog(t.severity()),
-                 data_from_json(t));
-
-        auto reply = b.call(m);
-
-        return reply.unpack<sdbusplus::message::object_path>();
-    }
-
-    return {};
-}
-
-auto commit(sdbusplus::async::context& ctx,
-            sdbusplus::exception::generated_event_base&& t)
-    -> sdbusplus::async::task<sdbusplus::message::object_path>
-{
-    if constexpr (LG2_COMMIT_JOURNAL)
-    {
-        lg2::error("OPENBMC_MESSAGE_ID={DATA}", "DATA", t.to_json().dump());
-    }
-
-    if constexpr (LG2_COMMIT_DBUS)
-    {
-        co_return co_await Create(ctx)
-            .service(Create::default_service)
-            .path(Create::instance_path)
-            .create(t.name(), severity_from_syslog(t.severity()),
-                    data_from_json(t));
-    }
-    co_return {};
-}
-
 auto extractEvent(sdbusplus::exception::generated_event_base&& t)
     -> std::tuple<std::string, Entry::Level, std::vector<std::string>>
 {
@@ -158,4 +114,56 @@
             std::move(additional_data)};
 }
 
-} // namespace lg2::details
+} // namespace details
+
+auto commit(sdbusplus::exception::generated_event_base&& t)
+    -> sdbusplus::message::object_path
+{
+    if constexpr (LG2_COMMIT_JOURNAL)
+    {
+        lg2::error("OPENBMC_MESSAGE_ID={DATA}", "DATA", t.to_json().dump());
+    }
+
+    if constexpr (LG2_COMMIT_DBUS)
+    {
+        using details::Create;
+
+        auto b = sdbusplus::bus::new_default();
+        auto m =
+            b.new_method_call(Create::default_service, Create::instance_path,
+                              Create::interface, "Create");
+
+        m.append(t.name(), details::severity_from_syslog(t.severity()),
+                 details::data_from_json(t));
+
+        auto reply = b.call(m);
+
+        return reply.unpack<sdbusplus::message::object_path>();
+    }
+
+    return {};
+}
+
+auto commit(sdbusplus::async::context& ctx,
+            sdbusplus::exception::generated_event_base&& t)
+    -> sdbusplus::async::task<sdbusplus::message::object_path>
+{
+    using details::Create;
+
+    if constexpr (LG2_COMMIT_JOURNAL)
+    {
+        lg2::error("OPENBMC_MESSAGE_ID={DATA}", "DATA", t.to_json().dump());
+    }
+
+    if constexpr (LG2_COMMIT_DBUS)
+    {
+        co_return co_await Create(ctx)
+            .service(Create::default_service)
+            .path(Create::instance_path)
+            .create(t.name(), details::severity_from_syslog(t.severity()),
+                    details::data_from_json(t));
+    }
+    co_return {};
+}
+
+} // namespace lg2
diff --git a/log_create_main.cpp b/log_create_main.cpp
index 4347152..9d6b569 100644
--- a/log_create_main.cpp
+++ b/log_create_main.cpp
@@ -35,7 +35,7 @@
     }
     catch (sdbusplus::exception::generated_event_base& e)
     {
-        auto path = lg2::details::commit(std::move(e));
+        auto path = lg2::commit(std::move(e));
         std::cout << path.str << std::endl;
         return 0;
     }
