optimized text scanner