Analysis, refactoring and optimization of the Multiscale Online Nonhydrostatic AtmospheRe CHemistry mode