ESP32 optimization