finish applyOptimized method