Implement MVC pattern.