Perform refactoring of codemirror