Refactor on html_formatter.py