refactor MX/Modules into core