Refactoring many of the tests