small improvement in json serialization