Redesign opt_programid code.