Refactor with #tap.
Refactor with #each_with_object.