diff --git a/classes/obmc-phosphor-systemd.bbclass b/classes/obmc-phosphor-systemd.bbclass
index c1eb3c9..85089f8 100644
--- a/classes/obmc-phosphor-systemd.bbclass
+++ b/classes/obmc-phosphor-systemd.bbclass
@@ -104,25 +104,28 @@
                 'have a restart policy defined.' % unit.name)
 
 
-    def add_sd_unit(d, unit, pkg):
-        name = unit.name
-        unit_dir = d.getVar('systemd_system_unitdir', True)
-        set_append(d, 'SRC_URI', 'file://%s' % name)
-        set_append(d, 'FILES_%s' % pkg, '%s/%s' % (unit_dir, name))
-        set_append(d, '_INSTALL_SD_UNITS', name)
-        set_append(d, '_MAKE_SUBS', '%s' % name)
+    def add_default_subs(d, file):
+        set_append(d, '_MAKE_SUBS', '%s' % file)
 
         for x in [
                 'base_bindir',
                 'bindir',
                 'sbindir',
                 'SYSTEMD_DEFAULT_TARGET' ]:
-            set_append(d, 'SYSTEMD_SUBSTITUTIONS_%s' % name,
+            set_append(d, 'SYSTEMD_SUBSTITUTIONS_%s' % file,
                 '%s:%s' % (x, d.getVar(x, True)))
 
 
-    def add_sd_user(d, unit, pkg):
+    def add_sd_unit(d, unit, pkg):
         name = unit.name
+        unit_dir = d.getVar('systemd_system_unitdir', True)
+        set_append(d, 'SRC_URI', 'file://%s' % name)
+        set_append(d, 'FILES_%s' % pkg, '%s/%s' % (unit_dir, name))
+        set_append(d, '_INSTALL_SD_UNITS', name)
+        add_default_subs(d, name)
+
+
+    def add_sd_user(d, file, pkg):
         opts = [
             '--system',
             '--home',
@@ -131,7 +134,7 @@
             '--shell /sbin/nologin',
             '--user-group']
 
-        var = 'SYSTEMD_USER_%s' % name
+        var = 'SYSTEMD_USER_%s' % file
         user = listvar_to_list(d, var)
         if len(user) is 0:
             var = 'SYSTEMD_USER_%s' % pkg
@@ -141,7 +144,7 @@
                 bb.fatal('Too many users assigned to %s: \'%s\'' % (var, ' '.join(user)))
 
             user = user[0]
-            set_append(d, 'SYSTEMD_SUBSTITUTIONS_%s' % name,
+            set_append(d, 'SYSTEMD_SUBSTITUTIONS_%s' % file,
                 'USER:%s' % user)
             if user not in d.getVar('USERADD_PARAM_%s' % pkg, True):
                 set_append(
@@ -168,28 +171,32 @@
         for unit in tmpl + svc:
             check_sd_unit(d, unit)
             add_sd_unit(d, unit, pkg)
-            add_sd_user(d, unit, pkg)
+            add_sd_user(d, unit.name, pkg)
 }
 
 
 python systemd_do_postinst() {
-    for f in listvar_to_list(d, '_MAKE_SUBS'):
-        subs = dict([ x.split(':') for x in
-            listvar_to_list(d, 'SYSTEMD_SUBSTITUTIONS_%s' % f)])
-        if not subs:
-            continue
+    def make_subs(d):
+        for f in listvar_to_list(d, '_MAKE_SUBS'):
+            subs = dict([ x.split(':') for x in
+                listvar_to_list(d, 'SYSTEMD_SUBSTITUTIONS_%s' % f)])
+            if not subs:
+                continue
 
-        path = d.getVar('D', True)
-        path += d.getVar('systemd_system_unitdir', True)
-        path += '/%s' % f
-        with open(path, 'r') as fd:
-            content = fd.read()
-        with open(path, 'w+') as fd:
-            try:
-                fd.write(content.format(**subs))
-            except KeyError as e:
-                bb.fatal('No substitution found for %s in '
-                    'file \'%s\'' % (e, f))
+            path = d.getVar('D', True)
+            path += d.getVar('systemd_system_unitdir', True)
+            path += '/%s' % f
+            with open(path, 'r') as fd:
+                content = fd.read()
+            with open(path, 'w+') as fd:
+                try:
+                    fd.write(content.format(**subs))
+                except KeyError as e:
+                    bb.fatal('No substitution found for %s in '
+                        'file \'%s\'' % (e, f))
+
+
+    make_subs(d)
 }
 
 
