DRY in pagination