Refactored test scripts