Refactor test structure