WIP for generic template creation code