Refactoring.
* clean up
* moved some methods out of onOptionsItemSelected