refactoring HTMLParser