Optimize CodePieces.constant