JSON output, code formatting changes