Can this be merge with the get template above? I.e. line 10 would be `template = parent.name;`