Refactoring tests to be cleaner