cleaning of MainPage code