restructure script.