cleanup of ordering and duplicate entries for source.