Improved filter removal logic