Refactor links and id types in links