refactored more html and js.