use ToStyledString method on json values
refactor some generated error messages