rework based on latest delite changes