Thymeleaf templates and refactoring