Refactor Template