while(currentApp) {
          factories = currentApp.get(diFactoriesKey);
          if (factories) {
            if (factories[dependency]) {
              factory = factories[dependency];