Implented MVC pattern