Refactor templates and add style