converting to MVC