Extracted password-related code into User model methods