Refactoring set passwords