code refactor. MathFunction module has been created.