refactor commit line checking