Layouts refactor