A Generic object pooling implementation