Refactored test runner