Started changing the rest of the code to use the factory. Major debugging ahead.