Various changes, including remaking  as an stdClass