refactoring whichApple()