REFACTOR scripts mode