add abstraction for pagination