moved html processing logic to htmlparser file