Implementation of MVC pattern