several optiocal improvements