Started refactoring the ui

Started adding classes with single responsibilities, and depending upon
abstractions.