cleaned the scripts structure a bit