I'm all for moving this to a common location once more than one piece of code needs it. I'm not a fan of over-generalizing code before it's clear how it needs to be done.