reducing number of getBounds() calls