Refactor html, js