refactor index to linkId