code  optimize