Refactored some tests