separate commit func