Layout refactor and improvements