Introducing MVC pattern.
(see http://www.leepoint.net/notes-java/GUI/structure/40mvc.html)