Implementation of basic MVC pattern