template: minor refactor