refactored MathUtility