implemented flyweight pattern