Layout refactor and validation fixes