refactor authenticator