Formatting and removing unnecessary items in JSON