Refactor CEScriptManager class