a bit of CSS and HTML structure refactoring, also providing a callback hook when the editor contents change