refactoring + get-input example.