implemented new optimized login process