refactoring filter spec