Arduino refactor