Improved spectroscopic representations of molecules for astronomical studies: Methane and Magnesium Oxide