Updated to use createDocumentFragment

Hopefully will improve speed a little bit and code readability :-)