filter for style elements, optimizations for tag ref removal, documenation