Refactor tests, some more work to do