Refactor user input