refactoring filter policy