More flexible filter

Change-Id: I071c795d3ceebd21dfa2f197b43b52f621608029