refactor test to use scripts