Further refactoring of the ncml module.