Restructured the way login for is called