Fix javascript syntax errors
HTML refactor