refactoring Input