moving functions to codeeditor module