refactoring common tests