restructured scripts a bit