Refactored the templates. Made it more cleaner