Avoid query the DOM multiple times