use metadata_read_* functions where possible