Reorganizing and fine tuning the script files