Porting from one single file to MVC pattern.