Refactored sub-scripts.