Code cleanup in MainActivity.java