Refactored the MVC of the UI to a reasonable structure