TDD: refactoring filtering