The meaning of the verb `openDocAsSaveAll` is unclear. It also looks like a chunk of code is likely be shared with existing one.