ui: Refactor templates.