remove debug info and etc.
copy StartOfReferences new result to EndOfReferences