Improved MainActivity