Restructured MainActivity