refactoring filter