refactored and added .filter