Refactored the first part of the test