Move template to be co-located with controller
Broken out controller config into separate function