Minor refactoring in test_init