Refactoring and adding paging tests

Change-Id: Icdab73dee3e17b755a2d03f556c2fe1a1e16a70b
Merge "Refactoring and adding paging tests"