Speeding up the code by simplifying the control.