control code optimization