remove redundant code from MathText class

make MathText neater