Refactored MainActivity.

Changed click handlers. Code clean up.