Flyweight pattern implementation