Improved html parsing