Improve functions use to apply hunks and regions