Refactor AuthService