Move templates into src/templates.
Refactor controller.