refactored a bit of instanstiateDOMStuff
Merge branch 'master' into hs
Revert "refactored a bit of instanstiateDOMStuff" because it caused a problem and wasn't really necessary

This reverts commit 364699856211d6f8f13b258de5f13252720ef517.
Merge branch 'master' into hs