Refactoring of input processing.