compacter blocks using each_with_object