refactor layouts