Refactoring dev and test script