added MVC pattern