Cleaned up filtering logic to minimize DBF reads and avoid duplicate
feature construction.