improved merge graph iterators implementation