clean up imports and imporve logging