Removed extra threads by making login more event driven.