Made the factory type safe. Added a uml diagram for the Factory Pattern