transferred old queryset code