Refactored pagination to act as a plugin injected on configuration