Restructure script