trim then filter