diff --git a/include/dbus_utility.hpp b/include/dbus_utility.hpp
new file mode 100644
index 0000000..e527e90
--- /dev/null
+++ b/include/dbus_utility.hpp
@@ -0,0 +1,87 @@
+/*
+ // Copyright (c) 2018 Intel Corporation
+ //
+ // Licensed under the Apache License, Version 2.0 (the "License");
+ // you may not use this file except in compliance with the License.
+ // You may obtain a copy of the License at
+ //
+ //      http://www.apache.org/licenses/LICENSE-2.0
+ //
+ // Unless required by applicable law or agreed to in writing, software
+ // distributed under the License is distributed on an "AS IS" BASIS,
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ // See the License for the specific language governing permissions and
+ // limitations under the License.
+ */
+#pragma once
+
+#include <regex>
+#include <sdbusplus/message.hpp>
+
+namespace dbus
+{
+
+namespace utility
+{
+
+using DbusVariantType = sdbusplus::message::variant<
+    std::vector<std::tuple<std::string, std::string, std::string>>,
+    std::vector<std::string>, std::string, int64_t, uint64_t, double, int32_t,
+    uint32_t, int16_t, uint16_t, uint8_t, bool>;
+
+using ManagedObjectType = std::vector<
+    std::pair<sdbusplus::message::object_path,
+              boost::container::flat_map<
+                  std::string,
+                  boost::container::flat_map<std::string, DbusVariantType>>>>;
+
+inline void escapePathForDbus(std::string& path)
+{
+    const std::regex reg("[^A-Za-z0-9_/]");
+    std::regex_replace(path.begin(), path.begin(), path.end(), reg, "_");
+}
+
+// gets the string N strings deep into a path
+// i.e.  /0th/1st/2nd/3rd
+inline bool getNthStringFromPath(const std::string& path, int index,
+                                 std::string& result)
+{
+    int count = 0;
+    auto first = path.begin();
+    auto last = path.end();
+    for (auto it = path.begin(); it < path.end(); it++)
+    {
+        // skip first character as it's either a leading slash or the first
+        // character in the word
+        if (it == path.begin())
+        {
+            continue;
+        }
+        if (*it == '/')
+        {
+            count++;
+            if (count == index)
+            {
+                first = it;
+            }
+            if (count == index + 1)
+            {
+                last = it;
+                break;
+            }
+        }
+    }
+    if (count < index)
+    {
+        return false;
+    }
+    if (first != path.begin())
+    {
+        first++;
+    }
+    result = path.substr(first - path.begin(), last - first);
+    return true;
+}
+
+} // namespace utility
+} // namespace dbus
