Is this generic enough to be part of a core library?