Call 'document.createElement()' only where needed