fixed commit init, refactoring