More refactoring of the CM client