Refactored MainActivity to use a fragment