Refactor test execution