Refactor the URL generation in multi-page lists