refactor html stuff to new file