Refactor _.map to simplify variable assignments