Android: minor code refactoring