refactoring and creating filters