Optimize login process