reduce query count for when retrieving App models, fix join methods