refactor html js