move paginnation subset to its own function