Improved the test framework