Refactor to make it easier to add comparison tests.