You're right. I have a (much shorter) patch ready which uses this approach.
I will push it tomorrow after some more testing ;)