Revert "Revert "Make the html template cleaner""

This reverts commit 3a0ba25bfe3ef33dd352cc62215c2dace3621114.