Updated most of the factory, except for the methods that haven't been
finished yet.