Refactor in layouts