fix: fixed and moved metadata casting to util class
fix: construct datasetmetadata with context
fix: allow new formats to be added to context