Refactored the tests to make them cleaner