this is some duplicated/massaged code would need special handling of license here