refactor Arduino part