Refactor training template