Refactored filtering code
Check rate does not go to zero