remove function from optimizer interface
implement single invoke more correctly