Refactored dialog layout. No more issues with buttons at the bottom, easier to maintain.