Small refactoring of contract tests.