working out how to do templating