refactoring commit operation
refactoring and improving commit process