refactored user input