getpass refactoring