Refactor to support app-wide layouts