Improved code style in MainPage.