Some refactoring of filters.