Changed the name of the function factory() to match the change in core