improve the filter performance

Change-Id: Ib9e05b3240da7a0aaf474985a47215a20f09f699