implement initparams, cleanup