refactoring test.sh