move pagination generation
clean