test from appcode
lots of refractoring for MVC