refactor testing framework