Optimized the constructor for Treasure.