rework login flow