tools/test refactor