Refactored response filtering