C Factory Method Design Pattern