factor out json/yaml conversion; we can save that for another time :)