First try to refactor, and extract some method from the
MainActivity.java