pdf gen; reorganise model a bit