Reduced code, Sped up login process

Reduced code should also cause a performance increase.