refactored test structure