Reworked some code to make it more readable
Updated test files for Pagination