Optimize DOM nodes creation.