refactoring test behavior