Factory Method Design Pattern Python