Refactored nesting of application layout.