refactor html parser