diff --git a/src/sdeventplus/internal/sdevent.cpp b/src/sdeventplus/internal/sdevent.cpp
index af729b2..e7cd633 100644
--- a/src/sdeventplus/internal/sdevent.cpp
+++ b/src/sdeventplus/internal/sdevent.cpp
@@ -1,10 +1,201 @@
 #include <sdeventplus/internal/sdevent.hpp>
+#include <systemd/sd-event.h>
 
 namespace sdeventplus
 {
 namespace internal
 {
 
+int SdEventImpl::sd_event_default(sd_event** event) const
+{
+    return ::sd_event_default(event);
+}
+
+int SdEventImpl::sd_event_new(sd_event** event) const
+{
+    return ::sd_event_default(event);
+}
+
+sd_event* SdEventImpl::sd_event_ref(sd_event* event) const
+{
+    return ::sd_event_ref(event);
+}
+
+sd_event* SdEventImpl::sd_event_unref(sd_event* event) const
+{
+    return ::sd_event_unref(event);
+}
+
+int SdEventImpl::sd_event_add_time(sd_event* event, sd_event_source** source,
+                                   clockid_t clock, uint64_t usec,
+                                   uint64_t accuracy,
+                                   sd_event_time_handler_t callback,
+                                   void* userdata) const
+{
+    return ::sd_event_add_time(event, source, clock, usec, accuracy, callback,
+                               userdata);
+}
+
+int SdEventImpl::sd_event_add_defer(sd_event* event, sd_event_source** source,
+                                    sd_event_handler_t callback,
+                                    void* userdata) const
+{
+    return ::sd_event_add_defer(event, source, callback, userdata);
+}
+
+int SdEventImpl::sd_event_add_post(sd_event* event, sd_event_source** source,
+                                   sd_event_handler_t callback,
+                                   void* userdata) const
+{
+    return ::sd_event_add_post(event, source, callback, userdata);
+}
+
+int SdEventImpl::sd_event_add_exit(sd_event* event, sd_event_source** source,
+                                   sd_event_handler_t callback,
+                                   void* userdata) const
+{
+    return ::sd_event_add_exit(event, source, callback, userdata);
+}
+
+int SdEventImpl::sd_event_prepare(sd_event* event) const
+{
+    return ::sd_event_prepare(event);
+}
+
+int SdEventImpl::sd_event_wait(sd_event* event, uint64_t usec) const
+{
+    return ::sd_event_wait(event, usec);
+}
+
+int SdEventImpl::sd_event_dispatch(sd_event* event) const
+{
+    return ::sd_event_dispatch(event);
+}
+
+int SdEventImpl::sd_event_run(sd_event* event, uint64_t usec) const
+{
+    return ::sd_event_run(event, usec);
+}
+
+int SdEventImpl::sd_event_loop(sd_event* event) const
+{
+    return ::sd_event_loop(event);
+}
+
+int SdEventImpl::sd_event_exit(sd_event* event, int code) const
+{
+    return ::sd_event_exit(event, code);
+}
+
+int SdEventImpl::sd_event_now(sd_event* event, clockid_t clock,
+                              uint64_t* usec) const
+{
+    return ::sd_event_now(event, clock, usec);
+}
+
+int SdEventImpl::sd_event_get_exit_code(sd_event* event, int* code) const
+{
+    return ::sd_event_get_exit_code(event, code);
+}
+
+int SdEventImpl::sd_event_get_watchdog(sd_event* event) const
+{
+    return ::sd_event_get_watchdog(event);
+}
+
+int SdEventImpl::sd_event_set_watchdog(sd_event* event, int b) const
+{
+    return ::sd_event_set_watchdog(event, b);
+}
+
+sd_event_source* SdEventImpl::sd_event_source_ref(sd_event_source* source) const
+{
+    return ::sd_event_source_ref(source);
+}
+
+sd_event_source*
+    SdEventImpl::sd_event_source_unref(sd_event_source* source) const
+{
+    return ::sd_event_source_unref(source);
+}
+
+void* SdEventImpl::sd_event_source_set_userdata(sd_event_source* source,
+                                                void* userdata) const
+{
+    return ::sd_event_source_set_userdata(source, userdata);
+}
+
+int SdEventImpl::sd_event_source_get_description(sd_event_source* source,
+                                                 const char** description) const
+{
+    return ::sd_event_source_get_description(source, description);
+}
+
+int SdEventImpl::sd_event_source_set_description(sd_event_source* source,
+                                                 const char* description) const
+{
+    return ::sd_event_source_set_description(source, description);
+}
+
+int SdEventImpl::sd_event_source_set_prepare(sd_event_source* source,
+                                             sd_event_handler_t callback) const
+{
+    return ::sd_event_source_set_prepare(source, callback);
+}
+
+int SdEventImpl::sd_event_source_get_pending(sd_event_source* source) const
+{
+    return ::sd_event_source_get_pending(source);
+}
+
+int SdEventImpl::sd_event_source_get_priority(sd_event_source* source,
+                                              int64_t* priority) const
+{
+    return ::sd_event_source_get_priority(source, priority);
+}
+
+int SdEventImpl::sd_event_source_set_priority(sd_event_source* source,
+                                              int64_t priority) const
+{
+    return ::sd_event_source_set_priority(source, priority);
+}
+
+int SdEventImpl::sd_event_source_get_enabled(sd_event_source* source,
+                                             int* enabled) const
+{
+    return ::sd_event_source_get_enabled(source, enabled);
+}
+
+int SdEventImpl::sd_event_source_set_enabled(sd_event_source* source,
+                                             int enabled) const
+{
+    return ::sd_event_source_set_enabled(source, enabled);
+}
+
+int SdEventImpl::sd_event_source_get_time(sd_event_source* source,
+                                          uint64_t* usec) const
+{
+    return ::sd_event_source_get_time(source, usec);
+}
+
+int SdEventImpl::sd_event_source_set_time(sd_event_source* source,
+                                          uint64_t usec) const
+{
+    return ::sd_event_source_set_time(source, usec);
+}
+
+int SdEventImpl::sd_event_source_get_time_accuracy(sd_event_source* source,
+                                                   uint64_t* usec) const
+{
+    return ::sd_event_source_get_time_accuracy(source, usec);
+}
+
+int SdEventImpl::sd_event_source_set_time_accuracy(sd_event_source* source,
+                                                   uint64_t usec) const
+{
+    return ::sd_event_source_set_time_accuracy(source, usec);
+}
+
 SdEventImpl sdevent_impl;
 
 } // namespace internal
diff --git a/src/sdeventplus/internal/sdevent.hpp b/src/sdeventplus/internal/sdevent.hpp
index a24c73c..fb26fd2 100644
--- a/src/sdeventplus/internal/sdevent.hpp
+++ b/src/sdeventplus/internal/sdevent.hpp
@@ -85,194 +85,70 @@
 class SdEventImpl : public SdEvent
 {
   public:
-    int sd_event_default(sd_event** event) const override
-    {
-        return ::sd_event_default(event);
-    }
-
-    int sd_event_new(sd_event** event) const override
-    {
-        return ::sd_event_default(event);
-    }
-
-    sd_event* sd_event_ref(sd_event* event) const override
-    {
-        return ::sd_event_ref(event);
-    }
-
-    sd_event* sd_event_unref(sd_event* event) const override
-    {
-        return ::sd_event_unref(event);
-    }
+    int sd_event_default(sd_event** event) const override;
+    int sd_event_new(sd_event** event) const override;
+    sd_event* sd_event_ref(sd_event* event) const override;
+    sd_event* sd_event_unref(sd_event* event) const override;
 
     int sd_event_add_time(sd_event* event, sd_event_source** source,
                           clockid_t clock, uint64_t usec, uint64_t accuracy,
                           sd_event_time_handler_t callback,
-                          void* userdata) const override
-    {
-        return ::sd_event_add_time(event, source, clock, usec, accuracy,
-                                   callback, userdata);
-    }
-
+                          void* userdata) const override;
     int sd_event_add_defer(sd_event* event, sd_event_source** source,
                            sd_event_handler_t callback,
-                           void* userdata) const override
-    {
-        return ::sd_event_add_defer(event, source, callback, userdata);
-    }
-
+                           void* userdata) const override;
     int sd_event_add_post(sd_event* event, sd_event_source** source,
                           sd_event_handler_t callback,
-                          void* userdata) const override
-    {
-        return ::sd_event_add_post(event, source, callback, userdata);
-    }
-
+                          void* userdata) const override;
     int sd_event_add_exit(sd_event* event, sd_event_source** source,
                           sd_event_handler_t callback,
-                          void* userdata) const override
-    {
-        return ::sd_event_add_exit(event, source, callback, userdata);
-    }
+                          void* userdata) const override;
 
-    int sd_event_prepare(sd_event* event) const override
-    {
-        return ::sd_event_prepare(event);
-    }
-
-    int sd_event_wait(sd_event* event, uint64_t usec) const override
-    {
-        return ::sd_event_wait(event, usec);
-    }
-
-    int sd_event_dispatch(sd_event* event) const override
-    {
-        return ::sd_event_dispatch(event);
-    }
-
-    int sd_event_run(sd_event* event, uint64_t usec) const override
-    {
-        return ::sd_event_run(event, usec);
-    }
-
-    int sd_event_loop(sd_event* event) const override
-    {
-        return ::sd_event_loop(event);
-    }
-
-    int sd_event_exit(sd_event* event, int code) const override
-    {
-        return ::sd_event_exit(event, code);
-    }
+    int sd_event_prepare(sd_event* event) const override;
+    int sd_event_wait(sd_event* event, uint64_t usec) const override;
+    int sd_event_dispatch(sd_event* event) const override;
+    int sd_event_run(sd_event* event, uint64_t usec) const override;
+    int sd_event_loop(sd_event* event) const override;
+    int sd_event_exit(sd_event* event, int code) const override;
 
     int sd_event_now(sd_event* event, clockid_t clock,
-                     uint64_t* usec) const override
-    {
-        return ::sd_event_now(event, clock, usec);
-    }
+                     uint64_t* usec) const override;
 
