ROC script refactoring