Factor out tests.