all HTML and JS refactored