Refactoring on filter issues