Refactoring the tests to make them cleaner