Updated controller to instantiate layout