refactoring
refactor with proper filters