refactored test framework