Helper to abstract pagination of resources