init implementation and tests