Split changeset_ty using iterators instead of loops.