templates are set using function rather than directly setting variable