refactoring and Filter model