Updates MainWindowView layout. Cleans up the code