Completely refactored MainActivity