Added sorter for instances and small cleanup of JSON data