Remodel with MVC.

Better code organization.