refactor reference iterator / merge