Update and clean addLink and deleteLink