diff --git a/meta-phosphor/classes/obmc-phosphor-systemd.bbclass b/meta-phosphor/classes/obmc-phosphor-systemd.bbclass
index f882bfc..3df5ee4 100644
--- a/meta-phosphor/classes/obmc-phosphor-systemd.bbclass
+++ b/meta-phosphor/classes/obmc-phosphor-systemd.bbclass
@@ -8,41 +8,41 @@
 #
 # Alternatively this class can just be inherited and
 # ${PN}.service will be added to the main package.
+
+inherit obmc-phosphor-utils
 inherit systemd
 
+_INSTALL_SD_UNITS=""
+
 
 python() {
+    def add_sd_unit(d, unit, pkg):
+        searchpaths = d.getVar('FILESPATH', True)
+        path = bb.utils.which(searchpaths, '%s' % unit)
+        if not os.path.isfile(path):
+            bb.fatal('Did not find unit file "%s"' % unit)
+        set_append(d, 'SRC_URI', 'file://%s' % unit)
+        set_append(d, 'FILES_%s' % pkg, '%s/%s' \
+            % (d.getVar('systemd_system_unitdir', True), unit))
+        set_append(d, '_INSTALL_SD_UNITS', '%s' % unit)
+
     pn = d.getVar('PN', True)
-    searchpaths = d.getVar('FILESPATH', True)
+    if d.getVar('SYSTEMD_SERVICE_%s' % pn, True) is None:
+        d.setVar('SYSTEMD_SERVICE_%s' % pn, '%s.service' % pn)
 
-    services = d.getVar('SYSTEMD_SERVICE_' + pn, True)
-
-    if services:
-        services = services.split()
-    else:
-        services = [pn + '.service']
-
-    for s in services:
-        file = s
-        path = bb.utils.which(searchpaths, file)
-        if os.path.isfile(path):
-            d.appendVar('SRC_URI', ' file://' + file)
-            d.appendVar("FILES_%s" %(pn), " %s/%s" \
-                % (d.getVar('systemd_system_unitdir', True), file))
-            d.appendVar('OBMC_SYSTEMD_SERVICES', ' ' + file)
-            if file not in (d.getVar('SYSTEMD_SERVICE_' + pn, True) or "").split():
-                d.appendVar('SYSTEMD_SERVICE_' + pn, ' ' + file)
-        else:
-            bb.error("Could not find service file: %s" % file)
+    for pkg in listvar_to_list(d, 'SYSTEMD_PACKAGES'):
+        for unit in listvar_to_list(d, 'SYSTEMD_SERVICE_%s' % pkg):
+            add_sd_unit(d, unit, pkg)
 }
 
+
 do_install_append() {
         # install systemd service/socket/template files
-        if [ "${OBMC_SYSTEMD_SERVICES}" ]; then
+        [ -z "${_INSTALL_SD_UNITS}" ] || \
                 install -d ${D}${systemd_system_unitdir}
-        fi
-        for s in ${OBMC_SYSTEMD_SERVICES}; do
-                install -m 0644 ${WORKDIR}/$s ${D}${systemd_system_unitdir}
+        for s in ${_INSTALL_SD_UNITS}; do
+                install -m 0644 ${WORKDIR}/$s \
+                        ${D}${systemd_system_unitdir}/$s
                 sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
                         -e 's,@BINDIR@,${bindir},g' \
                         -e 's,@SBINDIR@,${sbindir},g' \
diff --git a/meta-phosphor/classes/obmc-phosphor-utils.bbclass b/meta-phosphor/classes/obmc-phosphor-utils.bbclass
index 44ca7ad..036af9b 100644
--- a/meta-phosphor/classes/obmc-phosphor-utils.bbclass
+++ b/meta-phosphor/classes/obmc-phosphor-utils.bbclass
@@ -15,3 +15,15 @@
     return value if df_enabled(feature, value, d) \
         and mf_enabled(feature, value, d) \
             else ""
+
+
+def set_append(d, var, val, sep=' '):
+    values = (d.getVar(var, True) or '').split(sep)
+    if filter(bool, values):
+        d.appendVar(var, '%s%s' %(sep, val))
+    else:
+        d.setVar(var, val)
+
+
+def listvar_to_list(d, list_var, sep=' '):
+    return filter(bool, (d.getVar(list_var, True) or '').split(sep))
