Refactoring: creating an object for the PasswordPrompt