centralize doLogin call only once