little code cleanup in mainactivity