changed to a factory