Changed to MVC structure