prepare for destructor
rename enumerators; remove possibly unneeded consts
more error checking; propagate error messages set by the driver.