Refactor filter to avoid superclass mismatch