Refactor test runner