adding flyweight pattern