refactor executable by extracting user input into its own method