added ability to create Page models, refactored some code