restructuring controllers and views