Better layout switching in application controller