Refactoring for the method convetring from sympy logic form to symbolic