Grand refactor main.html