Refactored business logic to MVC paradigm.