breaks initializer code out and adds tests.