Refactoring and minor updates in MainActivity class, updated README.