`each_with_object` is more flexible here