restructuring of model and controller layers