Minor refactoring and made preview a div, instead of readonly textarea.