Changed the factory to contain all the functions