adatation of scripts to work with optimizer objects