refactored filter count feature