Refactor the code out of the UI into various useful components to allow for future improvements.
Not tested (don't have the arm or the controller) so code may or may not work.