improved html parser