Use new method of codemirror to clean some code