refactor test structure