some refactor for outputSchema wrapping