[core] refactor templates