Improve test framework