Code cleanup mainactivity