init: fix issue #23 and little clean up