Factor out the test setup