refactoring to MVC yet not finished
refactoring to MVC