cleaned up login/logout flow