re-factoring if-else in getAppBases()