Advanced Factory Method - C++