improved StreamFilterTrait implementation