optimizations in StructuredParser implementation