Avoid `each_with_object` which is not available on 1.8.7