Making pagination logic configurable