changed MVC pattern