refactoring this test