Tidy up of mainactivity