Small update I needed (perf + queryset filtering)

I needed this feature and my complex data structure made me also need the small performance fix.