[WIP] Actually make templates work, thanks @nixme