Remove dependency on document.createElement