re arranging sql scripts a bit