Refactoring Password Generation