Refactored filter_products