First implementation of hitory with factory.