factor out contenteditable