refactored test setup