Some groundwork for templates