refactored the StateFilter type