Refactored map and filter methods