VID-1996 reducing number of DOM queries