Add page generator + refactor pagepart generator