refactor html
extract javascript