We have quite a lot of theese in some of the drivers, would love to refactor this out into something clean and reuseable. Any ideas ?