polymorphically create objects in flyweight