Refactored the templates