Login flow refactored