refactoring password set