Simplifying filter expressions