small refactoring in the scripts