Refactoring of *_input stuff