Modified to work with Thymeleaf DOM