smarter input processing