refactored Android UI code