improve patch tool