improve arduino codes