fixes for performance and skipping last style tag