improved formatExpr