refactor the method which delegates all links with data-pjax-link