Replaced more complex element building with direct use of .html().