cleaning up filtering logic