Refactor prev/next link