Rewrite the data structure where paths of Link are stored