diff --git a/actions.hpp b/actions.hpp
index 2fea212..403dca1 100644
--- a/actions.hpp
+++ b/actions.hpp
@@ -2,6 +2,7 @@
 
 #include <utility>
 #include <memory>
+#include <functional>
 #include "utils.hpp"
 #include "types.hpp"
 
@@ -15,10 +16,7 @@
 class Manager;
 namespace details
 {
-using ActionBase = holder::CallableBase<void, sdbusplus::bus::bus&, Manager&>;
-using ActionBasePtr = std::shared_ptr<ActionBase>;
-template <typename T>
-using Action = holder::CallableHolder<T, void, sdbusplus::bus::bus&, Manager&>;
+using Action = std::function<void (sdbusplus::bus::bus&, Manager&)>;
 
 /** @brief make_action
  *
@@ -32,8 +30,7 @@
 template <typename T>
 auto make_action(T&& action)
 {
-    return Action<T>::template make_shared<Action<T>>(
-        std::forward<T>(action));
+    return Action(std::forward<T>(action));
 }
 } // namespace details
 
@@ -43,7 +40,7 @@
 /** @brief Destroy objects action.  */
 inline auto destroyObjects(std::vector<const char*>&& paths)
 {
-    return [=](auto&, auto & m)
+    return [ = ](auto&, auto & m)
     {
         m.destroyObjects(paths);
     };
@@ -53,7 +50,7 @@
 inline auto createObjects(
     std::map<sdbusplus::message::object_path, Object>&& objs)
 {
-    return [=](auto&, auto & m)
+    return [ = ](auto&, auto & m)
     {
         m.createObjects(objs);
     };
diff --git a/events.hpp b/events.hpp
index 6737861..9ecb93a 100644
--- a/events.hpp
+++ b/events.hpp
@@ -2,6 +2,7 @@
 
 #include <utility>
 #include <memory>
+#include <functional>
 #include <sdbusplus/message.hpp>
 #include "utils.hpp"
 
@@ -15,12 +16,8 @@
 class Manager;
 namespace details
 {
-using FilterBase = holder::CallableBase <
-                   bool, sdbusplus::bus::bus&, sdbusplus::message::message&, Manager& >;
-using FilterBasePtr = std::shared_ptr<FilterBase>;
-template <typename T>
-using Filter = holder::CallableHolder <
-               T, bool, sdbusplus::bus::bus&, sdbusplus::message::message&, Manager& >;
+using Filter = std::function <
+               bool (sdbusplus::bus::bus&, sdbusplus::message::message&, Manager&) >;
 
 /** @struct Event
  *  @brief Event object interface.
@@ -28,7 +25,7 @@
  *  The event base is an assocation of an event type
  *  and an array of filter callbacks.
  */
-struct Event : public std::vector<FilterBasePtr>
+struct Event : public std::vector<Filter>
 {
     enum class Type
     {
@@ -48,8 +45,8 @@
      *  @param[in] t - The event type.
      */
     explicit Event(
-        const std::vector<FilterBasePtr>& filters, Type t = Type::STARTUP) :
-        std::vector<FilterBasePtr>(filters),
+        const std::vector<Filter>& filters, Type t = Type::STARTUP) :
+        std::vector<Filter>(filters),
         type(t) {}
 
     /** @brief event class enumeration. */
@@ -80,7 +77,7 @@
      *  @param[in] filter - An array of DBus signal
      *     match callback filtering functions.
      */
-    DbusSignal(const char* sig, const std::vector<FilterBasePtr>& filters) :
+    DbusSignal(const char* sig, const std::vector<Filter>& filters) :
         Event(filters, Type::DBUS_SIGNAL),
         signature(sig) {}
 
@@ -99,8 +96,7 @@
 template <typename T>
 auto make_filter(T&& filter)
 {
-    return Filter<T>::template make_shared<Filter<T>>(
-        std::forward<T>(filter));
+    return Filter(std::forward<T>(filter));
 }
 } // namespace details
 
@@ -123,7 +119,7 @@
         PropertyChangedCondition() = delete;
         ~PropertyChangedCondition() = default;
         PropertyChangedCondition(const PropertyChangedCondition&) = default;
-        PropertyChangedCondition& operator=(const PropertyChangedCondition&) = delete;
+        PropertyChangedCondition& operator=(const PropertyChangedCondition&) = default;
         PropertyChangedCondition(PropertyChangedCondition&&) = default;
         PropertyChangedCondition& operator=(PropertyChangedCondition&&) = default;
         PropertyChangedCondition(const char* iface, const char* property,
@@ -180,8 +176,8 @@
 {
         PropertyConditionBase() = delete;
         virtual ~PropertyConditionBase() = default;
-        PropertyConditionBase(const PropertyConditionBase&) = delete;
-        PropertyConditionBase& operator=(const PropertyConditionBase&) = delete;
+        PropertyConditionBase(const PropertyConditionBase&) = default;
+        PropertyConditionBase& operator=(const PropertyConditionBase&) = default;
         PropertyConditionBase(PropertyConditionBase&&) = default;
         PropertyConditionBase& operator=(PropertyConditionBase&&) = default;
 
@@ -239,8 +235,8 @@
 {
         PropertyCondition() = delete;
         ~PropertyCondition() = default;
-        PropertyCondition(const PropertyCondition&) = delete;
-        PropertyCondition& operator=(const PropertyCondition&) = delete;
+        PropertyCondition(const PropertyCondition&) = default;
+        PropertyCondition& operator=(const PropertyCondition&) = default;
         PropertyCondition(PropertyCondition&&) = default;
         PropertyCondition& operator=(PropertyCondition&&) = default;
 
diff --git a/manager.cpp b/manager.cpp
index 7d0e7d3..94748ad 100644
--- a/manager.cpp
+++ b/manager.cpp
@@ -165,14 +165,14 @@
 
     for (auto& f : event)
     {
-        if (!(*f)(_bus, msg, *this))
+        if (!f(_bus, msg, *this))
         {
             return;
         }
     }
     for (auto& action : actions)
     {
-        (*action)(_bus, *this);
+        action(_bus, *this);
     }
 }
 
diff --git a/manager.hpp b/manager.hpp
index c1137a4..9d83ee8 100644
--- a/manager.hpp
+++ b/manager.hpp
@@ -81,7 +81,7 @@
 
         using EventInfo = std::tuple <
                           std::vector<details::EventBasePtr>,
-                          std::vector<details::ActionBasePtr >>;
+                          std::vector<details::Action >>;
 
         /** @brief Start processing DBus messages. */
         void run() noexcept;
diff --git a/pimgen.py b/pimgen.py
index 4fd6fcc..4cbaafd 100755
--- a/pimgen.py
+++ b/pimgen.py
@@ -371,7 +371,7 @@
         filters = [
             self.filter_map[x['name']](**x) for x in kw.pop('filters', [])]
         filters = Vector(
-            templates=[Template(name='FilterBasePtr', namespace=['details'])],
+            templates=[Template(name='Filter', namespace=['details'])],
             args=filters)
 
         event = MethodCall(
@@ -386,7 +386,7 @@
             templates=[Template(name='EventBasePtr', namespace=['details'])],
             args=[event])
 
-        action_type = Template(name='ActionBasePtr', namespace=['details'])
+        action_type = Template(name='Action', namespace=['details'])
         action_args = [
             self.action_map[x['name']](**x) for x in kw.pop('actions', [])]
         actions = Vector(
diff --git a/utils.hpp b/utils.hpp
index 1ea7fc1..837c82f 100644
--- a/utils.hpp
+++ b/utils.hpp
@@ -92,67 +92,6 @@
     protected:
         T _held;
 };
-
-/** @struct CallableBase
- *  @brief Adapt any callable function object base class.
- *
- *  Provides an un-templated base class for use with an adapt to any
- *  callable function object type.
- *
- *  @tparam Ret - The return type of the callable.
- *  @tparam Args - The argument types of the callable.
- */
-template <typename Ret, typename ...Args>
-struct CallableBase
-{
-    CallableBase() = default;
-    virtual ~CallableBase() = default;
-    CallableBase(const CallableBase&) = delete;
-    CallableBase& operator=(const CallableBase&) = delete;
-    CallableBase(CallableBase&&) = default;
-    CallableBase& operator=(CallableBase&&) = default;
-
-    virtual Ret operator()(Args&& ...args) const = 0;
-    virtual Ret operator()(Args&& ...args)
-    {
-        return const_cast<const CallableBase&>(*this)(
-                   std::forward<Args>(args)...);
-    }
-};
-
-/** @struct CallableHolder
- *  @brief Adapt from any callable type.
- *
- *  Adapts any callable type.
- *
- *  @tparam T - The type of the callable.
- *  @tparam Ret - The return type of the callable.
- *  @tparam Args - The argument types of the callable.
- */
-template <typename T, typename Ret, typename ...Args>
-struct CallableHolder final :
-    public CallableBase<Ret, Args...>,
-    public Holder<T>
-{
-    CallableHolder() = delete;
-    ~CallableHolder() = default;
-    CallableHolder(const CallableHolder&) = delete;
-    CallableHolder& operator=(const CallableHolder&) = delete;
-    CallableHolder(CallableHolder&&) = default;
-    CallableHolder& operator=(CallableHolder&&) = default;
-    explicit CallableHolder(T&& func) : Holder<T>(std::forward<T>(func)) {}
-
-    virtual Ret operator()(Args&& ...args) const override
-    {
-        return this->_held(std::forward<Args>(args)...);
-    }
-
-    virtual Ret operator()(Args&& ...args) override
-    {
-        return this->_held(std::forward<Args>(args)...);
-    }
-};
-
 } // namespace holder
 } // namespace details
 } // namespace manager