-    int sd_event_get_exit_code(sd_event* event, int* code) const override
-    {
-        return ::sd_event_get_exit_code(event, code);
-    }
-
-    int sd_event_get_watchdog(sd_event* event) const override
-    {
-        return ::sd_event_get_watchdog(event);
-    }
-
-    int sd_event_set_watchdog(sd_event* event, int b) const override
-    {
-        return ::sd_event_set_watchdog(event, b);
-    }
-
-    sd_event_source* sd_event_source_ref(sd_event_source* source) const override
-    {
-        return ::sd_event_source_ref(source);
-    }
+    int sd_event_get_exit_code(sd_event* event, int* code) const override;
+    int sd_event_get_watchdog(sd_event* event) const override;
+    int sd_event_set_watchdog(sd_event* event, int b) const override;
 
     sd_event_source*
-        sd_event_source_unref(sd_event_source* source) const override
-    {
-        return ::sd_event_source_unref(source);
-    }
+        sd_event_source_ref(sd_event_source* source) const override;
+    sd_event_source*
+        sd_event_source_unref(sd_event_source* source) const override;
 
     void* sd_event_source_set_userdata(sd_event_source* source,
-                                       void* userdata) const override
-    {
-        return ::sd_event_source_set_userdata(source, userdata);
-    }
+                                       void* userdata) const override;
 
-    int sd_event_source_get_description(sd_event_source* source,
-                                        const char** description) const override
-    {
-        return ::sd_event_source_get_description(source, description);
-    }
-
+    int sd_event_source_get_description(
+        sd_event_source* source, const char** description) const override;
     int sd_event_source_set_description(sd_event_source* source,
-                                        const char* description) const override
-    {
-        return ::sd_event_source_set_description(source, description);
-    }
-
+                                        const char* description) const override;
     int sd_event_source_set_prepare(sd_event_source* source,
-                                    sd_event_handler_t callback) const override
-    {
-        return ::sd_event_source_set_prepare(source, callback);
-    }
-
-    int sd_event_source_get_pending(sd_event_source* source) const override
-    {
-        return ::sd_event_source_get_pending(source);
-    }
-
+                                    sd_event_handler_t callback) const override;
+    int sd_event_source_get_pending(sd_event_source* source) const override;
     int sd_event_source_get_priority(sd_event_source* source,
-                                     int64_t* priority) const override
-    {
-        return ::sd_event_source_get_priority(source, priority);
-    }
-
+                                     int64_t* priority) const override;
     int sd_event_source_set_priority(sd_event_source* source,
-                                     int64_t priority) const override
-    {
-        return ::sd_event_source_set_priority(source, priority);
-    }
-
+                                     int64_t priority) const override;
     int sd_event_source_get_enabled(sd_event_source* source,
-                                    int* enabled) const override
-    {
-        return ::sd_event_source_get_enabled(source, enabled);
-    }
-
+                                    int* enabled) const override;
     int sd_event_source_set_enabled(sd_event_source* source,
-                                    int enabled) const override
-    {
-        return ::sd_event_source_set_enabled(source, enabled);
-    }
-
+                                    int enabled) const override;
     int sd_event_source_get_time(sd_event_source* source,
-                                 uint64_t* usec) const override
-    {
-        return ::sd_event_source_get_time(source, usec);
-    }
-
+                                 uint64_t* usec) const override;
     int sd_event_source_set_time(sd_event_source* source,
-                                 uint64_t usec) const override
-    {
-        return ::sd_event_source_set_time(source, usec);
-    }
-
+                                 uint64_t usec) const override;
     int sd_event_source_get_time_accuracy(sd_event_source* source,
-                                          uint64_t* usec) const override
-    {
-        return ::sd_event_source_get_time_accuracy(source, usec);
-    }
-
+                                          uint64_t* usec) const override;
     int sd_event_source_set_time_accuracy(sd_event_source* source,
-                                          uint64_t usec) const override
-    {
-        return ::sd_event_source_set_time_accuracy(source, usec);
-    }
+                                          uint64_t usec) const override;
 };
 
 extern SdEventImpl sdevent_impl;
