Update Main.cpp

Update to use the general factory