Improved login flow