this logic should be done by using ``$app->extend()`` to keep the service definition lazy