Increased code efficiency for dom lookup