def client_factory(client_cls, dispatcher, settings):
    """Shared logic to instantiate a configured torque client utility."""

    torque_url = settings.get('torque.url')
    torque_api_key = settings.get('torque.api_key')
    return client_cls(dispatcher, torque_url, torque_api_key)