refactor common layout