Always initialize the factory.
Reformatted code.