library and driver cleanup