Re-organise module-level pagination function