New templates and refactored logic