Reorganization of script