Yet Another (C++) Factory