Moving toward MVC framework. Refactoring.