Filter refactoring