changes code structure meet MVC