Changed API to create DOM directly.