Refactor the anonymous function body of this map into a function for readability.