separated template stuff out into its own file