Refactor html