Converted to MVC framework