optimized the input processing