Switch to using hashtable for retrieving doms