rework patches to be upstreamable
tweaks