Yes, I was right amidst writing a set of classes to do this when I stumbled upon this function.