refactoring isInclude method that filters stats