ext auth refactor