Optimize filter.