Implementation of flyweight pattern.