Some refactoring of gui.html.