Bug fix (CDCM multi model).
Import a range of code refactoring and minor amendments.