Optimizing terminalcontrol