speed up code by avoiding duplicate calls for size detection and label update