I think it'd be better to register an abstract factory to do that.