refactored code to MVC folder system