Moving code around to make it easier to import into Android Studio