Provide method toJsonBuffer and use it instead of concatenating strings.