changed handling of metatdata to dicts