refactor linking