Enhancing and adding tests for TemplateController