Refactoring the_input