Move template into its own file