Refactor to build on Arduino Uno