Refactor stop on commit/discard procedure for a channel