Moved JSON formatting to separate file.