Small refactoring of html and js.