Refactor layout and many improvements