Extracted load_json method