Template refactor.