refactor test class