Move generatePassword() to User model