refactored for Android Studio.