Refactored test framework