some code cleanup in the setup of MainViewController