Extracted methods in MainActivity.