Refactored the tests for readability