Refactor Templates