pagination and models restructure