I've seen these couple of lines changing the projId.Type if there's an associated PT project before. Seems worth a method...if only in case we ever need to do additional or different things when there is an associated PT project, or a different way of testing for it, or there are other reasons to want a shared XML backend...or at least encapsulate the condition in something like SharedBackendNeeded().