Refactored structure of templates