Code for Flyweight