this can be just `md = json.metadata || {};`, if you want to do it that way.