Replace to/from link tables with single links table