refactored to use beforeEach