more layout refactoring