filter refactoring