reafctoring LEDs control