Refactor filter tests