refactor the desktop app, conform the MVC pattern