Extracted GetUserInput method.