Optimize blinking leds and display refresh