Performance fixes around retrieving apps and domains