Refactoring on arduino.php