I modified this in such a way that we can try adding prefetch_related as an optimization if we need to.