Refactored StringFilter.