[IMP] models: small code improvement in get_metadata()