factorized code into marshalToString
implemented enum
removed debug infos
removed json schema display debugger