extracted initializer class, added tests