Refactoring To MVC Patterns