Refactor layout view