Factor out filter.