refactor res.links()