Nearly done with test refactoring