RR: refactor templates to split different template types