refactored functions in Getting Started Arduino