Improve login sequence