DeviceService.authenticate method is extracted