--finished rebuild to better fit MVC pattern