refactors pagination with partial