convert to an MVC style, sort of