Refactoring implementation of -linkAtCharacterIndex: