Extracted common DOM setup
Eliminated duplication in DOM setup for tests