Refactor test utility classes