Altered to use associated objects in lieu of subclassing.