refactor layout