Ok but can you move this into a method of the editor so that it can be used later as a command or something.