refactor layout structure