Optimize html display element creation and rendering