make docmainscontroller more model independent