MOD some refactoring