Extract method _generateRandomPassword.