Refactoring rerun scripts