Large refactoring of Mustard kernels