Minor refactoring for filters