Moved out MathHelpers.