refactor html_output