smarter clearing of filter