refine filtering logic
refine filtering logic