<p>One embodiment is a tangible computer readable storage medium having instructions for causing a computer to execute a method, comprising: identifying controls and labels for the controls in a user interface; measuring distances between the labels and the controls; ranking the labels and the controls based on the distances; and assigning each of the labels to one of the controls based on the ranking.</p>