refactoring Commit