refactor test framework