Small refactor on MainActivity.