onBackPressed() and code enhancing