Re-arranging scripts to make things more modular