def METHOD_NAME(expr):
    if expr.has_form("Plus", None):
        return Expression(SymbolPlus, *[METHOD_NAME(element) for element in expr.elements])
    else:
        try:
            result = expr.to_sympy()
            if result is None:
                return None
            # result = sympy.powsimp(result, deep=True)
            result = sympy.METHOD_NAME(result)
            # cancel factors out rationals, so we factor them again
            result = sympy_factor(result)
            return from_sympy(result)
        except sympy.PolynomialError:
            # e.g. for non-commutative expressions
            return expr