Refactored HTMLParser