could combine the _.map and _.reduce here