cleaner way of creating DOM element

D