This helper method is not doing enough work to justify being a separate method.  You should move this code into the public `login()` method.