Refactor into DoUpdate and DoInstall