tidied up templates and started setting up controllers