reworked html parsing