pagination form refactoring