Modified to work with the Thymeleaf DOM