Full refactoring into MVC framework
Refctoring from Maxim