new input mode, little refactoring