Refactor commit messge handling.