simple text parsing optimizations