refactoring filter field type validation