reorder and reformat scripts a bit