Lots of layout changes and refactoring.