Overwrote to_json to sort by domain