simplify logic in filter handling

Change-Id: I8ee0ac867529e0b6750d97dee1576958fe4f20b4