refactoring filter email