improved auth flow